@oneuptime/common 14.0.108 → 14.0.109

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 (494) hide show
  1. package/Models/AnalyticsModels/AuditLog.js +1 -1
  2. package/Models/DatabaseModels/CloudApp.d.mts +5 -0
  3. package/Models/DatabaseModels/CloudApp.d.ts +5 -0
  4. package/Models/DatabaseModels/CloudApp.js +112 -0
  5. package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
  6. package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
  7. package/Models/DatabaseModels/GlobalConfig.js +111 -0
  8. package/Models/DatabaseModels/Index.js +7 -0
  9. package/Models/DatabaseModels/Monitor.js +14 -0
  10. package/Models/DatabaseModels/MonitorStatusTimeline.d.mts +1 -0
  11. package/Models/DatabaseModels/MonitorStatusTimeline.d.ts +1 -0
  12. package/Models/DatabaseModels/MonitorStatusTimeline.js +43 -0
  13. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +4 -0
  14. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +4 -0
  15. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +132 -2
  16. package/Models/DatabaseModels/ProductFeedback.d.mts +11 -0
  17. package/Models/DatabaseModels/ProductFeedback.d.ts +11 -0
  18. package/Models/DatabaseModels/ProductFeedback.js +203 -0
  19. package/Models/DatabaseModels/ProductFeedback.mjs +2 -0
  20. package/Models/DatabaseModels/Project.d.mts +6 -0
  21. package/Models/DatabaseModels/Project.d.ts +6 -0
  22. package/Models/DatabaseModels/Project.js +237 -0
  23. package/Models/DatabaseModels/ProjectMilestone.d.mts +11 -0
  24. package/Models/DatabaseModels/ProjectMilestone.d.ts +11 -0
  25. package/Models/DatabaseModels/ProjectMilestone.js +207 -0
  26. package/Models/DatabaseModels/ProjectMilestone.mjs +2 -0
  27. package/Models/DatabaseModels/ProjectUserPreference.d.mts +11 -0
  28. package/Models/DatabaseModels/ProjectUserPreference.d.ts +11 -0
  29. package/Models/DatabaseModels/ProjectUserPreference.js +194 -0
  30. package/Models/DatabaseModels/ProjectUserPreference.mjs +2 -0
  31. package/Models/DatabaseModels/RumSessionPin.js +16 -2
  32. package/Models/DatabaseModels/RumSessionReplayView.js +8 -1
  33. package/Models/DatabaseModels/SecurityCase.js +8 -1
  34. package/Models/DatabaseModels/User.d.mts +2 -0
  35. package/Models/DatabaseModels/User.d.ts +2 -0
  36. package/Models/DatabaseModels/User.js +52 -0
  37. package/Models/DatabaseModels/UserOnCallLog.js +32 -4
  38. package/Models/DatabaseModels/UserOnCallLogTimeline.js +10 -0
  39. package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
  40. package/Models/DatabaseModels/WorkspaceProjectAuthToken.d.mts +9 -0
  41. package/Models/DatabaseModels/WorkspaceProjectAuthToken.d.ts +9 -0
  42. package/Server/Services/DatabaseService.d.mts +1 -0
  43. package/Server/Services/DatabaseService.d.ts +1 -0
  44. package/Server/Utils/Telemetry/NotificationDeliveryMetrics.d.mts +2 -1
  45. package/Server/Utils/Telemetry/NotificationDeliveryMetrics.d.ts +2 -1
  46. package/Server/Utils/Workspace/WorkspaceBase.d.mts +1 -0
  47. package/Server/Utils/Workspace/WorkspaceBase.d.ts +1 -0
  48. package/Types/AI/AIActionWords.d.mts +167 -7
  49. package/Types/AI/AIActionWords.d.ts +167 -7
  50. package/Types/AI/AIActionWords.js +474 -17
  51. package/Types/AI/AIActionWords.mjs +22 -0
  52. package/Types/AI/AIChatMessageStatus.js +3 -2
  53. package/Types/AI/AIChatRecordSeen.d.mts +6 -2
  54. package/Types/AI/AIChatRecordSeen.d.ts +6 -2
  55. package/Types/AI/AIChatRecordSeen.js +48 -9
  56. package/Types/AI/AIChatRecordSeen.mjs +2 -0
  57. package/Types/AI/AIChatTypes.d.mts +19 -1
  58. package/Types/AI/AIChatTypes.d.ts +19 -1
  59. package/Types/AI/AIChatTypes.js +44 -1
  60. package/Types/AI/AIChatTypes.mjs +3 -0
  61. package/Types/AI/AIRunAttempt.d.mts +8 -0
  62. package/Types/AI/AIRunAttempt.d.ts +8 -0
  63. package/Types/AI/AIRunAttempt.js +60 -6
  64. package/Types/AI/AIRunAttempt.mjs +3 -0
  65. package/Types/AI/AISetupActions.d.mts +9 -0
  66. package/Types/AI/AISetupActions.d.ts +9 -0
  67. package/Types/AI/AISetupActions.js +56 -0
  68. package/Types/AI/AISetupActions.mjs +10 -0
  69. package/Types/AI/CodeTask.d.mts +14 -0
  70. package/Types/AI/CodeTask.d.ts +14 -0
  71. package/Types/AI/RecordAiTokenLimit.d.mts +24 -0
  72. package/Types/AI/RecordAiTokenLimit.d.ts +24 -0
  73. package/Types/AI/RecordAiTokenLimit.js +153 -0
  74. package/Types/AI/RecordAiTokenLimit.mjs +8 -0
  75. package/Types/Accounts/SignInMessages.d.mts +8 -0
  76. package/Types/Accounts/SignInMessages.d.ts +8 -0
  77. package/Types/Accounts/SignInMessages.js +28 -0
  78. package/Types/Accounts/SignInMessages.mjs +5 -0
  79. package/Types/Analytics/ActivationMilestone.d.mts +48 -0
  80. package/Types/Analytics/ActivationMilestone.d.ts +48 -0
  81. package/Types/Analytics/ActivationMilestone.js +247 -0
  82. package/Types/Analytics/ActivationMilestone.mjs +16 -0
  83. package/Types/Analytics/ChecklistProgress.d.mts +11 -0
  84. package/Types/Analytics/ChecklistProgress.d.ts +11 -0
  85. package/Types/Analytics/ChecklistProgress.js +32 -0
  86. package/Types/Analytics/ChecklistProgress.mjs +2 -0
  87. package/Types/Analytics/ProductEvent.d.mts +61 -0
  88. package/Types/Analytics/ProductEvent.d.ts +61 -0
  89. package/Types/Analytics/ProductEvent.js +430 -0
  90. package/Types/Analytics/ProductEvent.mjs +14 -0
  91. package/Types/AuditLog/AuditLogAction.d.mts +5 -1
  92. package/Types/AuditLog/AuditLogAction.d.ts +5 -1
  93. package/Types/AuditLog/AuditLogAction.js +11 -0
  94. package/Types/AuditLog/AuditLogActionLabel.d.mts +3 -0
  95. package/Types/AuditLog/AuditLogActionLabel.d.ts +3 -0
  96. package/Types/AuditLog/AuditLogActionLabel.js +30 -0
  97. package/Types/AuditLog/AuditLogActionLabel.mjs +3 -0
  98. package/Types/AuditLog/AuditLogCoverage.d.mts +2 -1
  99. package/Types/AuditLog/AuditLogCoverage.d.ts +2 -1
  100. package/Types/AuditLog/AuditLogCoverage.js +8 -1
  101. package/Types/AuditLog/AuditLogRetention.js +7 -4
  102. package/Types/AuditLog/AuditLogSessionEvent.d.mts +45 -0
  103. package/Types/AuditLog/AuditLogSessionEvent.d.ts +45 -0
  104. package/Types/AuditLog/AuditLogSessionEvent.js +210 -0
  105. package/Types/AuditLog/AuditLogSessionEvent.mjs +14 -0
  106. package/Types/AutoRemediation/RemediationRound.d.mts +4 -0
  107. package/Types/AutoRemediation/RemediationRound.d.ts +4 -0
  108. package/Types/AutoRemediation/RemediationRound.js +19 -2
  109. package/Types/AutoRemediation/RemediationRoundName.d.mts +1 -0
  110. package/Types/AutoRemediation/RemediationRoundName.d.ts +1 -0
  111. package/Types/AutoRemediation/RemediationRoundName.js +5 -0
  112. package/Types/AutoRemediation/RemediationRoundName.mjs +1 -0
  113. package/Types/Cloud/CloudAppTelemetrySignal.d.mts +9 -0
  114. package/Types/Cloud/CloudAppTelemetrySignal.d.ts +9 -0
  115. package/Types/Cloud/CloudAppTelemetrySignal.js +41 -0
  116. package/Types/Cloud/CloudAppTelemetrySignal.mjs +4 -0
  117. package/Types/Cloud/CloudPlatform.js +7 -1
  118. package/Types/CodeRepository/CodeFileSeen.d.mts +5 -0
  119. package/Types/CodeRepository/CodeFileSeen.d.ts +5 -0
  120. package/Types/CodeRepository/CodeFileSeen.js +142 -27
  121. package/Types/CustomDomain/CustomDomainDnsCheckResult.d.mts +13 -0
  122. package/Types/CustomDomain/CustomDomainDnsCheckResult.d.ts +13 -0
  123. package/Types/CustomDomain/CustomDomainDnsCheckResult.js +80 -0
  124. package/Types/CustomDomain/CustomDomainDnsCheckResult.mjs +2 -0
  125. package/Types/CustomDomain/CustomDomainServerReadiness.d.mts +55 -0
  126. package/Types/CustomDomain/CustomDomainServerReadiness.d.ts +55 -0
  127. package/Types/CustomDomain/CustomDomainServerReadiness.js +199 -0
  128. package/Types/CustomDomain/CustomDomainServerReadiness.mjs +8 -0
  129. package/Types/CustomDomain/DnsRecordCheck.d.mts +34 -0
  130. package/Types/CustomDomain/DnsRecordCheck.d.ts +34 -0
  131. package/Types/CustomDomain/DnsRecordCheck.js +175 -0
  132. package/Types/CustomDomain/DnsRecordCheck.mjs +6 -0
  133. package/Types/CustomDomain/DnsRecordCheckWords.d.mts +35 -0
  134. package/Types/CustomDomain/DnsRecordCheckWords.d.ts +35 -0
  135. package/Types/CustomDomain/DnsRecordCheckWords.js +151 -0
  136. package/Types/CustomDomain/DnsRecordCheckWords.mjs +5 -0
  137. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.mts +1 -0
  138. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.ts +1 -0
  139. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.js +11 -1
  140. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.mjs +1 -0
  141. package/Types/DataObservability/DataCheckType.d.mts +4 -0
  142. package/Types/DataObservability/DataCheckType.d.ts +4 -0
  143. package/Types/DataObservability/DataCheckType.js +17 -0
  144. package/Types/DataObservability/DataCheckType.mjs +1 -0
  145. package/Types/DataObservability/DataLineageColumnTrail.d.mts +10 -0
  146. package/Types/DataObservability/DataLineageColumnTrail.d.ts +10 -0
  147. package/Types/DataObservability/DataLineageColumnTrail.js +152 -0
  148. package/Types/DataObservability/DataLineageColumnTrail.mjs +4 -0
  149. package/Types/DataObservability/DataLineageExpansion.d.mts +29 -0
  150. package/Types/DataObservability/DataLineageExpansion.d.ts +29 -0
  151. package/Types/DataObservability/DataLineageExpansion.js +166 -0
  152. package/Types/DataObservability/DataLineageExpansion.mjs +4 -0
  153. package/Types/DataObservability/DataObservabilityApiTypes.d.mts +1 -0
  154. package/Types/DataObservability/DataObservabilityApiTypes.d.ts +1 -0
  155. package/Types/DataObservability/DataObservabilityApiTypes.js +2 -0
  156. package/Types/DataObservability/DataTableLineage.d.mts +7 -0
  157. package/Types/DataObservability/DataTableLineage.d.ts +7 -0
  158. package/Types/DataObservability/DataTableLineage.js +15 -3
  159. package/Types/DataObservability/DataTableLineage.mjs +1 -0
  160. package/Types/Date.d.mts +22 -0
  161. package/Types/Date.d.ts +22 -0
  162. package/Types/Date.js +72 -3
  163. package/Types/DateLanguage.d.mts +7 -0
  164. package/Types/DateLanguage.d.ts +7 -0
  165. package/Types/DateLanguage.js +44 -1
  166. package/Types/DateLanguage.mjs +1 -0
  167. package/Types/Docs/DocsLanguage.d.mts +2 -0
  168. package/Types/Docs/DocsLanguage.d.ts +2 -0
  169. package/Types/Docs/DocsLanguage.js +23 -1
  170. package/Types/Docs/DocsLanguage.mjs +2 -0
  171. package/Types/Docs/GlossaryTerm.d.mts +82 -0
  172. package/Types/Docs/GlossaryTerm.d.ts +82 -0
  173. package/Types/Docs/GlossaryTerm.js +126 -0
  174. package/Types/Docs/GlossaryTerm.mjs +5 -0
  175. package/Types/Email/AmazonSesAuthenticationType.d.mts +23 -0
  176. package/Types/Email/AmazonSesAuthenticationType.d.ts +23 -0
  177. package/Types/Email/AmazonSesAuthenticationType.js +40 -0
  178. package/Types/Email/AmazonSesAuthenticationType.mjs +4 -0
  179. package/Types/Email/EmailServer.d.mts +2 -0
  180. package/Types/Email/EmailServer.d.ts +2 -0
  181. package/Types/Email/EmailTemplateType.d.mts +1 -0
  182. package/Types/Email/EmailTemplateType.d.ts +1 -0
  183. package/Types/Email/EmailTemplateType.js +2 -0
  184. package/Types/Exception/BadDataExceptionWithDetails.d.mts +6 -0
  185. package/Types/Exception/BadDataExceptionWithDetails.d.ts +6 -0
  186. package/Types/Exception/BadDataExceptionWithDetails.js +20 -0
  187. package/Types/Exception/BadDataExceptionWithDetails.mjs +2 -0
  188. package/Types/Exception/ErrorMessageRule.d.mts +4 -0
  189. package/Types/Exception/ErrorMessageRule.d.ts +4 -0
  190. package/Types/Exception/ErrorMessageRule.js +143 -0
  191. package/Types/Exception/ErrorMessageRule.mjs +5 -0
  192. package/Types/Exception/UnexplainedError.d.mts +45 -0
  193. package/Types/Exception/UnexplainedError.d.ts +45 -0
  194. package/Types/Exception/UnexplainedError.js +179 -0
  195. package/Types/Exception/UnexplainedError.mjs +11 -0
  196. package/Types/Icon/IconProp.d.mts +4 -1
  197. package/Types/Icon/IconProp.d.ts +4 -1
  198. package/Types/Icon/IconProp.js +6 -0
  199. package/Types/InstallationHealth/InstallationHealth.d.mts +122 -0
  200. package/Types/InstallationHealth/InstallationHealth.d.ts +122 -0
  201. package/Types/InstallationHealth/InstallationHealth.js +513 -0
  202. package/Types/InstallationHealth/InstallationHealth.mjs +13 -0
  203. package/Types/LLM/LLMProviderExchange.d.mts +17 -0
  204. package/Types/LLM/LLMProviderExchange.d.ts +17 -0
  205. package/Types/LLM/LLMProviderExchange.js +70 -0
  206. package/Types/LLM/LLMProviderExchange.mjs +5 -0
  207. package/Types/Monitor/CriteriaFilter.d.mts +1 -0
  208. package/Types/Monitor/CriteriaFilter.d.ts +1 -0
  209. package/Types/Monitor/CriteriaFilter.js +3 -1
  210. package/Types/Monitor/CriteriaFilterTerms.js +1 -0
  211. package/Types/Monitor/CriteriaFilterValues.d.mts +2 -0
  212. package/Types/Monitor/CriteriaFilterValues.d.ts +2 -0
  213. package/Types/Monitor/CriteriaFilterValues.js +22 -0
  214. package/Types/Monitor/EvaluationSentence.d.mts +1 -0
  215. package/Types/Monitor/EvaluationSentence.d.ts +1 -0
  216. package/Types/Monitor/EvaluationSentence.js +34 -3
  217. package/Types/Monitor/EvaluationSentence.mjs +1 -0
  218. package/Types/Monitor/RetiredEvaluationTemplates.d.mts +2 -0
  219. package/Types/Monitor/RetiredEvaluationTemplates.d.ts +2 -0
  220. package/Types/Monitor/RetiredEvaluationTemplates.js +95 -0
  221. package/Types/Monitor/RetiredEvaluationTemplates.mjs +3 -0
  222. package/Types/Monitor/SSLMonitor/CertificateRevocationCheckMethod.d.mts +6 -0
  223. package/Types/Monitor/SSLMonitor/CertificateRevocationCheckMethod.d.ts +6 -0
  224. package/Types/Monitor/SSLMonitor/CertificateRevocationCheckMethod.js +20 -0
  225. package/Types/Monitor/SSLMonitor/CertificateRevocationCheckMethod.mjs +2 -0
  226. package/Types/Monitor/SSLMonitor/CertificateRevocationStatus.d.mts +6 -0
  227. package/Types/Monitor/SSLMonitor/CertificateRevocationStatus.d.ts +6 -0
  228. package/Types/Monitor/SSLMonitor/CertificateRevocationStatus.js +29 -0
  229. package/Types/Monitor/SSLMonitor/CertificateRevocationStatus.mjs +2 -0
  230. package/Types/Monitor/SSLMonitor/SslMonitorResponse.d.mts +7 -0
  231. package/Types/Monitor/SSLMonitor/SslMonitorResponse.d.ts +7 -0
  232. package/Types/Monitor/WhoIsTold.d.mts +165 -0
  233. package/Types/Monitor/WhoIsTold.d.ts +165 -0
  234. package/Types/Monitor/WhoIsTold.js +582 -0
  235. package/Types/Monitor/WhoIsTold.mjs +17 -0
  236. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.mts +6 -0
  237. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.ts +6 -0
  238. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.js +34 -0
  239. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.mjs +2 -0
  240. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +240 -0
  241. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +240 -0
  242. package/Types/OnCallDutyPolicy/OnCallTestPage.js +574 -0
  243. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +52 -0
  244. package/Types/OnCallDutyPolicy/OnCallTestPageWords.d.mts +31 -0
  245. package/Types/OnCallDutyPolicy/OnCallTestPageWords.d.ts +31 -0
  246. package/Types/OnCallDutyPolicy/OnCallTestPageWords.js +105 -0
  247. package/Types/OnCallDutyPolicy/OnCallTestPageWords.mjs +14 -0
  248. package/Types/PhoneNumberDirection.d.mts +6 -0
  249. package/Types/PhoneNumberDirection.d.ts +6 -0
  250. package/Types/PhoneNumberDirection.js +123 -0
  251. package/Types/PhoneNumberDirection.mjs +6 -0
  252. package/Types/Product/ProductKey.d.mts +58 -0
  253. package/Types/Product/ProductKey.d.ts +58 -0
  254. package/Types/Product/ProductKey.js +175 -0
  255. package/Types/Product/ProductKey.mjs +8 -0
  256. package/Types/Product/ProductPins.d.mts +10 -0
  257. package/Types/Product/ProductPins.d.ts +10 -0
  258. package/Types/Product/ProductPins.js +65 -0
  259. package/Types/Product/ProductPins.mjs +6 -0
  260. package/Types/Product/ProductUsage.d.mts +21 -0
  261. package/Types/Product/ProductUsage.d.ts +21 -0
  262. package/Types/Product/ProductUsage.js +175 -0
  263. package/Types/Product/ProductUsage.mjs +10 -0
  264. package/Types/Product/ProjectProducts.d.mts +60 -0
  265. package/Types/Product/ProjectProducts.d.ts +60 -0
  266. package/Types/Product/ProjectProducts.js +336 -0
  267. package/Types/Product/ProjectProducts.mjs +19 -0
  268. package/Types/Product/ProjectProductsAnswer.d.mts +20 -0
  269. package/Types/Product/ProjectProductsAnswer.d.ts +20 -0
  270. package/Types/Product/ProjectProductsAnswer.js +139 -0
  271. package/Types/Product/ProjectProductsAnswer.mjs +7 -0
  272. package/Types/ProductFeedback/NewGitHubIssue.d.mts +12 -0
  273. package/Types/ProductFeedback/NewGitHubIssue.d.ts +12 -0
  274. package/Types/ProductFeedback/NewGitHubIssue.js +64 -0
  275. package/Types/ProductFeedback/NewGitHubIssue.mjs +5 -0
  276. package/Types/ProductFeedback/ProductFeedback.d.mts +140 -0
  277. package/Types/ProductFeedback/ProductFeedback.d.ts +140 -0
  278. package/Types/ProductFeedback/ProductFeedback.js +517 -0
  279. package/Types/ProductFeedback/ProductFeedback.mjs +49 -0
  280. package/Types/ReadingDirection.d.mts +2 -0
  281. package/Types/ReadingDirection.d.ts +2 -0
  282. package/Types/ReadingDirection.js +83 -2
  283. package/Types/ReadingDirection.mjs +2 -0
  284. package/Types/Recommendation/RecommendationType.d.mts +2 -1
  285. package/Types/Recommendation/RecommendationType.d.ts +2 -1
  286. package/Types/Recommendation/RecommendationType.js +6 -0
  287. package/Types/Reminder/ReminderInterval.d.mts +7 -0
  288. package/Types/Reminder/ReminderInterval.d.ts +7 -0
  289. package/Types/Reminder/ReminderInterval.js +110 -0
  290. package/Types/Reminder/ReminderInterval.mjs +8 -0
  291. package/Types/Retention/ResolvedRecordRetention.d.mts +19 -0
  292. package/Types/Retention/ResolvedRecordRetention.d.ts +19 -0
  293. package/Types/Retention/ResolvedRecordRetention.js +124 -0
  294. package/Types/Retention/ResolvedRecordRetention.mjs +14 -0
  295. package/Types/RollingTime/RollingTimeUtil.d.mts +1 -0
  296. package/Types/RollingTime/RollingTimeUtil.d.ts +1 -0
  297. package/Types/RollingTime/RollingTimeUtil.js +9 -0
  298. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +108 -101
  299. package/Types/ServerSending/ServerSendingStatus.d.mts +69 -0
  300. package/Types/ServerSending/ServerSendingStatus.d.ts +69 -0
  301. package/Types/ServerSending/ServerSendingStatus.js +281 -0
  302. package/Types/ServerSending/ServerSendingStatus.mjs +7 -0
  303. package/Types/ServerSending/ServerSendingWords.d.mts +9 -0
  304. package/Types/ServerSending/ServerSendingWords.d.ts +9 -0
  305. package/Types/ServerSending/ServerSendingWords.js +95 -0
  306. package/Types/ServerSending/ServerSendingWords.mjs +7 -0
  307. package/Types/ServerSetup/ServerSetupChecklist.d.mts +172 -0
  308. package/Types/ServerSetup/ServerSetupChecklist.d.ts +172 -0
  309. package/Types/ServerSetup/ServerSetupChecklist.js +735 -0
  310. package/Types/ServerSetup/ServerSetupChecklist.mjs +12 -0
  311. package/Types/ServerSetup/ServerTestSend.d.mts +35 -0
  312. package/Types/ServerSetup/ServerTestSend.d.ts +35 -0
  313. package/Types/ServerSetup/ServerTestSend.js +160 -0
  314. package/Types/ServerSetup/ServerTestSend.mjs +10 -0
  315. package/Types/SetupHealth/SetupHealth.d.mts +283 -0
  316. package/Types/SetupHealth/SetupHealth.d.ts +283 -0
  317. package/Types/SetupHealth/SetupHealth.js +1047 -0
  318. package/Types/SetupHealth/SetupHealth.mjs +46 -0
  319. package/Types/StatusPage/StatusPageSummary.d.mts +1 -0
  320. package/Types/StatusPage/StatusPageSummary.d.ts +1 -0
  321. package/Types/StatusPage/StatusPageSummary.js +3 -0
  322. package/Types/StatusPage/UptimeDailyAggregate.d.mts +25 -0
  323. package/Types/StatusPage/UptimeDailyAggregate.d.ts +25 -0
  324. package/Types/Telemetry/LlmCallKind.js +1 -1
  325. package/Types/Telemetry/TelemetryIngestionBudget.d.mts +1 -0
  326. package/Types/Telemetry/TelemetryIngestionBudget.d.ts +1 -0
  327. package/Types/Telemetry/TelemetryIngestionBudget.js +135 -2
  328. package/Types/Telemetry/TelemetryIngestionBudget.mjs +1 -0
  329. package/Types/ToolImport/ToolImportCatalog.d.mts +1 -0
  330. package/Types/ToolImport/ToolImportCatalog.d.ts +1 -0
  331. package/Types/ToolImport/ToolImportCatalog.js +54 -1
  332. package/Types/ToolImport/ToolImportCatalog.mjs +1 -0
  333. package/Types/Translator.js +64 -31
  334. package/Types/UserNotification/UserNotificationEventType.d.mts +2 -1
  335. package/Types/UserNotification/UserNotificationEventType.d.ts +2 -1
  336. package/Types/UserNotification/UserNotificationEventType.js +7 -0
  337. package/Types/UserSession/SessionEndCause.d.mts +17 -0
  338. package/Types/UserSession/SessionEndCause.d.ts +17 -0
  339. package/Types/UserSession/SessionEndCause.js +79 -0
  340. package/Types/UserSession/SessionEndCause.mjs +6 -0
  341. package/Types/UserSession/SessionSignIn.d.mts +44 -0
  342. package/Types/UserSession/SessionSignIn.d.ts +44 -0
  343. package/Types/UserSession/SessionSignIn.js +174 -0
  344. package/Types/UserSession/SessionSignIn.mjs +17 -0
  345. package/Types/WelcomeChecklist/ProjectGoal.d.mts +16 -0
  346. package/Types/WelcomeChecklist/ProjectGoal.d.ts +16 -0
  347. package/Types/WelcomeChecklist/ProjectGoal.js +94 -0
  348. package/Types/WelcomeChecklist/ProjectGoal.mjs +8 -0
  349. package/Types/WelcomeChecklist/WelcomeChecklist.d.mts +76 -0
  350. package/Types/WelcomeChecklist/WelcomeChecklist.d.ts +76 -0
  351. package/Types/WelcomeChecklist/WelcomeChecklist.js +344 -0
  352. package/Types/WelcomeChecklist/WelcomeChecklist.mjs +19 -0
  353. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.mts +24 -0
  354. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.ts +24 -0
  355. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.js +136 -0
  356. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.mjs +9 -0
  357. package/Types/WelcomeChecklist/WelcomeChecklistState.d.mts +27 -0
  358. package/Types/WelcomeChecklist/WelcomeChecklistState.d.ts +27 -0
  359. package/Types/WelcomeChecklist/WelcomeChecklistState.js +183 -0
  360. package/Types/WelcomeChecklist/WelcomeChecklistState.mjs +13 -0
  361. package/Types/Workflow/Documentation/AIDocumentation.js +1 -1
  362. package/Types/Workspace/NotificationSummary/WorkspaceSummaryTestChannel.d.mts +7 -0
  363. package/Types/Workspace/NotificationSummary/WorkspaceSummaryTestChannel.d.ts +7 -0
  364. package/Types/Workspace/NotificationSummary/WorkspaceSummaryTestChannel.js +40 -0
  365. package/Types/Workspace/NotificationSummary/WorkspaceSummaryTestChannel.mjs +3 -0
  366. package/Types/Workspace/WorkspaceChannelMembers.d.mts +1 -0
  367. package/Types/Workspace/WorkspaceChannelMembers.d.ts +1 -0
  368. package/Types/Workspace/WorkspaceChannelMembers.js +9 -2
  369. package/UI/Components/Dropdown/Dropdown.d.mts +1 -0
  370. package/UI/Components/Dropdown/Dropdown.d.ts +1 -0
  371. package/Utils/API.js +10 -0
  372. package/Utils/Dashboard/DashboardWidgetSorts.js +25 -4
  373. package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +37 -0
  374. package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +37 -0
  375. package/Utils/Dashboard/MonitorListWidgetFormat.js +86 -0
  376. package/Utils/Dashboard/MonitorListWidgetFormat.mjs +10 -0
  377. package/Utils/GuidedSetup/OnCallPolicyRecords.d.mts +31 -0
  378. package/Utils/GuidedSetup/OnCallPolicyRecords.d.ts +31 -0
  379. package/Utils/GuidedSetup/OnCallPolicyRecords.js +89 -0
  380. package/Utils/GuidedSetup/OnCallPolicyRecords.mjs +6 -0
  381. package/Utils/GuidedSetup/StatusPageRecords.d.mts +36 -0
  382. package/Utils/GuidedSetup/StatusPageRecords.d.ts +36 -0
  383. package/Utils/GuidedSetup/StatusPageRecords.js +105 -0
  384. package/Utils/GuidedSetup/StatusPageRecords.mjs +6 -0
  385. package/Utils/GuidedSetup/WebsiteMonitorRecords.d.mts +41 -0
  386. package/Utils/GuidedSetup/WebsiteMonitorRecords.d.ts +41 -0
  387. package/Utils/GuidedSetup/WebsiteMonitorRecords.js +204 -0
  388. package/Utils/GuidedSetup/WebsiteMonitorRecords.mjs +9 -0
  389. package/Utils/Markdown/InlineImageDataUri.d.mts +9 -0
  390. package/Utils/Markdown/InlineImageDataUri.d.ts +9 -0
  391. package/Utils/Markdown/InlineImageDataUri.js +17 -1
  392. package/Utils/Markdown/InlineImageDataUri.mjs +1 -0
  393. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +12 -0
  394. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +12 -0
  395. package/Utils/Markdown/LinkReferenceDefinitions.js +539 -0
  396. package/Utils/Markdown/LinkReferenceDefinitions.mjs +4 -0
  397. package/Utils/Monitor/ExternalStatusPageReading.d.mts +9 -0
  398. package/Utils/Monitor/ExternalStatusPageReading.d.ts +9 -0
  399. package/Utils/Monitor/ExternalStatusPageReading.js +77 -8
  400. package/Utils/Monitor/ExternalStatusPageReading.mjs +3 -0
  401. package/Utils/Monitor/ExternalStatusPageScope.js +17 -1
  402. package/Utils/Monitor/MonitorDestinationUtil.js +2 -1
  403. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +2 -1
  404. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +2 -1
  405. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +10 -1
  406. package/Utils/Monitor/MonitorStatusHistoryUtil.d.mts +1 -0
  407. package/Utils/Monitor/MonitorStatusHistoryUtil.d.ts +1 -0
  408. package/Utils/Monitor/MonitorStatusHistoryUtil.js +1 -0
  409. package/Utils/Monitor/MonitorSummaryProbeUtil.d.mts +2 -0
  410. package/Utils/Monitor/MonitorSummaryProbeUtil.d.ts +2 -0
  411. package/Utils/Monitor/MonitorSummaryProbeUtil.js +13 -17
  412. package/Utils/Monitor/MonitorSummarySnapshotUtil.js +5 -3
  413. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.mts +1 -1
  414. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.ts +1 -1
  415. package/Utils/Monitor/MonitorUptimeSummaryUtil.js +1 -0
  416. package/Utils/Monitor/MonitoringOff.d.mts +20 -0
  417. package/Utils/Monitor/MonitoringOff.d.ts +20 -0
  418. package/Utils/Monitor/MonitoringOff.js +81 -0
  419. package/Utils/Monitor/MonitoringOff.mjs +4 -0
  420. package/Utils/Monitor/NotOperationalMonitorQuery.js +9 -7
  421. package/Utils/Monitor/StateChangeLogScreenshots.d.mts +8 -0
  422. package/Utils/Monitor/StateChangeLogScreenshots.d.ts +8 -0
  423. package/Utils/Monitor/StateChangeLogScreenshots.js +116 -0
  424. package/Utils/Monitor/StateChangeLogScreenshots.mjs +3 -0
  425. package/Utils/NetworkDevice/Naming/NamingLookup.d.mts +1 -1
  426. package/Utils/NetworkDevice/Naming/NamingLookup.d.ts +1 -1
  427. package/Utils/NetworkDevice/Naming/NamingLookup.js +14 -4
  428. package/Utils/NetworkDevice/Naming/NamingLookup.mjs +1 -0
  429. package/Utils/Slo/SloErrorBudgetPolicy.d.mts +2 -1
  430. package/Utils/Slo/SloErrorBudgetPolicy.d.ts +2 -1
  431. package/Utils/Slo/SloErrorBudgetPolicy.js +8 -2
  432. package/Utils/Slo/SloListWidgetFormat.d.mts +7 -1
  433. package/Utils/Slo/SloListWidgetFormat.d.ts +7 -1
  434. package/Utils/Slo/SloListWidgetFormat.js +20 -26
  435. package/Utils/Slo/SloOverviewText.d.mts +6 -1
  436. package/Utils/Slo/SloOverviewText.d.ts +6 -1
  437. package/Utils/Slo/SloOverviewText.js +3 -3
  438. package/Utils/Slo/SloUtil.d.mts +18 -9
  439. package/Utils/Slo/SloUtil.d.ts +18 -9
  440. package/Utils/Slo/SloUtil.js +47 -10
  441. package/Utils/Slo/SloWidgetFormat.d.mts +69 -11
  442. package/Utils/Slo/SloWidgetFormat.d.ts +69 -11
  443. package/Utils/Slo/SloWidgetFormat.js +198 -50
  444. package/Utils/Slo/SloWidgetFormat.mjs +7 -0
  445. package/Utils/StatusPage/FrozenMonitorResources.d.mts +41 -0
  446. package/Utils/StatusPage/FrozenMonitorResources.d.ts +41 -0
  447. package/Utils/StatusPage/FrozenMonitorResources.js +155 -0
  448. package/Utils/StatusPage/FrozenMonitorResources.mjs +4 -0
  449. package/Utils/StatusPage/GroupNestingLayout.d.mts +2 -0
  450. package/Utils/StatusPage/GroupNestingLayout.d.ts +2 -0
  451. package/Utils/StatusPage/GroupNestingLayout.js +12 -0
  452. package/Utils/StatusPage/MonitorGroupUptimeDailyAggregateUtil.d.mts +48 -0
  453. package/Utils/StatusPage/MonitorGroupUptimeDailyAggregateUtil.d.ts +48 -0
  454. package/Utils/StatusPage/MonitorGroupUptimeDailyAggregateUtil.js +181 -0
  455. package/Utils/StatusPage/MonitorGroupUptimeDailyAggregateUtil.mjs +2 -0
  456. package/Utils/StatusPage/ResourceExplorer.d.mts +1 -0
  457. package/Utils/StatusPage/ResourceExplorer.d.ts +1 -0
  458. package/Utils/StatusPage/ResourceExplorer.js +11 -1
  459. package/Utils/StatusPage/ResourceUptime.d.mts +6 -1
  460. package/Utils/StatusPage/ResourceUptime.d.ts +6 -1
  461. package/Utils/StatusPage/ResourceUptime.js +31 -6
  462. package/Utils/StatusPage/StatusPageSummaryBuilder.d.mts +1 -0
  463. package/Utils/StatusPage/StatusPageSummaryBuilder.d.ts +1 -0
  464. package/Utils/StatusPage/StatusPageSummaryBuilder.js +12 -1
  465. package/Utils/StatusPage/StatusPageUptimeTimezone.d.mts +41 -0
  466. package/Utils/StatusPage/StatusPageUptimeTimezone.d.ts +41 -0
  467. package/Utils/StatusPage/StatusPageUptimeTimezone.js +114 -0
  468. package/Utils/StatusPage/StatusPageUptimeTimezone.mjs +2 -0
  469. package/Utils/StatusPage/UptimeDailyAggregateUtil.d.mts +3 -1
  470. package/Utils/StatusPage/UptimeDailyAggregateUtil.d.ts +3 -1
  471. package/Utils/StatusPage/UptimeDailyAggregateUtil.js +69 -50
  472. package/Utils/Telemetry/CloudInstanceIdentity.js +12 -7
  473. package/Utils/Uptime/DayUptimeGraphUtil.d.mts +8 -0
  474. package/Utils/Uptime/DayUptimeGraphUtil.d.ts +8 -0
  475. package/Utils/Uptime/DayUptimeGraphUtil.js +41 -6
  476. package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +3 -0
  477. package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +3 -0
  478. package/Utils/Uptime/UptimeMaintenanceUtil.js +49 -0
  479. package/Utils/Uptime/UptimeUtil.d.mts +38 -1
  480. package/Utils/Uptime/UptimeUtil.d.ts +38 -1
  481. package/Utils/Uptime/UptimeUtil.js +270 -75
  482. package/Utils/Uptime/WorstStatusTimeline.d.mts +31 -0
  483. package/Utils/Uptime/WorstStatusTimeline.d.ts +31 -0
  484. package/Utils/Uptime/WorstStatusTimeline.js +190 -0
  485. package/Utils/Uptime/WorstStatusTimeline.mjs +2 -0
  486. package/Utils/Workspace/WorkspaceSummarySetup.d.mts +25 -0
  487. package/Utils/Workspace/WorkspaceSummarySetup.d.ts +25 -0
  488. package/Utils/Workspace/WorkspaceSummarySetup.js +215 -0
  489. package/Utils/Workspace/WorkspaceSummarySetup.mjs +11 -0
  490. package/package.json +1 -1
  491. package/Utils/StatusPage/ArchivedMonitorResources.d.mts +0 -10
  492. package/Utils/StatusPage/ArchivedMonitorResources.d.ts +0 -10
  493. package/Utils/StatusPage/ArchivedMonitorResources.js +0 -33
  494. package/Utils/StatusPage/ArchivedMonitorResources.mjs +0 -2
@@ -0,0 +1,574 @@
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.OnCallTestPageNotPagedCode = exports.OnCallTestPageWarningCode = exports.OnCallTestPageReachedThroughCode = exports.OnCallTestPageStepStatus = exports.OnCallTestPageFix = exports.OnCallTestPageDeliveryStatus = exports.OnCallTestPageStatus = exports.OnCallTestPageKind = exports.ON_CALL_TEST_PAGE_NOTIFICATION_ACKNOWLEDGED_MESSAGE = exports.ON_CALL_TEST_PAGE_ANSWERED_MESSAGE = exports.ON_CALL_TEST_PAGE_ANSWERED_TITLE = exports.ON_CALL_TEST_PAGE_ACKNOWLEDGE_MESSAGE = exports.ON_CALL_TEST_PAGE_ACKNOWLEDGE_TITLE = exports.ON_CALL_TEST_PAGE_ACKNOWLEDGEABLE_CHANNELS = exports.ON_CALL_TEST_PAGE_RUN_UNREADABLE_MESSAGE = exports.ON_CALL_TEST_PAGE_RULES_RAN_MESSAGE = exports.ON_CALL_TEST_PAGE_WENT_THROUGH_EVERY_LEVEL_MESSAGE = exports.ON_CALL_TEST_PAGE_ENDED_UNANSWERED_MESSAGE = exports.ON_CALL_TEST_PAGE_FIRST_LEVEL_REACHED_NOBODY_MESSAGE = exports.ON_CALL_TEST_PAGE_FIRST_LEVEL_PAGED_MESSAGE = exports.ON_CALL_TEST_PAGE_NOBODY_PAGED_MESSAGE = exports.ON_CALL_TEST_PAGE_STARTED_ELSEWHERE_MESSAGE = exports.ON_CALL_TEST_PAGE_LIMIT_UNREADABLE_MESSAGE = exports.ON_CALL_TEST_PAGE_PROJECT_LIMIT_MESSAGE = exports.ON_CALL_TEST_PAGES_PER_PROJECT_PER_HOUR = exports.ON_CALL_TEST_PAGE_POLICY_INTERVAL_IN_SECONDS = exports.ON_CALL_TEST_PAGE_PERSON_INTERVAL_IN_SECONDS = exports.ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN_MINUTES = exports.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES = exports.ON_CALL_TEST_PAGE_RECORD_KINDS = exports.OnCallTestPageRecordKind = void 0;
7
+ exports.isOnCallTestPageRecordKind = isOnCallTestPageRecordKind;
8
+ exports.getOnCallTestPageRuleType = getOnCallTestPageRuleType;
9
+ exports.isOnCallTestPage = isOnCallTestPage;
10
+ exports.hasOnCallTestPageAnswerWindowPassed = hasOnCallTestPageAnswerWindowPassed;
11
+ exports.getOnCallTestPageEndsAt = getOnCallTestPageEndsAt;
12
+ exports.getOnCallTestPageEscalationWaitInMinutes = getOnCallTestPageEscalationWaitInMinutes;
13
+ exports.describeOnCallTestPageWait = describeOnCallTestPageWait;
14
+ exports.getOnCallTestPagePersonTooSoonMessage = getOnCallTestPagePersonTooSoonMessage;
15
+ exports.getOnCallTestPagePolicyTooSoonMessage = getOnCallTestPagePolicyTooSoonMessage;
16
+ exports.getOnCallTestPagePagingMessage = getOnCallTestPagePagingMessage;
17
+ exports.sortRulesAsAPageReachesThem = sortRulesAsAPageReachesThem;
18
+ exports.describeOnCallTestPageAnswerTime = describeOnCallTestPageAnswerTime;
19
+ exports.getOnCallTestPageAcknowledgedMessage = getOnCallTestPageAcknowledgedMessage;
20
+ exports.canAcknowledgeOnCallTestPageBy = canAcknowledgeOnCallTestPageBy;
21
+ exports.getOnCallTestPageFix = getOnCallTestPageFix;
22
+ exports.getOnCallTestPageDeliveryStatus = getOnCallTestPageDeliveryStatus;
23
+ exports.isOnCallTestPageResultFinal = isOnCallTestPageResultFinal;
24
+ exports.getOnCallTestPageWalkStart = getOnCallTestPageWalkStart;
25
+ exports.isOnCallTestPageWalkLevelReached = isOnCallTestPageWalkLevelReached;
26
+ exports.getOnCallTestPageCost = getOnCallTestPageCost;
27
+ const NotificationRuleType_1 = __importDefault(require("../NotificationRule/NotificationRuleType"));
28
+ const UserNotificationEventType_1 = __importDefault(require("../UserNotification/UserNotificationEventType"));
29
+ const UserNotificationStatus_1 = __importDefault(require("../UserNotification/UserNotificationStatus"));
30
+ const OnCallPageChannel_1 = require("./OnCallPageChannel");
31
+ /*
32
+ * A TEST PAGE: PROVE THAT A PAGE REACHES SOMEBODY, WITHOUT AN INCIDENT.
33
+ *
34
+ * People trust a pager after it has rung once. Until now the only way to
35
+ * find out whether OneUptime would reach somebody was a real incident: a
36
+ * fake outage declared on a monitor that is on a status page, which emails
37
+ * its subscribers, or a wait for the real thing.
38
+ *
39
+ * A test page runs the real path and touches nothing else. It is an on-call
40
+ * run like any other (OnCallDutyPolicyExecutionLog) - with a policy for
41
+ * "Test this policy", without one for "Send me a test page" and an admin's
42
+ * test page to a member - whose event type is UserNotificationEventType
43
+ * .TestPage, and it has no incident, alert or episode behind it. So:
44
+ *
45
+ * - WHAT IT REACHES IS WHAT A REAL PAGE REACHES. It stands in for a kind of
46
+ * record (an incident or an alert: OnCallTestPageRecordKind) and one of
47
+ * its severities, kept on the run, and each person is reached through
48
+ * their own On-Call Rules for exactly that kind and severity - the same
49
+ * rules, the same methods, the same order, the same user overrides,
50
+ * schedules and teams - without the waits: every rule for the severity
51
+ * runs at once, and a push does not repeat.
52
+ * - EVERY MESSAGE SAYS TEST in its first words, on every channel, in the
53
+ * person's language (OnCallTestPageWords), and that nothing is wrong.
54
+ * - NOTHING PUBLIC OR PERMANENT HAPPENS. With no record there is nothing for
55
+ * a status page, a subscriber, an SLO, uptime, a report, OneUptime AI, a
56
+ * workflow or a Slack or Microsoft Teams channel to read; a test run also
57
+ * starts none of the customer's workflows a run's create or update would,
58
+ * and is left out of the on-call counts (on-call reports count pages
59
+ * about records only).
60
+ * - ACKNOWLEDGING WORKS: from an email's, a text's or a chat message's
61
+ * link, or a call's 1. The run then says who
62
+ * acknowledged it, by what, and how long after their message went out
63
+ * ("Test page acknowledged by Ana Lopez by SMS after 14 seconds.").
64
+ * - IT ENDS ON ITS OWN: when somebody acknowledges it, or
65
+ * ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES after it started.
66
+ * - A POLICY'S TEST pages its first escalation level, unless it was asked
67
+ * to walk every level - each after ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN
68
+ * _MINUTES at most, and never repeating the policy.
69
+ * - IT IS LIMITED (ON_CALL_TEST_PAGE_*_LIMIT below) and follows the same
70
+ * plan, channel and balance rules as a real page: an SMS or a call on
71
+ * OneUptime Cloud is paid from the project's balance, and the Dashboard
72
+ * says so before it is sent.
73
+ *
74
+ * This file holds the rule, its timing and limits, the run's words and the
75
+ * shape of a test's result - the chain as it happened, which the Dashboard
76
+ * draws and the view of who would be told (#6810) reuses. Pure, with no
77
+ * server or browser APIs.
78
+ */
79
+ // The kind of record a test page stands in for.
80
+ var OnCallTestPageRecordKind;
81
+ (function (OnCallTestPageRecordKind) {
82
+ OnCallTestPageRecordKind["Incident"] = "Incident";
83
+ OnCallTestPageRecordKind["Alert"] = "Alert";
84
+ })(OnCallTestPageRecordKind || (exports.OnCallTestPageRecordKind = OnCallTestPageRecordKind = {}));
85
+ exports.ON_CALL_TEST_PAGE_RECORD_KINDS = [OnCallTestPageRecordKind.Incident, OnCallTestPageRecordKind.Alert];
86
+ function isOnCallTestPageRecordKind(value) {
87
+ return exports.ON_CALL_TEST_PAGE_RECORD_KINDS.includes(value);
88
+ }
89
+ /*
90
+ * The On-Call Rules a test page of this kind runs: a person's rules for
91
+ * incidents, or for alerts - the ones a real page of that kind runs.
92
+ */
93
+ function getOnCallTestPageRuleType(kind) {
94
+ return kind === OnCallTestPageRecordKind.Alert
95
+ ? NotificationRuleType_1.default.ON_CALL_EXECUTED_ALERT
96
+ : NotificationRuleType_1.default.ON_CALL_EXECUTED_INCIDENT;
97
+ }
98
+ // Whether a run (or one of its logs) is a test page.
99
+ function isOnCallTestPage(run) {
100
+ return Boolean(run && run.userNotificationEventType === UserNotificationEventType_1.default.TestPage);
101
+ }
102
+ /*
103
+ * HOW LONG A TEST WAITS TO BE ACKNOWLEDGED. Long enough to find a phone
104
+ * across the room and open an email; short enough that a test nobody
105
+ * answers is over while its sender still looks at its result.
106
+ */
107
+ exports.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES = 15;
108
+ /*
109
+ * The longest a policy's test waits between escalation levels when it
110
+ * walks them all. A level whose own wait is shorter keeps it.
111
+ */
112
+ exports.ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN_MINUTES = 2;
113
+ // Whether a test that started at `startedAt` has waited all it waits.
114
+ function hasOnCallTestPageAnswerWindowPassed(data) {
115
+ if (!data.startedAt) {
116
+ return true;
117
+ }
118
+ const startedAt = new Date(data.startedAt).getTime();
119
+ if (Number.isNaN(startedAt)) {
120
+ return true;
121
+ }
122
+ return (data.at.getTime() - startedAt >=
123
+ exports.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES * 60 * 1000);
124
+ }
125
+ // When a test that started at `startedAt` ends, unanswered.
126
+ function getOnCallTestPageEndsAt(startedAt) {
127
+ return new Date(startedAt.getTime() +
128
+ exports.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES * 60 * 1000);
129
+ }
130
+ /*
131
+ * A level's wait in a test that walks every level: its own, cut to
132
+ * ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN_MINUTES.
133
+ */
134
+ function getOnCallTestPageEscalationWaitInMinutes(levelWaitInMinutes) {
135
+ const wait = typeof levelWaitInMinutes === "number" && levelWaitInMinutes > 0
136
+ ? levelWaitInMinutes
137
+ : 0;
138
+ return Math.min(wait, exports.ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN_MINUTES);
139
+ }
140
+ /*
141
+ * HOW OFTEN A TEST CAN BE SENT. A test page rings real phones and spends
142
+ * real money on OneUptime Cloud, and anyone who may send one may send it
143
+ * again in a second:
144
+ *
145
+ * - one test page to a person every two minutes, whoever sends it, so a
146
+ * double click or an impatient admin does not ring a phone twice;
147
+ * - one test of a policy every five minutes;
148
+ * - twenty tests in a project an hour, all kinds together.
149
+ */
150
+ exports.ON_CALL_TEST_PAGE_PERSON_INTERVAL_IN_SECONDS = 120;
151
+ exports.ON_CALL_TEST_PAGE_POLICY_INTERVAL_IN_SECONDS = 300;
152
+ exports.ON_CALL_TEST_PAGES_PER_PROJECT_PER_HOUR = 20;
153
+ // "2 minutes", "45 seconds": how long to wait, in a refusal.
154
+ function describeOnCallTestPageWait(seconds) {
155
+ const whole = Math.max(1, Math.ceil(seconds));
156
+ if (whole >= 60) {
157
+ const minutes = Math.ceil(whole / 60);
158
+ return `${minutes} ${minutes === 1 ? "minute" : "minutes"}`;
159
+ }
160
+ return `${whole} ${whole === 1 ? "second" : "seconds"}`;
161
+ }
162
+ function getOnCallTestPagePersonTooSoonMessage(waitInSeconds) {
163
+ return `A test page was sent to this person a moment ago. Wait ${describeOnCallTestPageWait(waitInSeconds)}, then send another.`;
164
+ }
165
+ function getOnCallTestPagePolicyTooSoonMessage(waitInSeconds) {
166
+ return `This policy was tested a moment ago. Wait ${describeOnCallTestPageWait(waitInSeconds)}, then test it again.`;
167
+ }
168
+ exports.ON_CALL_TEST_PAGE_PROJECT_LIMIT_MESSAGE = `This project has sent ${exports.ON_CALL_TEST_PAGES_PER_PROJECT_PER_HOUR} test pages in the last hour, the most it may. Try again later.`;
169
+ /*
170
+ * Said when how often tests are sent cannot be read (the cache is down): a
171
+ * test is refused rather than sent unlimited.
172
+ */
173
+ exports.ON_CALL_TEST_PAGE_LIMIT_UNREADABLE_MESSAGE = "Test pages can't be sent right now, because OneUptime can't check how often they are sent. Try again in a minute.";
174
+ /*
175
+ * A test page is started only where who may send it and how often are
176
+ * checked (OnCallTestPageService): never by writing an execution log.
177
+ */
178
+ exports.ON_CALL_TEST_PAGE_STARTED_ELSEWHERE_MESSAGE = "A test page is sent with Send test page or Test this policy, which check who may send it and how often. It can't be created as an execution log.";
179
+ /*
180
+ * THE RUN'S WORDS - its status message, as every run's is written: in
181
+ * English, on the run, for its Execution Logs and its result.
182
+ */
183
+ function getOnCallTestPagePagingMessage(pagedCount) {
184
+ return pagedCount === 1
185
+ ? "Test page sent to 1 person. Waiting for them to acknowledge it."
186
+ : `Test page sent to ${pagedCount} people. Waiting for one of them to acknowledge it.`;
187
+ }
188
+ exports.ON_CALL_TEST_PAGE_NOBODY_PAGED_MESSAGE = "Test page reached nobody. Each person's line says why.";
189
+ exports.ON_CALL_TEST_PAGE_FIRST_LEVEL_PAGED_MESSAGE = "Test page sent to the first escalation level. Waiting for somebody to acknowledge it.";
190
+ exports.ON_CALL_TEST_PAGE_FIRST_LEVEL_REACHED_NOBODY_MESSAGE = "Test ended: the first escalation level reached nobody. Each person's line says why.";
191
+ exports.ON_CALL_TEST_PAGE_ENDED_UNANSWERED_MESSAGE = `Test ended: nobody acknowledged it within ${exports.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES} minutes.`;
192
+ exports.ON_CALL_TEST_PAGE_WENT_THROUGH_EVERY_LEVEL_MESSAGE = "Test ended: it went through every escalation level and nobody acknowledged it.";
193
+ /*
194
+ * A person's own log of a test page, once every one of their rules for its
195
+ * severity has run - at once, as a test runs them.
196
+ */
197
+ exports.ON_CALL_TEST_PAGE_RULES_RAN_MESSAGE = "Test page: every rule for this severity ran at once.";
198
+ // A test page's run that does not say which kind and severity it stands in for.
199
+ exports.ON_CALL_TEST_PAGE_RUN_UNREADABLE_MESSAGE = "This test page does not say which kind of page and severity it tests, so nothing was sent.";
200
+ /*
201
+ * A person's rules in the order a real page reaches them: the immediate
202
+ * ones first, then "after 5 minutes", then "after 10" - rules with the same
203
+ * wait in the order they were read. A test page runs them in this order,
204
+ * at once.
205
+ */
206
+ function sortRulesAsAPageReachesThem(rules) {
207
+ return rules
208
+ .map((rule, index) => {
209
+ return { rule: rule, index: index };
210
+ })
211
+ .sort((a, b) => {
212
+ return ((a.rule.notifyAfterMinutes || 0) - (b.rule.notifyAfterMinutes || 0) ||
213
+ a.index - b.index);
214
+ })
215
+ .map((entry) => {
216
+ return entry.rule;
217
+ });
218
+ }
219
+ // "after 14 seconds", "after 3 minutes": how long acknowledging took.
220
+ function describeOnCallTestPageAnswerTime(seconds) {
221
+ const whole = Math.max(0, Math.round(seconds));
222
+ if (whole < 120) {
223
+ return `${whole} ${whole === 1 ? "second" : "seconds"}`;
224
+ }
225
+ const minutes = Math.round(whole / 60);
226
+ return `${minutes} minutes`;
227
+ }
228
+ /*
229
+ * "Test page acknowledged by Ana Lopez (ana@example.com) by SMS after 14
230
+ * seconds." - the run's status message once somebody acknowledges it. The
231
+ * channel and the time are left out when they are not known: an answer
232
+ * from somewhere no message of the test records.
233
+ */
234
+ function getOnCallTestPageAcknowledgedMessage(data) {
235
+ const name = (data.userName || "").trim();
236
+ const email = (data.userEmail || "").trim();
237
+ let who = name || email || "a member";
238
+ if (name && email) {
239
+ who = `${name} (${email})`;
240
+ }
241
+ const by = data.channel
242
+ ? ` by ${(0, OnCallPageChannel_1.getOnCallPageChannelName)(data.channel)}`
243
+ : "";
244
+ const after = typeof data.afterSeconds === "number" && data.afterSeconds >= 0
245
+ ? ` after ${describeOnCallTestPageAnswerTime(data.afterSeconds)}`
246
+ : "";
247
+ return `Test page acknowledged by ${who}${by}${after}.`;
248
+ }
249
+ /*
250
+ * THE CHANNELS A TEST PAGE CAN BE ACKNOWLEDGED FROM: every one whose message
251
+ * carries a link or a call's 1. The others still prove the message arrives:
252
+ *
253
+ * - a push is answered in the mobile app by acknowledging the record it is
254
+ * about, and a test has none (a browser's push opens the link);
255
+ * - WhatsApp's words are a template Meta approved, with no link for a test;
256
+ * - a webhook and a custom channel get the documented test event, with
257
+ * nothing to act on, so a tool built for pages needs nothing new.
258
+ */
259
+ exports.ON_CALL_TEST_PAGE_ACKNOWLEDGEABLE_CHANNELS = [
260
+ OnCallPageChannel_1.OnCallPageChannel.Call,
261
+ OnCallPageChannel_1.OnCallPageChannel.SMS,
262
+ OnCallPageChannel_1.OnCallPageChannel.Telegram,
263
+ OnCallPageChannel_1.OnCallPageChannel.Email,
264
+ OnCallPageChannel_1.OnCallPageChannel.Slack,
265
+ OnCallPageChannel_1.OnCallPageChannel.MicrosoftTeams,
266
+ OnCallPageChannel_1.OnCallPageChannel.Mattermost,
267
+ ];
268
+ function canAcknowledgeOnCallTestPageBy(channel) {
269
+ return exports.ON_CALL_TEST_PAGE_ACKNOWLEDGEABLE_CHANNELS.includes(channel);
270
+ }
271
+ /*
272
+ * THE PAGE A TEST'S LINK OPENS (UserOnCallLogTimelineAPI), in English as
273
+ * every page a link opens is: what it is, and Acknowledge - or, once the
274
+ * person acknowledged it, that it works.
275
+ */
276
+ exports.ON_CALL_TEST_PAGE_ACKNOWLEDGE_TITLE = "Acknowledge test page";
277
+ exports.ON_CALL_TEST_PAGE_ACKNOWLEDGE_MESSAGE = "This is a test page. Nothing is wrong: acknowledge it to show that on-call pages reach you.";
278
+ exports.ON_CALL_TEST_PAGE_ANSWERED_TITLE = "Test page acknowledged";
279
+ exports.ON_CALL_TEST_PAGE_ANSWERED_MESSAGE = "You acknowledged this test page. It works: on-call pages reach you. You can close this page.";
280
+ // A message of a test page, once the person acknowledged the test from it.
281
+ exports.ON_CALL_TEST_PAGE_NOTIFICATION_ACKNOWLEDGED_MESSAGE = "Test page acknowledged.";
282
+ /*
283
+ * THE RESULT OF A TEST: THE CHAIN AS IT HAPPENED.
284
+ *
285
+ * Who was paged, through which level and why them - and each message that
286
+ * went to them: by what, to where, and what became of it, with the reason
287
+ * the log gives when it did not go out and where to fix that. The
288
+ * Dashboard draws it as the test runs (OnCallTestPageResult), and the view
289
+ * of who a monitor's failure would reach (#6810) draws its own chain with
290
+ * the same shape.
291
+ */
292
+ // Who a test was for.
293
+ var OnCallTestPageKind;
294
+ (function (OnCallTestPageKind) {
295
+ // "Send me a test page": the person who sent it.
296
+ OnCallTestPageKind["Self"] = "Self";
297
+ // An admin's test page to a member, from On-Call > Readiness.
298
+ OnCallTestPageKind["Member"] = "Member";
299
+ // "Test this policy": its escalation levels.
300
+ OnCallTestPageKind["Policy"] = "Policy";
301
+ })(OnCallTestPageKind || (exports.OnCallTestPageKind = OnCallTestPageKind = {}));
302
+ // Where a test stands.
303
+ var OnCallTestPageStatus;
304
+ (function (OnCallTestPageStatus) {
305
+ // Its messages are going out, or it waits for somebody to acknowledge it.
306
+ OnCallTestPageStatus["Paging"] = "Paging";
307
+ // Somebody acknowledged it.
308
+ OnCallTestPageStatus["Acknowledged"] = "Acknowledged";
309
+ // It ended with nobody acknowledging it.
310
+ OnCallTestPageStatus["Ended"] = "Ended";
311
+ // It could not run: the run says why.
312
+ OnCallTestPageStatus["Failed"] = "Failed";
313
+ })(OnCallTestPageStatus || (exports.OnCallTestPageStatus = OnCallTestPageStatus = {}));
314
+ // What became of one message of a test.
315
+ var OnCallTestPageDeliveryStatus;
316
+ (function (OnCallTestPageDeliveryStatus) {
317
+ // Handed to its sender; nothing has come back yet.
318
+ OnCallTestPageDeliveryStatus["Sending"] = "Sending";
319
+ // Its provider took it. An email's, a push's or a chat message's last word.
320
+ OnCallTestPageDeliveryStatus["Sent"] = "Sent";
321
+ // Its provider says it reached the phone: an SMS.
322
+ OnCallTestPageDeliveryStatus["Delivered"] = "Delivered";
323
+ // A call that rang out, or met a busy line.
324
+ OnCallTestPageDeliveryStatus["NotAnswered"] = "Not Answered";
325
+ // The person acknowledged the test from it.
326
+ OnCallTestPageDeliveryStatus["Acknowledged"] = "Acknowledged";
327
+ // It did not go out, or its provider gave up on it: the reason says why.
328
+ OnCallTestPageDeliveryStatus["Failed"] = "Failed";
329
+ })(OnCallTestPageDeliveryStatus || (exports.OnCallTestPageDeliveryStatus = OnCallTestPageDeliveryStatus = {}));
330
+ /*
331
+ * Where a message that did not go out can be put right - a page of the
332
+ * Dashboard, named, for the result to link.
333
+ */
334
+ var OnCallTestPageFix;
335
+ (function (OnCallTestPageFix) {
336
+ // A method that is not verified, a device that stopped receiving.
337
+ OnCallTestPageFix["NotificationMethods"] = "NotificationMethods";
338
+ // No rule for the severity, a rule that names a method of somebody else.
339
+ OnCallTestPageFix["OnCallRules"] = "OnCallRules";
340
+ // A channel switched off in the project.
341
+ OnCallTestPageFix["ProjectNotificationSettings"] = "ProjectNotificationSettings";
342
+ // The project's SMS and call balance.
343
+ OnCallTestPageFix["ProjectBalance"] = "ProjectBalance";
344
+ // The project's own Twilio account, or none.
345
+ OnCallTestPageFix["ProjectCallAndSms"] = "ProjectCallAndSms";
346
+ // The project's Slack, Microsoft Teams or Mattermost connection.
347
+ OnCallTestPageFix["ProjectWorkspaceConnections"] = "ProjectWorkspaceConnections";
348
+ })(OnCallTestPageFix || (exports.OnCallTestPageFix = OnCallTestPageFix = {}));
349
+ /*
350
+ * The words of a reason that say where it is fixed, most specific first.
351
+ * The reasons are the ones the senders write on a message's log
352
+ * (UserNotificationRuleService, the Notification service's senders).
353
+ */
354
+ const FIX_BY_REASON = [
355
+ {
356
+ words: ["balance"],
357
+ fix: OnCallTestPageFix.ProjectBalance,
358
+ },
359
+ {
360
+ words: ["is off in this project", "are off in this project"],
361
+ fix: OnCallTestPageFix.ProjectNotificationSettings,
362
+ },
363
+ {
364
+ words: ["twilio"],
365
+ fix: OnCallTestPageFix.ProjectCallAndSms,
366
+ },
367
+ {
368
+ words: [
369
+ "not connected to slack",
370
+ "not connected to microsoft teams",
371
+ "not connected to mattermost",
372
+ "workspace",
373
+ ],
374
+ fix: OnCallTestPageFix.ProjectWorkspaceConnections,
375
+ },
376
+ {
377
+ words: ["belongs to a different user", "no notification rule"],
378
+ fix: OnCallTestPageFix.OnCallRules,
379
+ },
380
+ {
381
+ words: [
382
+ "not verified",
383
+ "no longer receives",
384
+ "register it again",
385
+ "no verified notification method",
386
+ "open the app",
387
+ ],
388
+ fix: OnCallTestPageFix.NotificationMethods,
389
+ },
390
+ ];
391
+ // Where the reason a message did not go out says it is fixed, or null.
392
+ function getOnCallTestPageFix(reason) {
393
+ const text = (reason || "").toLowerCase();
394
+ if (!text) {
395
+ return null;
396
+ }
397
+ for (const entry of FIX_BY_REASON) {
398
+ if (entry.words.some((word) => {
399
+ return text.includes(word);
400
+ })) {
401
+ return entry.fix;
402
+ }
403
+ }
404
+ return null;
405
+ }
406
+ /*
407
+ * What became of a message, from its row of the person's on-call timeline
408
+ * (UserOnCallLogTimeline) and, for an SMS, whether its provider said it was
409
+ * delivered (its SmsLog).
410
+ */
411
+ function getOnCallTestPageDeliveryStatus(data) {
412
+ if (data.isAcknowledged ||
413
+ data.status === UserNotificationStatus_1.default.Acknowledged) {
414
+ return OnCallTestPageDeliveryStatus.Acknowledged;
415
+ }
416
+ switch (data.status) {
417
+ case UserNotificationStatus_1.default.Error:
418
+ case UserNotificationStatus_1.default.Skipped:
419
+ return OnCallTestPageDeliveryStatus.Failed;
420
+ case UserNotificationStatus_1.default.NotAnswered:
421
+ return OnCallTestPageDeliveryStatus.NotAnswered;
422
+ case UserNotificationStatus_1.default.Sent:
423
+ case UserNotificationStatus_1.default.PassedOn:
424
+ return data.isDelivered
425
+ ? OnCallTestPageDeliveryStatus.Delivered
426
+ : OnCallTestPageDeliveryStatus.Sent;
427
+ default:
428
+ return OnCallTestPageDeliveryStatus.Sending;
429
+ }
430
+ }
431
+ // What became of one person, or one target, of a test.
432
+ var OnCallTestPageStepStatus;
433
+ (function (OnCallTestPageStepStatus) {
434
+ OnCallTestPageStepStatus["Paged"] = "Paged";
435
+ OnCallTestPageStepStatus["Acknowledged"] = "Acknowledged";
436
+ // Not paged on purpose: away, not a member, opted out, nobody on call.
437
+ OnCallTestPageStepStatus["Skipped"] = "Skipped";
438
+ OnCallTestPageStepStatus["Failed"] = "Failed";
439
+ })(OnCallTestPageStepStatus || (exports.OnCallTestPageStepStatus = OnCallTestPageStepStatus = {}));
440
+ /*
441
+ * Whether a result is final: a test that was acknowledged, ended or failed
442
+ * changes no more, so whoever shows it stops asking.
443
+ */
444
+ function isOnCallTestPageResultFinal(result) {
445
+ return Boolean(result && result.status !== OnCallTestPageStatus.Paging);
446
+ }
447
+ /*
448
+ * WHAT A PREVIEW SAYS, AS CODES (#7015). Every warning, every target that
449
+ * reaches nobody and every "why them" comes with a code and the values it
450
+ * names, so the Dashboard words it in the reader's language. Each carries
451
+ * its English sentence too (`message`), and the preview keeps the English
452
+ * lists it always had (`warnings`, `notPaged`, `reachedThrough`): for other
453
+ * readers of the API, and for a Dashboard that does not know a code yet.
454
+ */
455
+ // Why a policy's test pages a person.
456
+ var OnCallTestPageReachedThroughCode;
457
+ (function (OnCallTestPageReachedThroughCode) {
458
+ // A member of a team the level names: "Team Platform".
459
+ OnCallTestPageReachedThroughCode["Team"] = "Team";
460
+ // On call in a schedule the level names: "Schedule Primary".
461
+ OnCallTestPageReachedThroughCode["Schedule"] = "Schedule";
462
+ // Next in the rotation of a schedule the level pages that way.
463
+ OnCallTestPageReachedThroughCode["ScheduleNextInRotation"] = "ScheduleNextInRotation";
464
+ // Covering for somebody the level names who is away: "Covering for Ana".
465
+ OnCallTestPageReachedThroughCode["CoveringFor"] = "CoveringFor";
466
+ })(OnCallTestPageReachedThroughCode || (exports.OnCallTestPageReachedThroughCode = OnCallTestPageReachedThroughCode = {}));
467
+ // What a preview warns about one person before anything is sent.
468
+ var OnCallTestPageWarningCode;
469
+ (function (OnCallTestPageWarningCode) {
470
+ // They opted out of pages of this severity: the test sends them nothing.
471
+ OnCallTestPageWarningCode["OptedOut"] = "OptedOut";
472
+ // No rule covers the severity, and the project does not fall back.
473
+ OnCallTestPageWarningCode["NoRuleNoFallback"] = "NoRuleNoFallback";
474
+ // No rule covers the severity: the test goes to every verified method.
475
+ OnCallTestPageWarningCode["NoRuleFallsBack"] = "NoRuleFallsBack";
476
+ // A channel a rule of theirs uses is switched off in the project.
477
+ OnCallTestPageWarningCode["ChannelOff"] = "ChannelOff";
478
+ // A method a rule of theirs uses is not verified (a custom channel: off).
479
+ OnCallTestPageWarningCode["MethodNotVerified"] = "MethodNotVerified";
480
+ })(OnCallTestPageWarningCode || (exports.OnCallTestPageWarningCode = OnCallTestPageWarningCode = {}));
481
+ // Why a target of a policy's level reaches nobody.
482
+ var OnCallTestPageNotPagedCode;
483
+ (function (OnCallTestPageNotPagedCode) {
484
+ // The policy has no escalation levels.
485
+ OnCallTestPageNotPagedCode["PolicyHasNoLevels"] = "PolicyHasNoLevels";
486
+ // The level names no team, person or schedule.
487
+ OnCallTestPageNotPagedCode["LevelNamesNobody"] = "LevelNamesNobody";
488
+ // A team it names has no members.
489
+ OnCallTestPageNotPagedCode["TeamHasNoMembers"] = "TeamHasNoMembers";
490
+ // A schedule it pages by rotation has nobody next.
491
+ OnCallTestPageNotPagedCode["NobodyNextInRotation"] = "NobodyNextInRotation";
492
+ // A schedule it names has nobody on call now.
493
+ OnCallTestPageNotPagedCode["NobodyOnCall"] = "NobodyOnCall";
494
+ // Somebody it names is away, and nobody covers for them.
495
+ OnCallTestPageNotPagedCode["AwayWithNobodyCovering"] = "AwayWithNobodyCovering";
496
+ // Somebody it names is not a member of the project.
497
+ OnCallTestPageNotPagedCode["NotProjectMember"] = "NotProjectMember";
498
+ })(OnCallTestPageNotPagedCode || (exports.OnCallTestPageNotPagedCode = OnCallTestPageNotPagedCode = {}));
499
+ /*
500
+ * WHEN A TEST THAT WALKS EVERY LEVEL PAGES THE NEXT ONE (#7016), nobody
501
+ * acknowledging it: the level before it started `previousStartsAfterMinutes`
502
+ * after the test was sent, and waits its own wait cut to a test's short one
503
+ * (getOnCallTestPageEscalationWaitInMinutes) - none when it pages nobody, as
504
+ * a run moves past such a level at once (OnCallEscalationAdvance). The worker
505
+ * moves a run on at its first tick once a wait is over, so a level starts
506
+ * then or a little later, never sooner.
507
+ */
508
+ function getOnCallTestPageWalkStart(data) {
509
+ return (data.previousStartsAfterMinutes +
510
+ (data.previousPagesAnybody
511
+ ? getOnCallTestPageEscalationWaitInMinutes(data.previousWaitInMinutes)
512
+ : 0));
513
+ }
514
+ /*
515
+ * Whether a level a walk would page `startsAfterMinutes` after the test was
516
+ * sent is paged at all: the test ends ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN
517
+ * _MINUTES after it started, before it moves on again.
518
+ */
519
+ function isOnCallTestPageWalkLevelReached(startsAfterMinutes) {
520
+ return startsAfterMinutes < exports.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES;
521
+ }
522
+ /*
523
+ * What a test costs, from what each person's methods are. A project's own
524
+ * Twilio account pays for its SMS and calls itself; WhatsApp and Telegram
525
+ * are always paid from the balance where billing is on.
526
+ */
527
+ function getOnCallTestPageCost(data) {
528
+ let smsCount = 0;
529
+ let callCount = 0;
530
+ let whatsAppCount = 0;
531
+ let telegramCount = 0;
532
+ for (const person of data.people) {
533
+ for (const method of person.methods) {
534
+ if (!method.isVerified) {
535
+ continue;
536
+ }
537
+ if (method.channel === OnCallPageChannel_1.OnCallPageChannel.SMS) {
538
+ smsCount++;
539
+ }
540
+ else if (method.channel === OnCallPageChannel_1.OnCallPageChannel.Call) {
541
+ callCount++;
542
+ }
543
+ else if (method.channel === OnCallPageChannel_1.OnCallPageChannel.WhatsApp) {
544
+ whatsAppCount++;
545
+ }
546
+ else if (method.channel === OnCallPageChannel_1.OnCallPageChannel.Telegram) {
547
+ telegramCount++;
548
+ }
549
+ }
550
+ }
551
+ const paidSms = data.isBillingEnabled && !data.hasOwnTwilioForSms ? smsCount : 0;
552
+ const paidCalls = data.isBillingEnabled && !data.hasOwnTwilioForCalls ? callCount : 0;
553
+ const paidWhatsApp = data.isBillingEnabled ? whatsAppCount : 0;
554
+ const paidTelegram = data.isBillingEnabled ? telegramCount : 0;
555
+ const isPaid = paidSms + paidCalls + paidWhatsApp + paidTelegram > 0;
556
+ const cost = {
557
+ isPaid: isPaid,
558
+ smsCount: smsCount,
559
+ callCount: callCount,
560
+ whatsAppCount: whatsAppCount,
561
+ telegramCount: telegramCount,
562
+ };
563
+ if (isPaid && data.prices) {
564
+ // A test call is a short one: a minute.
565
+ const estimate = paidSms * data.prices.smsInCents +
566
+ paidCalls * data.prices.callPerMinuteInCents +
567
+ paidWhatsApp * data.prices.whatsAppInCents +
568
+ paidTelegram * data.prices.telegramInCents;
569
+ if (estimate > 0) {
570
+ cost.estimatedCostInUSDCents = estimate;
571
+ }
572
+ }
573
+ return cost;
574
+ }
@@ -0,0 +1,52 @@
1
+ import commonJsModule from "./OnCallTestPage.js";
2
+ export const ON_CALL_TEST_PAGES_PER_PROJECT_PER_HOUR = commonJsModule.ON_CALL_TEST_PAGES_PER_PROJECT_PER_HOUR;
3
+ export const ON_CALL_TEST_PAGE_ACKNOWLEDGEABLE_CHANNELS = commonJsModule.ON_CALL_TEST_PAGE_ACKNOWLEDGEABLE_CHANNELS;
4
+ export const ON_CALL_TEST_PAGE_ACKNOWLEDGE_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_ACKNOWLEDGE_MESSAGE;
5
+ export const ON_CALL_TEST_PAGE_ACKNOWLEDGE_TITLE = commonJsModule.ON_CALL_TEST_PAGE_ACKNOWLEDGE_TITLE;
6
+ export const ON_CALL_TEST_PAGE_ANSWERED_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_ANSWERED_MESSAGE;
7
+ export const ON_CALL_TEST_PAGE_ANSWERED_TITLE = commonJsModule.ON_CALL_TEST_PAGE_ANSWERED_TITLE;
8
+ export const ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES = commonJsModule.ON_CALL_TEST_PAGE_ANSWER_WINDOW_IN_MINUTES;
9
+ export const ON_CALL_TEST_PAGE_ENDED_UNANSWERED_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_ENDED_UNANSWERED_MESSAGE;
10
+ export const ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN_MINUTES = commonJsModule.ON_CALL_TEST_PAGE_ESCALATION_WAIT_IN_MINUTES;
11
+ export const ON_CALL_TEST_PAGE_FIRST_LEVEL_PAGED_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_FIRST_LEVEL_PAGED_MESSAGE;
12
+ export const ON_CALL_TEST_PAGE_FIRST_LEVEL_REACHED_NOBODY_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_FIRST_LEVEL_REACHED_NOBODY_MESSAGE;
13
+ export const ON_CALL_TEST_PAGE_LIMIT_UNREADABLE_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_LIMIT_UNREADABLE_MESSAGE;
14
+ export const ON_CALL_TEST_PAGE_NOBODY_PAGED_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_NOBODY_PAGED_MESSAGE;
15
+ export const ON_CALL_TEST_PAGE_NOTIFICATION_ACKNOWLEDGED_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_NOTIFICATION_ACKNOWLEDGED_MESSAGE;
16
+ export const ON_CALL_TEST_PAGE_PERSON_INTERVAL_IN_SECONDS = commonJsModule.ON_CALL_TEST_PAGE_PERSON_INTERVAL_IN_SECONDS;
17
+ export const ON_CALL_TEST_PAGE_POLICY_INTERVAL_IN_SECONDS = commonJsModule.ON_CALL_TEST_PAGE_POLICY_INTERVAL_IN_SECONDS;
18
+ export const ON_CALL_TEST_PAGE_PROJECT_LIMIT_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_PROJECT_LIMIT_MESSAGE;
19
+ export const ON_CALL_TEST_PAGE_RECORD_KINDS = commonJsModule.ON_CALL_TEST_PAGE_RECORD_KINDS;
20
+ export const ON_CALL_TEST_PAGE_RULES_RAN_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_RULES_RAN_MESSAGE;
21
+ export const ON_CALL_TEST_PAGE_RUN_UNREADABLE_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_RUN_UNREADABLE_MESSAGE;
22
+ export const ON_CALL_TEST_PAGE_STARTED_ELSEWHERE_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_STARTED_ELSEWHERE_MESSAGE;
23
+ export const ON_CALL_TEST_PAGE_WENT_THROUGH_EVERY_LEVEL_MESSAGE = commonJsModule.ON_CALL_TEST_PAGE_WENT_THROUGH_EVERY_LEVEL_MESSAGE;
24
+ export const OnCallTestPageDeliveryStatus = commonJsModule.OnCallTestPageDeliveryStatus;
25
+ export const OnCallTestPageFix = commonJsModule.OnCallTestPageFix;
26
+ export const OnCallTestPageKind = commonJsModule.OnCallTestPageKind;
27
+ export const OnCallTestPageNotPagedCode = commonJsModule.OnCallTestPageNotPagedCode;
28
+ export const OnCallTestPageReachedThroughCode = commonJsModule.OnCallTestPageReachedThroughCode;
29
+ export const OnCallTestPageRecordKind = commonJsModule.OnCallTestPageRecordKind;
30
+ export const OnCallTestPageStatus = commonJsModule.OnCallTestPageStatus;
31
+ export const OnCallTestPageStepStatus = commonJsModule.OnCallTestPageStepStatus;
32
+ export const OnCallTestPageWarningCode = commonJsModule.OnCallTestPageWarningCode;
33
+ export const canAcknowledgeOnCallTestPageBy = commonJsModule.canAcknowledgeOnCallTestPageBy;
34
+ export const describeOnCallTestPageAnswerTime = commonJsModule.describeOnCallTestPageAnswerTime;
35
+ export const describeOnCallTestPageWait = commonJsModule.describeOnCallTestPageWait;
36
+ export const getOnCallTestPageAcknowledgedMessage = commonJsModule.getOnCallTestPageAcknowledgedMessage;
37
+ export const getOnCallTestPageCost = commonJsModule.getOnCallTestPageCost;
38
+ export const getOnCallTestPageDeliveryStatus = commonJsModule.getOnCallTestPageDeliveryStatus;
39
+ export const getOnCallTestPageEndsAt = commonJsModule.getOnCallTestPageEndsAt;
40
+ export const getOnCallTestPageEscalationWaitInMinutes = commonJsModule.getOnCallTestPageEscalationWaitInMinutes;
41
+ export const getOnCallTestPageFix = commonJsModule.getOnCallTestPageFix;
42
+ export const getOnCallTestPagePagingMessage = commonJsModule.getOnCallTestPagePagingMessage;
43
+ export const getOnCallTestPagePersonTooSoonMessage = commonJsModule.getOnCallTestPagePersonTooSoonMessage;
44
+ export const getOnCallTestPagePolicyTooSoonMessage = commonJsModule.getOnCallTestPagePolicyTooSoonMessage;
45
+ export const getOnCallTestPageRuleType = commonJsModule.getOnCallTestPageRuleType;
46
+ export const getOnCallTestPageWalkStart = commonJsModule.getOnCallTestPageWalkStart;
47
+ export const hasOnCallTestPageAnswerWindowPassed = commonJsModule.hasOnCallTestPageAnswerWindowPassed;
48
+ export const isOnCallTestPage = commonJsModule.isOnCallTestPage;
49
+ export const isOnCallTestPageRecordKind = commonJsModule.isOnCallTestPageRecordKind;
50
+ export const isOnCallTestPageResultFinal = commonJsModule.isOnCallTestPageResultFinal;
51
+ export const isOnCallTestPageWalkLevelReached = commonJsModule.isOnCallTestPageWalkLevelReached;
52
+ export const sortRulesAsAPageReachesThem = commonJsModule.sortRulesAsAPageReachesThem;
@@ -0,0 +1,31 @@
1
+ import { OnCallTestPageRecordKind } from "./OnCallTestPage.mjs";
2
+ import { Translator } from "../Translator.mjs";
3
+ export declare const getOnCallTestPageHeadline: (translator: Translator, productName: string) => string;
4
+ export declare const getOnCallTestPageWhatItTests: (translator: Translator, data: {
5
+ recordKind: OnCallTestPageRecordKind;
6
+ projectName: string;
7
+ severityName: string;
8
+ }) => string;
9
+ export declare const getOnCallTestPageAskToAcknowledge: (translator: Translator) => string;
10
+ export declare const getOnCallTestPageAcknowledgeLabel: (translator: Translator) => string;
11
+ export declare const getOnCallTestPageSentBy: (translator: Translator, data: {
12
+ isSentBySelf: boolean;
13
+ senderName: string;
14
+ policyName?: string | undefined;
15
+ }) => string;
16
+ export declare const getOnCallTestPageSmsText: (translator: Translator, data: {
17
+ productName: string;
18
+ projectName: string;
19
+ link: string;
20
+ }) => string;
21
+ export declare const getOnCallTestPageEmailSubject: (translator: Translator, projectName: string) => string;
22
+ export declare const ON_CALL_TEST_PAGE_CALL_GREETING: string;
23
+ export declare const getOnCallTestPageCallWhatItTests: (data: {
24
+ recordKind: OnCallTestPageRecordKind;
25
+ projectName: string;
26
+ severityName: string;
27
+ }) => string;
28
+ export declare const ON_CALL_TEST_PAGE_CALL_PROMPT: string;
29
+ export declare const ON_CALL_TEST_PAGE_CALL_ACKNOWLEDGED: string;
30
+ export declare const ON_CALL_TEST_PAGE_CALL_NO_INPUT: string;
31
+ export declare const ON_CALL_TEST_PAGE_CALL_INVALID_INPUT: string;