@oneuptime/common 14.0.109 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (578) hide show
  1. package/Models/AnalyticsModels/SecurityEvent.js +1 -1
  2. package/Models/DatabaseModels/AIInsight.js +2 -2
  3. package/Models/DatabaseModels/AIRunRecording.d.mts +12 -0
  4. package/Models/DatabaseModels/AIRunRecording.d.ts +12 -0
  5. package/Models/DatabaseModels/AIRunRecording.js +181 -0
  6. package/Models/DatabaseModels/AIRunRecording.mjs +2 -0
  7. package/Models/DatabaseModels/Alert.js +20 -4
  8. package/Models/DatabaseModels/AlertEpisode.js +2 -2
  9. package/Models/DatabaseModels/AlertEpisodeOnCallRule.js +3 -3
  10. package/Models/DatabaseModels/AlertGroupingRule.d.mts +1 -0
  11. package/Models/DatabaseModels/AlertGroupingRule.d.ts +1 -0
  12. package/Models/DatabaseModels/AlertGroupingRule.js +48 -2
  13. package/Models/DatabaseModels/AlertOnCallRule.js +3 -3
  14. package/Models/DatabaseModels/AlertSeverity.js +13 -4
  15. package/Models/DatabaseModels/AlertState.js +1 -1
  16. package/Models/DatabaseModels/CallLog.js +12 -12
  17. package/Models/DatabaseModels/DataStore.js +9 -0
  18. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.d.mts +2 -0
  19. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.d.ts +2 -0
  20. package/Models/DatabaseModels/EmailLog.js +14 -14
  21. package/Models/DatabaseModels/Form.js +3 -3
  22. package/Models/DatabaseModels/FormSubmission.js +6 -6
  23. package/Models/DatabaseModels/GlobalConfig.d.mts +1 -0
  24. package/Models/DatabaseModels/GlobalConfig.d.ts +1 -0
  25. package/Models/DatabaseModels/GlobalConfig.js +74 -45
  26. package/Models/DatabaseModels/Incident.js +20 -4
  27. package/Models/DatabaseModels/IncidentEpisode.js +2 -2
  28. package/Models/DatabaseModels/IncidentEpisodeOnCallRule.js +3 -3
  29. package/Models/DatabaseModels/IncidentGroupingRule.d.mts +1 -0
  30. package/Models/DatabaseModels/IncidentGroupingRule.d.ts +1 -0
  31. package/Models/DatabaseModels/IncidentGroupingRule.js +48 -2
  32. package/Models/DatabaseModels/IncidentOnCallRule.js +3 -3
  33. package/Models/DatabaseModels/IncidentSeverity.js +13 -4
  34. package/Models/DatabaseModels/IncidentSlaRule.js +2 -2
  35. package/Models/DatabaseModels/IncidentState.js +1 -1
  36. package/Models/DatabaseModels/IncidentTemplate.js +2 -2
  37. package/Models/DatabaseModels/Index.js +4 -0
  38. package/Models/DatabaseModels/InventoryItem.js +11 -0
  39. package/Models/DatabaseModels/Monitor.js +54 -20
  40. package/Models/DatabaseModels/MonitorNetworkDevice.d.mts +11 -0
  41. package/Models/DatabaseModels/MonitorNetworkDevice.d.ts +11 -0
  42. package/Models/DatabaseModels/MonitorNetworkDevice.js +189 -0
  43. package/Models/DatabaseModels/MonitorNetworkDevice.mjs +2 -0
  44. package/Models/DatabaseModels/MonitorProbe.js +22 -5
  45. package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
  46. package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
  47. package/Models/DatabaseModels/NetworkDevice.js +64 -7
  48. package/Models/DatabaseModels/NetworkEndpoint.d.mts +1 -0
  49. package/Models/DatabaseModels/NetworkEndpoint.d.ts +1 -0
  50. package/Models/DatabaseModels/NetworkEndpoint.js +39 -7
  51. package/Models/DatabaseModels/NetworkInterface.js +5 -5
  52. package/Models/DatabaseModels/OnCallDutyPolicy.js +4 -2
  53. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRule.js +1 -1
  54. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleSchedule.js +8 -5
  55. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleTeam.js +5 -2
  56. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleUser.js +5 -2
  57. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +28 -11
  58. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +10 -7
  59. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.mts +1 -0
  60. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.ts +1 -0
  61. package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +16 -11
  62. package/Models/DatabaseModels/OnCallDutyPolicyOwnerTeam.js +7 -4
  63. package/Models/DatabaseModels/OnCallDutyPolicyOwnerUser.js +7 -4
  64. package/Models/DatabaseModels/OnCallDutyPolicySchedule.js +6 -3
  65. package/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js +4 -4
  66. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js +3 -3
  67. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js +6 -6
  68. package/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js +9 -6
  69. package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +35 -7
  70. package/Models/DatabaseModels/OpenStackCloudCheck.js +8 -1
  71. package/Models/DatabaseModels/Project.d.mts +3 -0
  72. package/Models/DatabaseModels/Project.d.ts +3 -0
  73. package/Models/DatabaseModels/Project.js +142 -5
  74. package/Models/DatabaseModels/ProjectCallSMSConfig.js +3 -1
  75. package/Models/DatabaseModels/ProjectSmtpConfig.js +2 -0
  76. package/Models/DatabaseModels/ProxmoxCluster.d.mts +1 -0
  77. package/Models/DatabaseModels/ProxmoxCluster.d.ts +1 -0
  78. package/Models/DatabaseModels/ProxmoxCluster.js +52 -3
  79. package/Models/DatabaseModels/PublicNoteApprovalRequest.js +3 -3
  80. package/Models/DatabaseModels/PublicNoteApprovalStep.js +1 -1
  81. package/Models/DatabaseModels/PushNotificationLog.js +12 -12
  82. package/Models/DatabaseModels/Reseller.js +8 -2
  83. package/Models/DatabaseModels/ResellerPlan.js +8 -2
  84. package/Models/DatabaseModels/RunbookExecution.js +2 -2
  85. package/Models/DatabaseModels/RunbookRule.js +6 -6
  86. package/Models/DatabaseModels/ScheduledMaintenance.js +9 -6
  87. package/Models/DatabaseModels/ScheduledMaintenanceCalendarFeed.js +1 -1
  88. package/Models/DatabaseModels/ScheduledMaintenanceInternalNote.js +7 -4
  89. package/Models/DatabaseModels/ScheduledMaintenanceLabelRule.js +1 -1
  90. package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +7 -7
  91. package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +3 -3
  92. package/Models/DatabaseModels/ScheduledMaintenanceOwnerRule.js +6 -6
  93. package/Models/DatabaseModels/ScheduledMaintenanceOwnerTeam.js +4 -4
  94. package/Models/DatabaseModels/ScheduledMaintenanceOwnerUser.js +4 -4
  95. package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +10 -7
  96. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +4 -4
  97. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +4 -4
  98. package/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +5 -5
  99. package/Models/DatabaseModels/Service.js +1 -1
  100. package/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js +4 -4
  101. package/Models/DatabaseModels/ServiceLevelObjectiveErrorBudgetPolicyTier.js +4 -4
  102. package/Models/DatabaseModels/SmsLog.js +12 -12
  103. package/Models/DatabaseModels/StatusPage.js +5 -5
  104. package/Models/DatabaseModels/StatusPageSubscriber.js +2 -2
  105. package/Models/DatabaseModels/TeamMember.js +10 -1
  106. package/Models/DatabaseModels/TelegramLog.js +12 -12
  107. package/Models/DatabaseModels/TelemetryIngestionKey.js +8 -5
  108. package/Models/DatabaseModels/TelemetryIngestionKeyRefusal.js +7 -4
  109. package/Models/DatabaseModels/User.d.mts +4 -0
  110. package/Models/DatabaseModels/User.d.ts +4 -0
  111. package/Models/DatabaseModels/User.js +100 -0
  112. package/Models/DatabaseModels/UserOnCallLog.js +6 -6
  113. package/Models/DatabaseModels/UserOnCallLogTimeline.js +3 -3
  114. package/Models/DatabaseModels/UserOnCallShiftReminderLog.js +2 -2
  115. package/Models/DatabaseModels/WebhookLog.js +12 -12
  116. package/Models/DatabaseModels/WhatsAppLog.js +12 -12
  117. package/Models/DatabaseModels/WorkspaceNotificationLog.js +12 -12
  118. package/Models/DatabaseModels/WorkspaceNotificationRule.js +36 -1
  119. package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
  120. package/Models/DatabaseModels/WorkspacePublicNoteApprovalMessage.js +3 -3
  121. package/Server/Services/DatabaseService.d.mts +4 -1
  122. package/Server/Services/DatabaseService.d.ts +4 -1
  123. package/Server/Types/Database/CountBy.d.mts +1 -0
  124. package/Server/Types/Database/CountBy.d.ts +1 -0
  125. package/Server/Types/Database/UpdateLimit.d.mts +6 -0
  126. package/Server/Types/Database/UpdateLimit.d.ts +6 -0
  127. package/Types/AI/AIActionWords.d.mts +25 -1
  128. package/Types/AI/AIActionWords.d.ts +25 -1
  129. package/Types/AI/AIActionWords.js +166 -3
  130. package/Types/AI/AIActionWords.mjs +6 -0
  131. package/Types/AI/AIChatTypes.d.mts +4 -2
  132. package/Types/AI/AIChatTypes.d.ts +4 -2
  133. package/Types/AI/AIChatTypes.js +5 -0
  134. package/Types/AI/AiOutcomes.d.mts +57 -0
  135. package/Types/AI/AiOutcomes.d.ts +57 -0
  136. package/Types/AI/AiOutcomes.js +67 -0
  137. package/Types/AI/AiOutcomes.mjs +10 -0
  138. package/Types/AI/AiRunRefusal.d.mts +45 -0
  139. package/Types/AI/AiRunRefusal.d.ts +45 -0
  140. package/Types/AI/AiRunRefusal.js +187 -0
  141. package/Types/AI/AiRunRefusal.mjs +12 -0
  142. package/Types/AI/InvestigationRecording.d.mts +46 -0
  143. package/Types/AI/InvestigationRecording.d.ts +46 -0
  144. package/Types/AI/InvestigationRecording.js +42 -0
  145. package/Types/AI/InvestigationRecording.mjs +7 -0
  146. package/Types/API/HTTPResponse.d.mts +3 -0
  147. package/Types/API/HTTPResponse.d.ts +3 -0
  148. package/Types/API/HTTPResponse.js +15 -0
  149. package/Types/Analytics/ProductEvent.d.mts +6 -1
  150. package/Types/Analytics/ProductEvent.d.ts +6 -1
  151. package/Types/Analytics/ProductEvent.js +41 -0
  152. package/Types/AuditLog/AuditLogCoverage.d.mts +1 -0
  153. package/Types/AuditLog/AuditLogCoverage.d.ts +1 -0
  154. package/Types/AuditLog/AuditLogCoverage.js +4 -2
  155. package/Types/BaseDatabase/AggregateBy.d.mts +16 -0
  156. package/Types/BaseDatabase/AggregateBy.d.ts +16 -0
  157. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -1
  158. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -1
  159. package/Types/BaseDatabase/AggregationIntervalUtil.js +92 -2
  160. package/Types/BaseDatabase/ListResult.d.mts +1 -0
  161. package/Types/BaseDatabase/ListResult.d.ts +1 -0
  162. package/Types/CallAndSMS/ServerTwilioEnvironment.d.mts +47 -0
  163. package/Types/CallAndSMS/ServerTwilioEnvironment.d.ts +47 -0
  164. package/Types/CallAndSMS/ServerTwilioEnvironment.js +282 -0
  165. package/Types/CallAndSMS/ServerTwilioEnvironment.mjs +7 -0
  166. package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
  167. package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
  168. package/Types/Cloud/CloudResourceCatalog.js +33 -3
  169. package/Types/Cloud/CloudResourceCatalog.mjs +1 -0
  170. package/Types/Dashboard/DashboardAutoRefresh.d.mts +1 -0
  171. package/Types/Dashboard/DashboardAutoRefresh.d.ts +1 -0
  172. package/Types/Dashboard/DashboardAutoRefresh.js +21 -0
  173. package/Types/Dashboard/DashboardAutoRefresh.mjs +1 -0
  174. package/Types/DataObservability/DataCheckSuggestions.d.mts +25 -0
  175. package/Types/DataObservability/DataCheckSuggestions.d.ts +25 -0
  176. package/Types/DataObservability/DataCheckSuggestions.js +102 -65
  177. package/Types/DataObservability/DataCheckSuggestions.mjs +1 -0
  178. package/Types/Database/TableMetadata.d.mts +2 -0
  179. package/Types/Database/TableMetadata.d.ts +2 -0
  180. package/Types/Database/TableMetadata.js +6 -0
  181. package/Types/Date.d.mts +26 -2
  182. package/Types/Date.d.ts +26 -2
  183. package/Types/Date.js +81 -9
  184. package/Types/Date.mjs +1 -0
  185. package/Types/DateLanguage.d.mts +2 -0
  186. package/Types/DateLanguage.d.ts +2 -0
  187. package/Types/DateLanguage.js +44 -2
  188. package/Types/DateLanguage.mjs +2 -0
  189. package/Types/DirectionArrow.d.mts +7 -0
  190. package/Types/DirectionArrow.d.ts +7 -0
  191. package/Types/DirectionArrow.js +88 -0
  192. package/Types/DirectionArrow.mjs +7 -0
  193. package/Types/Docs/GlossaryTerm.d.mts +1 -0
  194. package/Types/Docs/GlossaryTerm.d.ts +1 -0
  195. package/Types/Docs/GlossaryTerm.js +2 -0
  196. package/Types/Docs/RetiredNames.d.mts +11 -0
  197. package/Types/Docs/RetiredNames.d.ts +11 -0
  198. package/Types/Docs/RetiredNames.js +139 -0
  199. package/Types/Docs/RetiredNames.mjs +3 -0
  200. package/Types/Email/ServerEmailEnvironment.d.mts +85 -0
  201. package/Types/Email/ServerEmailEnvironment.d.ts +85 -0
  202. package/Types/Email/ServerEmailEnvironment.js +793 -0
  203. package/Types/Email/ServerEmailEnvironment.mjs +14 -0
  204. package/Types/Exception/AiRunRefusalException.d.mts +6 -0
  205. package/Types/Exception/AiRunRefusalException.d.ts +6 -0
  206. package/Types/Exception/AiRunRefusalException.js +23 -0
  207. package/Types/Exception/AiRunRefusalException.mjs +2 -0
  208. package/Types/Exception/RefusalWithValues.d.mts +7 -0
  209. package/Types/Exception/RefusalWithValues.d.ts +7 -0
  210. package/Types/Exception/RefusalWithValues.js +76 -0
  211. package/Types/Exception/RefusalWithValues.mjs +3 -0
  212. package/Types/Exception/UnexplainedError.d.mts +13 -0
  213. package/Types/Exception/UnexplainedError.d.ts +13 -0
  214. package/Types/Exception/UnexplainedError.js +53 -1
  215. package/Types/Exception/UnexplainedError.mjs +1 -0
  216. package/Types/File/FileSize.d.mts +4 -1
  217. package/Types/File/FileSize.d.ts +4 -1
  218. package/Types/File/FileSize.js +18 -17
  219. package/Types/Form/FormTargetCatalog.js +2 -2
  220. package/Types/Form/FormTargetType.js +2 -2
  221. package/Types/HostCollector/HostCollector.d.mts +1 -0
  222. package/Types/HostCollector/HostCollector.d.ts +1 -0
  223. package/Types/HostCollector/HostCollector.js +26 -10
  224. package/Types/HostCollector/HostCollector.mjs +1 -0
  225. package/Types/ListData.d.mts +2 -0
  226. package/Types/ListData.d.ts +2 -0
  227. package/Types/ListData.js +4 -0
  228. package/Types/Monitor/MonitorCriteria.js +2 -2
  229. package/Types/Monitor/MonitorCriteriaInstance.js +9 -0
  230. package/Types/Monitor/MonitorNotCheckedReason.d.mts +7 -0
  231. package/Types/Monitor/MonitorNotCheckedReason.d.ts +7 -0
  232. package/Types/Monitor/MonitorNotCheckedReason.js +36 -0
  233. package/Types/Monitor/MonitorNotCheckedReason.mjs +4 -0
  234. package/Types/Monitor/MonitorStep.js +1 -1
  235. package/Types/Monitor/MonitorTemplateSyncField.d.mts +6 -0
  236. package/Types/Monitor/MonitorTemplateSyncField.d.ts +6 -0
  237. package/Types/Monitor/MonitorTemplateSyncField.js +106 -64
  238. package/Types/Monitor/NtpMonitor/NtpMonitorUtil.d.mts +1 -0
  239. package/Types/Monitor/NtpMonitor/NtpMonitorUtil.d.ts +1 -0
  240. package/Types/Monitor/NtpMonitor/NtpMonitorUtil.js +11 -3
  241. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +6 -0
  242. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +6 -0
  243. package/Types/Monitor/UptimeHistoryLabels.js +2 -2
  244. package/Types/Monitor/WhoIsTold.d.mts +3 -1
  245. package/Types/Monitor/WhoIsTold.d.ts +3 -1
  246. package/Types/Monitor/WhoIsTold.js +2 -1
  247. package/Types/NotificationRule/PagingLadder.d.mts +137 -0
  248. package/Types/NotificationRule/PagingLadder.d.ts +137 -0
  249. package/Types/NotificationRule/PagingLadder.js +682 -0
  250. package/Types/NotificationRule/PagingLadder.mjs +28 -0
  251. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +1 -1
  252. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.mts +1 -0
  253. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.ts +1 -0
  254. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.js +12 -9
  255. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.mjs +1 -0
  256. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +3 -1
  257. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +3 -1
  258. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +24 -6
  259. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +1 -0
  260. package/Types/OnCallDutyPolicy/OnCallPageLine.d.mts +26 -0
  261. package/Types/OnCallDutyPolicy/OnCallPageLine.d.ts +26 -0
  262. package/Types/OnCallDutyPolicy/OnCallPageLine.js +136 -0
  263. package/Types/OnCallDutyPolicy/OnCallPageLine.mjs +18 -0
  264. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.mts +1 -0
  265. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.ts +1 -0
  266. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.mts +12 -0
  267. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.ts +12 -0
  268. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.js +38 -0
  269. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.mjs +3 -0
  270. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +44 -0
  271. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +44 -0
  272. package/Types/OnCallDutyPolicy/OnCallTestPage.js +96 -5
  273. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  274. package/Types/OnCallDutyPolicy/OnCallTestPageLine.d.mts +19 -0
  275. package/Types/OnCallDutyPolicy/OnCallTestPageLine.d.ts +19 -0
  276. package/Types/OnCallDutyPolicy/OnCallTestPageLine.js +222 -0
  277. package/Types/OnCallDutyPolicy/OnCallTestPageLine.mjs +6 -0
  278. package/Types/OnCallDutyPolicy/ScheduleLayerDefaults.js +5 -2
  279. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +92 -0
  280. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +92 -0
  281. package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +512 -0
  282. package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +7 -0
  283. package/Types/OnCallDutyPolicy/UserOverrideCoverRequest.js +9 -1
  284. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +23 -0
  285. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +23 -0
  286. package/Types/OnCallDutyPolicy/UserOverrideEdit.js +105 -0
  287. package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +6 -0
  288. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +64 -0
  289. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +64 -0
  290. package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +237 -0
  291. package/Types/OnCallDutyPolicy/UserOverrideOverlap.mjs +14 -0
  292. package/Types/Permission.d.mts +2 -2
  293. package/Types/Permission.d.ts +2 -2
  294. package/Types/Permission.js +196 -195
  295. package/Types/Probe/ProbeCapability.d.mts +2 -1
  296. package/Types/Probe/ProbeCapability.d.ts +2 -1
  297. package/Types/Probe/ProbeCapability.js +10 -0
  298. package/Types/Product/ProductCatalog.d.mts +10 -0
  299. package/Types/Product/ProductCatalog.d.ts +10 -0
  300. package/Types/Product/ProductCatalog.js +208 -0
  301. package/Types/Product/ProductCatalog.mjs +6 -0
  302. package/Types/Product/ProductOfTable.d.mts +3 -0
  303. package/Types/Product/ProductOfTable.d.ts +3 -0
  304. package/Types/Product/ProductOfTable.js +68 -0
  305. package/Types/Product/ProductOfTable.mjs +3 -0
  306. package/Types/Product/ProjectProductsAnswer.d.mts +3 -0
  307. package/Types/Product/ProjectProductsAnswer.d.ts +3 -0
  308. package/Types/Product/ProjectProductsAnswer.js +35 -2
  309. package/Types/Product/ProjectProductsAnswer.mjs +1 -0
  310. package/Types/Product/ServerProducts.d.mts +65 -0
  311. package/Types/Product/ServerProducts.d.ts +65 -0
  312. package/Types/Product/ServerProducts.js +383 -0
  313. package/Types/Product/ServerProducts.mjs +26 -0
  314. package/Types/Product/ServerProductsAnswer.d.mts +21 -0
  315. package/Types/Product/ServerProductsAnswer.d.ts +21 -0
  316. package/Types/Product/ServerProductsAnswer.js +78 -0
  317. package/Types/Product/ServerProductsAnswer.mjs +5 -0
  318. package/Types/ProductFeedback/ProductFeedback.d.mts +3 -1
  319. package/Types/ProductFeedback/ProductFeedback.d.ts +3 -1
  320. package/Types/ProductFeedback/ProductFeedback.js +8 -0
  321. package/Types/ReaderLanguage.d.mts +1 -0
  322. package/Types/ReaderLanguage.d.ts +1 -0
  323. package/Types/ReaderLanguage.js +13 -1
  324. package/Types/ReaderLanguage.mjs +1 -0
  325. package/Types/Rules/RuleRun.js +2 -2
  326. package/Types/Rum/SessionReplayCustomEvents.d.mts +1 -0
  327. package/Types/Rum/SessionReplayCustomEvents.d.ts +1 -0
  328. package/Types/SampleProject/SampleProject.d.mts +54 -0
  329. package/Types/SampleProject/SampleProject.d.ts +54 -0
  330. package/Types/SampleProject/SampleProject.js +177 -0
  331. package/Types/SampleProject/SampleProject.mjs +22 -0
  332. package/Types/SampleProject/SampleProjectContent.d.mts +127 -0
  333. package/Types/SampleProject/SampleProjectContent.d.ts +127 -0
  334. package/Types/SampleProject/SampleProjectContent.js +397 -0
  335. package/Types/SampleProject/SampleProjectContent.mjs +18 -0
  336. package/Types/ScheduledMaintenance/MaintenanceCalendar.js +1 -1
  337. package/Types/ServerSending/ServerSendingStatus.d.mts +7 -0
  338. package/Types/ServerSending/ServerSendingStatus.d.ts +7 -0
  339. package/Types/ServerSending/ServerSendingStatus.js +49 -2
  340. package/Types/ServerSetup/ServerSetupChecklist.js +3 -3
  341. package/Types/StateTimeline/RowsKeptOnDelete.js +1 -1
  342. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.mts +8 -0
  343. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.ts +8 -0
  344. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +50 -0
  345. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.mjs +3 -0
  346. package/Types/StatusPage/PublicNoteSubscriberNotificationDefault.js +1 -1
  347. package/Types/Telemetry/CompatibleIngest.d.mts +20 -0
  348. package/Types/Telemetry/CompatibleIngest.d.ts +20 -0
  349. package/Types/Telemetry/CompatibleIngest.js +123 -0
  350. package/Types/Telemetry/CompatibleIngest.mjs +21 -0
  351. package/Types/Telemetry/TelemetryIngestSurface.d.mts +5 -0
  352. package/Types/Telemetry/TelemetryIngestSurface.d.ts +5 -0
  353. package/Types/Telemetry/TelemetryIngestSurface.js +54 -12
  354. package/Types/TimezoneAlias.d.mts +1 -0
  355. package/Types/TimezoneAlias.d.ts +1 -0
  356. package/Types/TimezoneAlias.js +13 -0
  357. package/Types/Translator.d.mts +1 -0
  358. package/Types/Translator.d.ts +1 -0
  359. package/Types/Translator.js +414 -50
  360. package/Types/Translator.mjs +1 -0
  361. package/Types/UsedBy/UsedBy.d.mts +103 -0
  362. package/Types/UsedBy/UsedBy.d.ts +103 -0
  363. package/Types/UsedBy/UsedBy.js +389 -0
  364. package/Types/UsedBy/UsedBy.mjs +20 -0
  365. package/Types/UsedBy/UsedByServerProducts.d.mts +4 -0
  366. package/Types/UsedBy/UsedByServerProducts.d.ts +4 -0
  367. package/Types/UsedBy/UsedByServerProducts.js +48 -0
  368. package/Types/UsedBy/UsedByServerProducts.mjs +3 -0
  369. package/Types/WelcomeChecklist/WelcomeChecklist.d.mts +6 -0
  370. package/Types/WelcomeChecklist/WelcomeChecklist.d.ts +6 -0
  371. package/Types/WelcomeChecklist/WelcomeChecklist.js +54 -2
  372. package/Types/WelcomeChecklist/WelcomeChecklist.mjs +4 -0
  373. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.mts +1 -0
  374. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.ts +1 -0
  375. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.js +3 -0
  376. package/Types/Workflow/PassedOnFields.js +2 -1
  377. package/Types/Workflow/RunRecord.js +1 -1
  378. package/Types/Workflow/Templates.js +3 -3
  379. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +2 -0
  380. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +2 -0
  381. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +28 -1
  382. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +28 -1
  383. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +84 -0
  384. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +84 -0
  385. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +456 -0
  386. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.mjs +5 -0
  387. package/Utils/AI/MeaningMatch.d.mts +36 -0
  388. package/Utils/AI/MeaningMatch.d.ts +36 -0
  389. package/Utils/AI/MeaningMatch.js +535 -0
  390. package/Utils/AI/MeaningMatch.mjs +7 -0
  391. package/Utils/ArchivableValues.js +1 -1
  392. package/Utils/AuditLog/AuditLogValues.js +2 -2
  393. package/Utils/Dashboard/ClockWidgetFormat.d.mts +14 -2
  394. package/Utils/Dashboard/ClockWidgetFormat.d.ts +14 -2
  395. package/Utils/Dashboard/ClockWidgetFormat.js +105 -2
  396. package/Utils/Dashboard/DashboardViewConfigSignature.d.mts +3 -0
  397. package/Utils/Dashboard/DashboardViewConfigSignature.d.ts +3 -0
  398. package/Utils/Dashboard/DashboardViewConfigSignature.js +45 -0
  399. package/Utils/Dashboard/DashboardViewConfigSignature.mjs +3 -0
  400. package/Utils/Dashboard/ValueWidgetSeries.d.mts +2 -0
  401. package/Utils/Dashboard/ValueWidgetSeries.d.ts +2 -0
  402. package/Utils/Dashboard/ValueWidgetSeries.js +75 -0
  403. package/Utils/DataSecurity/TextScanner.js +2 -2
  404. package/Utils/DeveloperDocs/AiAssistantExamples.js +4 -4
  405. package/Utils/DeveloperDocs/CliCommands.d.mts +1 -0
  406. package/Utils/DeveloperDocs/CliCommands.d.ts +1 -0
  407. package/Utils/DeveloperDocs/CliCommands.js +2 -1
  408. package/Utils/DeveloperDocs/CliResources.js +2 -1
  409. package/Utils/DeveloperDocs/ExampleBuilder.js +1 -1
  410. package/Utils/DeveloperDocs/ResourceProfiles.js +2 -2
  411. package/Utils/DeveloperDocs/TerraformSchema.js +3 -1
  412. package/Utils/GuidedSetup/StatusPageRecords.d.mts +5 -0
  413. package/Utils/GuidedSetup/StatusPageRecords.d.ts +5 -0
  414. package/Utils/GuidedSetup/StatusPageRecords.js +27 -2
  415. package/Utils/GuidedSetup/StatusPageRecords.mjs +1 -0
  416. package/Utils/GuidedSetup/WebsiteMonitorRecords.js +6 -0
  417. package/Utils/HostAddressUtil.d.mts +1 -0
  418. package/Utils/HostAddressUtil.d.ts +1 -0
  419. package/Utils/HostAddressUtil.js +30 -0
  420. package/Utils/LinearRegExp/LinearRegExp.js +5 -1
  421. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +8 -0
  422. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +8 -0
  423. package/Utils/Markdown/LinkReferenceDefinitions.js +1493 -131
  424. package/Utils/Markdown/LinkReferenceDefinitions.mjs +1 -0
  425. package/Utils/Markdown/MarkdownTableCell.js +2 -1
  426. package/Utils/Markdown/OverLongText.js +523 -5
  427. package/Utils/Markdown/SlowMarkdown.d.mts +14 -0
  428. package/Utils/Markdown/SlowMarkdown.d.ts +14 -0
  429. package/Utils/Markdown/SlowMarkdown.js +595 -11
  430. package/Utils/Markdown/SlowMarkdown.mjs +6 -0
  431. package/Utils/Milliseconds.d.mts +7 -0
  432. package/Utils/Milliseconds.d.ts +7 -0
  433. package/Utils/Milliseconds.js +60 -0
  434. package/Utils/Milliseconds.mjs +4 -0
  435. package/Utils/ModelApiName.d.mts +11 -0
  436. package/Utils/ModelApiName.d.ts +11 -0
  437. package/Utils/ModelApiName.js +72 -0
  438. package/Utils/ModelApiName.mjs +5 -0
  439. package/Utils/Monitor/DeviceMacLearningUtil.d.mts +2 -1
  440. package/Utils/Monitor/DeviceMacLearningUtil.d.ts +2 -1
  441. package/Utils/Monitor/DeviceMacLearningUtil.js +26 -0
  442. package/Utils/Monitor/EndpointAttachmentUtil.d.mts +8 -0
  443. package/Utils/Monitor/EndpointAttachmentUtil.d.ts +8 -0
  444. package/Utils/Monitor/EndpointAttachmentUtil.js +97 -22
  445. package/Utils/Monitor/EndpointAttachmentUtil.mjs +4 -0
  446. package/Utils/Monitor/ExternalStatusPageReading.d.mts +3 -0
  447. package/Utils/Monitor/ExternalStatusPageReading.d.ts +3 -0
  448. package/Utils/Monitor/ExternalStatusPageReading.js +35 -1
  449. package/Utils/Monitor/ExternalStatusPageReading.mjs +2 -0
  450. package/Utils/Monitor/InterfaceInventoryUtil.d.mts +40 -0
  451. package/Utils/Monitor/InterfaceInventoryUtil.d.ts +40 -0
  452. package/Utils/Monitor/InterfaceInventoryUtil.js +217 -5
  453. package/Utils/Monitor/InterfaceInventoryUtil.mjs +8 -0
  454. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +63 -29
  455. package/Utils/Monitor/MonitorOverviewProbeUtil.js +13 -2
  456. package/Utils/Monitor/MonitorRootCauseWording.d.mts +2 -0
  457. package/Utils/Monitor/MonitorRootCauseWording.d.ts +2 -0
  458. package/Utils/Monitor/MonitorRootCauseWording.js +58 -4
  459. package/Utils/Monitor/MonitorTemplateLinkRefusal.d.mts +9 -0
  460. package/Utils/Monitor/MonitorTemplateLinkRefusal.d.ts +9 -0
  461. package/Utils/Monitor/MonitorTemplateLinkRefusal.js +45 -0
  462. package/Utils/Monitor/MonitorTemplateLinkRefusal.mjs +6 -0
  463. package/Utils/Monitor/MonitoringOff.d.mts +2 -0
  464. package/Utils/Monitor/MonitoringOff.d.ts +2 -0
  465. package/Utils/Monitor/MonitoringOff.js +21 -0
  466. package/Utils/Monitor/NetworkTopologyUtil.d.mts +2 -1
  467. package/Utils/Monitor/NetworkTopologyUtil.d.ts +2 -1
  468. package/Utils/Monitor/NetworkTopologyUtil.js +10 -0
  469. package/Utils/Monitor/NotOperationalMonitorQuery.d.mts +2 -1
  470. package/Utils/Monitor/NotOperationalMonitorQuery.d.ts +2 -1
  471. package/Utils/Monitor/NotOperationalMonitorQuery.js +23 -4
  472. package/Utils/Monitor/ProbeFailureReading.d.mts +14 -0
  473. package/Utils/Monitor/ProbeFailureReading.d.ts +14 -0
  474. package/Utils/Monitor/ProbeFailureReading.js +137 -0
  475. package/Utils/Monitor/ProbeFailureReading.mjs +7 -0
  476. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.mts +9 -0
  477. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.ts +9 -0
  478. package/Utils/NetworkDevice/BoundMonitorNotChecked.js +15 -0
  479. package/Utils/NetworkDevice/BoundMonitorNotChecked.mjs +2 -0
  480. package/Utils/OpenStack/OpenStackCheckName.js +2 -1
  481. package/Utils/OpenStack/OpenStackLogScrub.js +1 -1
  482. package/Utils/OpenStack/OpenStackLogs.js +3 -2
  483. package/Utils/OpenStack/OpenStackTraces.js +2 -1
  484. package/Utils/Project/NextNumber.js +1 -1
  485. package/Utils/Project/NotificationChannels.js +5 -5
  486. package/Utils/Project/ProjectBalance.js +2 -2
  487. package/Utils/Project/TwilioAccount.js +2 -2
  488. package/Utils/PromQL/PromQLAst.d.mts +159 -0
  489. package/Utils/PromQL/PromQLAst.d.ts +159 -0
  490. package/Utils/PromQL/PromQLAst.js +118 -0
  491. package/Utils/PromQL/PromQLAst.mjs +12 -0
  492. package/Utils/PromQL/PromQLDuration.d.mts +2 -0
  493. package/Utils/PromQL/PromQLDuration.d.ts +2 -0
  494. package/Utils/PromQL/PromQLDuration.js +78 -0
  495. package/Utils/PromQL/PromQLDuration.mjs +3 -0
  496. package/Utils/PromQL/PromQLEngine.d.mts +15 -0
  497. package/Utils/PromQL/PromQLEngine.d.ts +15 -0
  498. package/Utils/PromQL/PromQLEngine.js +965 -0
  499. package/Utils/PromQL/PromQLEngine.mjs +7 -0
  500. package/Utils/PromQL/PromQLEngineTypes.d.mts +84 -0
  501. package/Utils/PromQL/PromQLEngineTypes.d.ts +84 -0
  502. package/Utils/PromQL/PromQLEngineTypes.js +10 -0
  503. package/Utils/PromQL/PromQLEngineTypes.mjs +2 -0
  504. package/Utils/PromQL/PromQLError.d.mts +11 -0
  505. package/Utils/PromQL/PromQLError.d.ts +11 -0
  506. package/Utils/PromQL/PromQLError.js +27 -0
  507. package/Utils/PromQL/PromQLError.mjs +3 -0
  508. package/Utils/PromQL/PromQLFunctionEvaluators.d.mts +8 -0
  509. package/Utils/PromQL/PromQLFunctionEvaluators.d.ts +8 -0
  510. package/Utils/PromQL/PromQLFunctionEvaluators.js +773 -0
  511. package/Utils/PromQL/PromQLFunctionEvaluators.mjs +3 -0
  512. package/Utils/PromQL/PromQLFunctions.d.mts +10 -0
  513. package/Utils/PromQL/PromQLFunctions.d.ts +10 -0
  514. package/Utils/PromQL/PromQLFunctions.js +127 -0
  515. package/Utils/PromQL/PromQLFunctions.mjs +4 -0
  516. package/Utils/PromQL/PromQLLabels.d.mts +11 -0
  517. package/Utils/PromQL/PromQLLabels.d.ts +11 -0
  518. package/Utils/PromQL/PromQLLabels.js +218 -0
  519. package/Utils/PromQL/PromQLLabels.mjs +9 -0
  520. package/Utils/PromQL/PromQLLexer.d.mts +39 -0
  521. package/Utils/PromQL/PromQLLexer.d.ts +39 -0
  522. package/Utils/PromQL/PromQLLexer.js +391 -0
  523. package/Utils/PromQL/PromQLLexer.mjs +3 -0
  524. package/Utils/PromQL/PromQLMath.d.mts +19 -0
  525. package/Utils/PromQL/PromQLMath.d.ts +19 -0
  526. package/Utils/PromQL/PromQLMath.js +200 -0
  527. package/Utils/PromQL/PromQLMath.mjs +9 -0
  528. package/Utils/PromQL/PromQLMetricNames.d.mts +21 -0
  529. package/Utils/PromQL/PromQLMetricNames.d.ts +21 -0
  530. package/Utils/PromQL/PromQLMetricNames.js +199 -0
  531. package/Utils/PromQL/PromQLMetricNames.mjs +8 -0
  532. package/Utils/PromQL/PromQLParser.d.mts +4 -0
  533. package/Utils/PromQL/PromQLParser.d.ts +4 -0
  534. package/Utils/PromQL/PromQLParser.js +831 -0
  535. package/Utils/PromQL/PromQLParser.mjs +4 -0
  536. package/Utils/PromQL/PromQLRegex.d.mts +9 -0
  537. package/Utils/PromQL/PromQLRegex.d.ts +9 -0
  538. package/Utils/PromQL/PromQLRegex.js +74 -0
  539. package/Utils/PromQL/PromQLRegex.mjs +2 -0
  540. package/Utils/PromQL/PrometheusResponse.d.mts +25 -0
  541. package/Utils/PromQL/PrometheusResponse.d.ts +25 -0
  542. package/Utils/PromQL/PrometheusResponse.js +90 -0
  543. package/Utils/PromQL/PrometheusResponse.mjs +3 -0
  544. package/Utils/Rum/PathInSentence.d.mts +5 -0
  545. package/Utils/Rum/PathInSentence.d.ts +5 -0
  546. package/Utils/Rum/PathInSentence.js +46 -0
  547. package/Utils/Rum/PathInSentence.mjs +6 -0
  548. package/Utils/Rum/UrlScrubber.d.mts +4 -0
  549. package/Utils/Rum/UrlScrubber.d.ts +4 -0
  550. package/Utils/Rum/UrlScrubber.js +143 -3
  551. package/Utils/Rum/UserFlow.d.mts +1 -1
  552. package/Utils/Rum/UserFlow.d.ts +1 -1
  553. package/Utils/Rum/UserFlow.js +180 -25
  554. package/Utils/Rum/UserFlow.mjs +1 -1
  555. package/Utils/Runbook/RunbookStepsSignature.d.mts +3 -0
  556. package/Utils/Runbook/RunbookStepsSignature.d.ts +3 -0
  557. package/Utils/Runbook/RunbookStepsSignature.js +30 -0
  558. package/Utils/Runbook/RunbookStepsSignature.mjs +3 -0
  559. package/Utils/ScheduledMaintenanceStart.d.mts +3 -0
  560. package/Utils/ScheduledMaintenanceStart.d.ts +3 -0
  561. package/Utils/ScheduledMaintenanceStart.js +9 -0
  562. package/Utils/Schema/ModelSchema.js +10 -1
  563. package/Utils/Schema/TypeSchemas.js +6 -0
  564. package/Utils/Slo/SloDuration.d.mts +5 -2
  565. package/Utils/Slo/SloDuration.d.ts +5 -2
  566. package/Utils/Slo/SloDuration.js +11 -6
  567. package/Utils/Slo/SloHealth.js +1 -1
  568. package/Utils/StateOrder.js +1 -4
  569. package/Utils/StateTimeline/StateTimelineRowDelete.js +1 -1
  570. package/Utils/Telemetry/HeartbeatAvailability.d.mts +4 -0
  571. package/Utils/Telemetry/HeartbeatAvailability.d.ts +4 -0
  572. package/Utils/Telemetry/HeartbeatAvailability.js +118 -26
  573. package/Utils/Uptime/DayUptimeGraphUtil.js +2 -2
  574. package/Utils/Uptime/UptimeMaintenanceUtil.js +2 -1
  575. package/Utils/ValueFormatter.d.mts +8 -6
  576. package/Utils/ValueFormatter.d.ts +8 -6
  577. package/Utils/ValueFormatter.js +145 -0
  578. package/package.json +1 -1
@@ -1,4 +1,11 @@
1
1
  import AggregationInterval from "./AggregationInterval";
2
+ import Timezone from "../Timezone";
3
+ export interface AggregateWindow {
4
+ startTimestamp?: Date | undefined;
5
+ endTimestamp?: Date | undefined;
6
+ aggregationInterval?: AggregationInterval | undefined;
7
+ timezone?: Timezone | undefined;
8
+ }
2
9
  export declare class AggregationIntervalUtil {
3
10
  static getAggregationIntervalForWindow(data: {
4
11
  startDate: Date;
@@ -11,11 +18,19 @@ export declare class AggregationIntervalUtil {
11
18
  */
12
19
  aggregationInterval?: AggregationInterval | undefined;
13
20
  }): AggregationInterval;
21
+ static isCalendarInterval(interval: AggregationInterval): boolean;
22
+ static getReaderTimezone(data: {
23
+ startDate: Date;
24
+ endDate: Date;
25
+ aggregationInterval?: AggregationInterval | undefined;
26
+ }): Timezone | undefined;
27
+ static withReaderTimezone<TRequest extends AggregateWindow>(aggregateBy: TRequest): TRequest;
14
28
  static getAggregationIntervalMs(interval: AggregationInterval): number;
15
- static floorDateToIntervalGrid(date: Date, interval: AggregationInterval): Date;
29
+ static floorDateToIntervalGrid(date: Date, interval: AggregationInterval, timezone?: Timezone | undefined): Date;
16
30
  static getIntervalAlignedWindow(data: {
17
31
  startDate: Date;
18
32
  endDate: Date;
33
+ timezone?: Timezone | undefined;
19
34
  }): {
20
35
  startDate: Date;
21
36
  endDate: Date;
@@ -6,6 +6,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AggregationIntervalUtil = void 0;
7
7
  const AggregationInterval_1 = __importDefault(require("./AggregationInterval"));
8
8
  const Date_1 = __importDefault(require("../Date"));
9
+ const TimezoneAlias_1 = __importDefault(require("../TimezoneAlias"));
10
+ /*
11
+ * The intervals whose buckets are units of a calendar: a day from midnight,
12
+ * a week from Monday, a month from its 1st, a year from 1 January. Where
13
+ * those begin depends on the time zone they are read in. An hour and
14
+ * shorter are counted from the epoch, the same instants in every zone, and
15
+ * Total is no bucket at all.
16
+ */
17
+ const CALENDAR_INTERVALS = [
18
+ AggregationInterval_1.default.Day,
19
+ AggregationInterval_1.default.Week,
20
+ AggregationInterval_1.default.Month,
21
+ AggregationInterval_1.default.Year,
22
+ ];
9
23
  /*
10
24
  * Single source of truth for "which time-bucket size does the
11
25
  * analytics aggregate API use for a given query window". The server
@@ -65,6 +79,68 @@ class AggregationIntervalUtil {
65
79
  }
66
80
  return AggregationInterval_1.default.Year;
67
81
  }
82
+ /*
83
+ * True for Day, Week, Month and Year: the buckets that start at the
84
+ * reader's midnight, Monday, 1st or 1 January when an aggregate carries
85
+ * the reader's zone (AggregateBy.timezone), and in UTC otherwise.
86
+ */
87
+ static isCalendarInterval(interval) {
88
+ return CALENDAR_INTERVALS.includes(interval);
89
+ }
90
+ /*
91
+ * The zone an aggregate over this window asks its buckets to follow: the
92
+ * reader's (OneUptimeDate.getCurrentTimezone(), the zone User Settings
93
+ * picked, or the browser's), when its buckets are days, weeks, months or
94
+ * years. A chart draws those on the reader's calendar, so their buckets
95
+ * must start where the reader's days do (issue #7277).
96
+ *
97
+ * Undefined for an hour and shorter and for Total, which no zone moves,
98
+ * so those requests stay exactly as they were. Undefined too for a zone
99
+ * the Timezone list does not name - a browser can report a zone newer
100
+ * than the list, and the server refuses any other - so those buckets
101
+ * follow UTC, as before, rather than the chart failing.
102
+ */
103
+ static getReaderTimezone(data) {
104
+ const interval = this.getAggregationIntervalForWindow(data);
105
+ if (!this.isCalendarInterval(interval)) {
106
+ return undefined;
107
+ }
108
+ const timezone = Date_1.default.getCurrentTimezone();
109
+ return TimezoneAlias_1.default.isListedName(timezone) ? timezone : undefined;
110
+ }
111
+ /*
112
+ * The request with the reader's zone on it (getReaderTimezone), as the
113
+ * dashboard sends every aggregate: a new object, the one given left as it
114
+ * is. A request that names its zone keeps it - a cloud's cost is for a
115
+ * UTC day, and its readers ask for Timezone.UTC - and one with no window
116
+ * to read an interval from, or no zone to add, comes back unchanged.
117
+ */
118
+ static withReaderTimezone(aggregateBy) {
119
+ if (!aggregateBy ||
120
+ (aggregateBy.timezone !== undefined && aggregateBy.timezone !== null)) {
121
+ return aggregateBy;
122
+ }
123
+ let timezone = undefined;
124
+ try {
125
+ timezone = this.getReaderTimezone({
126
+ startDate: aggregateBy.startTimestamp,
127
+ endDate: aggregateBy.endTimestamp,
128
+ aggregationInterval: aggregateBy.aggregationInterval,
129
+ });
130
+ }
131
+ catch (_a) {
132
+ /*
133
+ * No window to read an interval from (fromString throws on a missing
134
+ * date): the request goes as it is, and the server answers it as it
135
+ * always has.
136
+ */
137
+ return aggregateBy;
138
+ }
139
+ if (!timezone) {
140
+ return aggregateBy;
141
+ }
142
+ return Object.assign(Object.assign({}, aggregateBy), { timezone: timezone });
143
+ }
68
144
  /*
69
145
  * Nominal bucket width in milliseconds. Month and Year are
70
146
  * calendar-variable in ClickHouse (`toStartOfInterval` snaps to
@@ -124,8 +200,15 @@ class AggregationIntervalUtil {
124
200
  * server-side, which a fixed-ms grid can't reproduce, so those (and
125
201
  * `Total`) are returned UNCHANGED rather than risk shifting the gap for
126
202
  * long windows — their pre-existing behavior is preserved.
203
+ *
204
+ * `timezone` is the zone the request's buckets follow (its
205
+ * AggregateBy.timezone, see getReaderTimezone): a Day then floors to that
206
+ * zone's midnight, where the server starts the day, and not to UTC's - in
207
+ * New York a UTC midnight is 19:00 the evening before, so the window's
208
+ * first day would hold five hours of it. Every finer interval is the same
209
+ * in every zone and ignores it.
127
210
  */
128
- static floorDateToIntervalGrid(date, interval) {
211
+ static floorDateToIntervalGrid(date, interval, timezone) {
129
212
  const ms = Date_1.default.fromString(date).getTime();
130
213
  const alignableIntervals = [
131
214
  AggregationInterval_1.default.Minute,
@@ -138,6 +221,9 @@ class AggregationIntervalUtil {
138
221
  if (!alignableIntervals.includes(interval)) {
139
222
  return new Date(ms);
140
223
  }
224
+ if (interval === AggregationInterval_1.default.Day && timezone) {
225
+ return Date_1.default.getStartOfDay(new Date(ms), timezone);
226
+ }
141
227
  const bucketMs = this.getAggregationIntervalMs(interval);
142
228
  if (!Number.isFinite(bucketMs) || bucketMs <= 0) {
143
229
  return new Date(ms);
@@ -154,6 +240,10 @@ class AggregationIntervalUtil {
154
240
  * is floored DOWN so the first bucket is complete and lands on the axis
155
241
  * origin (removing the leading gap); the end is left untouched so the
156
242
  * latest, still-in-progress bucket and its live data continue to show.
243
+ *
244
+ * `timezone` is the zone the window's request will carry (see
245
+ * floorDateToIntervalGrid); the caller reads it with getReaderTimezone,
246
+ * as the request does, so the two always agree.
157
247
  */
158
248
  static getIntervalAlignedWindow(data) {
159
249
  const interval = this.getAggregationIntervalForWindow({
@@ -161,7 +251,7 @@ class AggregationIntervalUtil {
161
251
  endDate: data.endDate,
162
252
  });
163
253
  return {
164
- startDate: this.floorDateToIntervalGrid(data.startDate, interval),
254
+ startDate: this.floorDateToIntervalGrid(data.startDate, interval, data.timezone),
165
255
  endDate: Date_1.default.fromString(data.endDate),
166
256
  interval,
167
257
  };
@@ -7,4 +7,5 @@ export default interface ListResult<TBaseModel extends BaseModel | AnalyticsBase
7
7
  skip: number;
8
8
  limit: number;
9
9
  hasMore?: boolean | undefined;
10
+ isCountCapped?: boolean | undefined;
10
11
  }
@@ -7,4 +7,5 @@ export default interface ListResult<TBaseModel extends BaseModel | AnalyticsBase
7
7
  skip: number;
8
8
  limit: number;
9
9
  hasMore?: boolean | undefined;
10
+ isCountCapped?: boolean | undefined;
10
11
  }
@@ -0,0 +1,47 @@
1
+ import Phone from "../Phone.mjs";
2
+ import { TwilioConfigUse } from "./TwilioConfigUse.mjs";
3
+ export declare enum ServerTwilioEnvironmentVariable {
4
+ AccountSid = "GLOBAL_TWILIO_ACCOUNT_SID",
5
+ AuthToken = "GLOBAL_TWILIO_AUTH_TOKEN",
6
+ UsedFor = "GLOBAL_TWILIO_USED_FOR",
7
+ PrimaryPhoneNumber = "GLOBAL_TWILIO_PRIMARY_PHONE_NUMBER",
8
+ SecondaryPhoneNumbers = "GLOBAL_TWILIO_SECONDARY_PHONE_NUMBERS",
9
+ SmsPhoneNumbers = "GLOBAL_TWILIO_SMS_PHONE_NUMBERS"
10
+ }
11
+ export declare const SERVER_TWILIO_ENVIRONMENT_VARIABLES: ReadonlyArray<ServerTwilioEnvironmentVariable>;
12
+ export declare const SERVER_TWILIO_USED_FOR_VALUES: Readonly<Record<TwilioConfigUse, string>>;
13
+ export declare const SERVER_TWILIO_ENVIRONMENT_ROUTE: string;
14
+ export declare const SERVER_TWILIO_SET_BY_ENVIRONMENT_MESSAGE: string;
15
+ export interface ServerTwilioEnvironmentAccount {
16
+ twilioAccountSID: string;
17
+ twilioAuthToken: string;
18
+ twilioUsedFor: TwilioConfigUse;
19
+ twilioPrimaryPhoneNumber?: Phone | undefined;
20
+ twilioSecondaryPhoneNumbers: string;
21
+ twilioSmsPhoneNumbers: string;
22
+ }
23
+ export interface ServerTwilioEnvironmentReading {
24
+ isSet: boolean;
25
+ account: ServerTwilioEnvironmentAccount | null;
26
+ problems: Array<string>;
27
+ }
28
+ export interface ServerTwilioEnvironmentAnswer {
29
+ isSetByEnvironment: boolean;
30
+ usedFor: TwilioConfigUse | null;
31
+ accountSid: string | null;
32
+ hasAuthToken: boolean;
33
+ primaryPhoneNumber: string | null;
34
+ secondaryPhoneNumbers: string | null;
35
+ smsPhoneNumbers: string | null;
36
+ problems: Array<string>;
37
+ }
38
+ export type ServerTwilioEnvironmentValues = Readonly<Record<string, string | undefined>>;
39
+ export default class ServerTwilioEnvironment {
40
+ static readUse(value: string | undefined): TwilioConfigUse | null;
41
+ static read(environment: ServerTwilioEnvironmentValues): ServerTwilioEnvironmentReading;
42
+ static isUsable(reading: ServerTwilioEnvironmentReading): boolean;
43
+ static toAnswer(reading: ServerTwilioEnvironmentReading): ServerTwilioEnvironmentAnswer;
44
+ static answerFromJSON(json: unknown): ServerTwilioEnvironmentAnswer;
45
+ static getStartupNotice(reading: ServerTwilioEnvironmentReading): string | null;
46
+ static getStartupWarning(reading: ServerTwilioEnvironmentReading): string | null;
47
+ }
@@ -0,0 +1,47 @@
1
+ import Phone from "../Phone";
2
+ import { TwilioConfigUse } from "./TwilioConfigUse";
3
+ export declare enum ServerTwilioEnvironmentVariable {
4
+ AccountSid = "GLOBAL_TWILIO_ACCOUNT_SID",
5
+ AuthToken = "GLOBAL_TWILIO_AUTH_TOKEN",
6
+ UsedFor = "GLOBAL_TWILIO_USED_FOR",
7
+ PrimaryPhoneNumber = "GLOBAL_TWILIO_PRIMARY_PHONE_NUMBER",
8
+ SecondaryPhoneNumbers = "GLOBAL_TWILIO_SECONDARY_PHONE_NUMBERS",
9
+ SmsPhoneNumbers = "GLOBAL_TWILIO_SMS_PHONE_NUMBERS"
10
+ }
11
+ export declare const SERVER_TWILIO_ENVIRONMENT_VARIABLES: ReadonlyArray<ServerTwilioEnvironmentVariable>;
12
+ export declare const SERVER_TWILIO_USED_FOR_VALUES: Readonly<Record<TwilioConfigUse, string>>;
13
+ export declare const SERVER_TWILIO_ENVIRONMENT_ROUTE: string;
14
+ export declare const SERVER_TWILIO_SET_BY_ENVIRONMENT_MESSAGE: string;
15
+ export interface ServerTwilioEnvironmentAccount {
16
+ twilioAccountSID: string;
17
+ twilioAuthToken: string;
18
+ twilioUsedFor: TwilioConfigUse;
19
+ twilioPrimaryPhoneNumber?: Phone | undefined;
20
+ twilioSecondaryPhoneNumbers: string;
21
+ twilioSmsPhoneNumbers: string;
22
+ }
23
+ export interface ServerTwilioEnvironmentReading {
24
+ isSet: boolean;
25
+ account: ServerTwilioEnvironmentAccount | null;
26
+ problems: Array<string>;
27
+ }
28
+ export interface ServerTwilioEnvironmentAnswer {
29
+ isSetByEnvironment: boolean;
30
+ usedFor: TwilioConfigUse | null;
31
+ accountSid: string | null;
32
+ hasAuthToken: boolean;
33
+ primaryPhoneNumber: string | null;
34
+ secondaryPhoneNumbers: string | null;
35
+ smsPhoneNumbers: string | null;
36
+ problems: Array<string>;
37
+ }
38
+ export type ServerTwilioEnvironmentValues = Readonly<Record<string, string | undefined>>;
39
+ export default class ServerTwilioEnvironment {
40
+ static readUse(value: string | undefined): TwilioConfigUse | null;
41
+ static read(environment: ServerTwilioEnvironmentValues): ServerTwilioEnvironmentReading;
42
+ static isUsable(reading: ServerTwilioEnvironmentReading): boolean;
43
+ static toAnswer(reading: ServerTwilioEnvironmentReading): ServerTwilioEnvironmentAnswer;
44
+ static answerFromJSON(json: unknown): ServerTwilioEnvironmentAnswer;
45
+ static getStartupNotice(reading: ServerTwilioEnvironmentReading): string | null;
46
+ static getStartupWarning(reading: ServerTwilioEnvironmentReading): string | null;
47
+ }
@@ -0,0 +1,282 @@
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.SERVER_TWILIO_SET_BY_ENVIRONMENT_MESSAGE = exports.SERVER_TWILIO_ENVIRONMENT_ROUTE = exports.SERVER_TWILIO_USED_FOR_VALUES = exports.SERVER_TWILIO_ENVIRONMENT_VARIABLES = exports.ServerTwilioEnvironmentVariable = void 0;
7
+ const Phone_1 = __importDefault(require("../Phone"));
8
+ const RefusedValue_1 = require("../../Utils/RefusedValue");
9
+ const TwilioConfigUse_1 = require("./TwilioConfigUse");
10
+ const TwilioPhoneNumbers_1 = __importDefault(require("./TwilioPhoneNumbers"));
11
+ /*
12
+ * THE SERVER'S OWN TWILIO ACCOUNT, SET BY ENVIRONMENT VARIABLES (#7515).
13
+ *
14
+ * Admin Dashboard > Settings > Call and SMS keeps the server's Twilio
15
+ * account in GlobalConfig. An installation that keeps its configuration in
16
+ * code - Helm values, Terraform's helm_release, a config.env kept in git -
17
+ * sets it with these variables instead. Once GLOBAL_TWILIO_ACCOUNT_SID is
18
+ * set, the server's account is the one the variables describe: the senders
19
+ * read it (Server/Utils/ServerTwilioConfig), the Admin Dashboard shows it
20
+ * without an Edit button, and the server refuses a write to the saved one
21
+ * (GlobalConfigService). Unset, the saved account applies again, as it was.
22
+ * Nothing is copied into the database, so the auth token stays where it was
23
+ * given: a Kubernetes Secret, or config.env.
24
+ *
25
+ * All of the account comes from the variables, or none of it: a variable
26
+ * left unset is empty, never the saved value, so the variables are the
27
+ * whole account and a value nobody wrote down cannot change what is sent.
28
+ *
29
+ * What is wrong with them is said by the variable's name, and never with
30
+ * the auth token: when the server starts, on the Admin Dashboard's Call and
31
+ * SMS page, and in what the server's sending status says SMS and calls are
32
+ * missing (ServerChannelSetup). An account with something wrong sends
33
+ * nothing, as an account that is not set up, rather than send from a number
34
+ * nobody meant or with a use nobody chose.
35
+ *
36
+ * The variables are new names. TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN and
37
+ * TWILIO_PHONE_NUMBER were read once, into a new installation's database, by
38
+ * the UpdateGlobalConfigFromEnv data migration, and an old config.env may
39
+ * still hold them: reading them again would put a stale account over the one
40
+ * an admin has saved since.
41
+ */
42
+ var ServerTwilioEnvironmentVariable;
43
+ (function (ServerTwilioEnvironmentVariable) {
44
+ ServerTwilioEnvironmentVariable["AccountSid"] = "GLOBAL_TWILIO_ACCOUNT_SID";
45
+ ServerTwilioEnvironmentVariable["AuthToken"] = "GLOBAL_TWILIO_AUTH_TOKEN";
46
+ ServerTwilioEnvironmentVariable["UsedFor"] = "GLOBAL_TWILIO_USED_FOR";
47
+ ServerTwilioEnvironmentVariable["PrimaryPhoneNumber"] = "GLOBAL_TWILIO_PRIMARY_PHONE_NUMBER";
48
+ ServerTwilioEnvironmentVariable["SecondaryPhoneNumbers"] = "GLOBAL_TWILIO_SECONDARY_PHONE_NUMBERS";
49
+ ServerTwilioEnvironmentVariable["SmsPhoneNumbers"] = "GLOBAL_TWILIO_SMS_PHONE_NUMBERS";
50
+ })(ServerTwilioEnvironmentVariable || (exports.ServerTwilioEnvironmentVariable = ServerTwilioEnvironmentVariable = {}));
51
+ // Every variable, the one that turns them on first.
52
+ exports.SERVER_TWILIO_ENVIRONMENT_VARIABLES = [
53
+ ServerTwilioEnvironmentVariable.AccountSid,
54
+ ServerTwilioEnvironmentVariable.AuthToken,
55
+ ServerTwilioEnvironmentVariable.UsedFor,
56
+ ServerTwilioEnvironmentVariable.PrimaryPhoneNumber,
57
+ ServerTwilioEnvironmentVariable.SecondaryPhoneNumbers,
58
+ ServerTwilioEnvironmentVariable.SmsPhoneNumbers,
59
+ ];
60
+ /*
61
+ * What GLOBAL_TWILIO_USED_FOR is written as for each use, in the docs, the
62
+ * Helm chart and config.example.env. The Admin Dashboard's own words ("SMS
63
+ * only") are taken too, in any case and with spaces, hyphens or underscores
64
+ * (readUse): "Calls and SMS", "calls_and_sms" and "CallsAndSms" are one use.
65
+ * Unset, it is calls and SMS, as every account was before the choice.
66
+ */
67
+ exports.SERVER_TWILIO_USED_FOR_VALUES = {
68
+ [TwilioConfigUse_1.TwilioConfigUse.CallsAndSms]: "calls-and-sms",
69
+ [TwilioConfigUse_1.TwilioConfigUse.SmsOnly]: "sms-only",
70
+ [TwilioConfigUse_1.TwilioConfigUse.CallsOnly]: "calls-only",
71
+ };
72
+ // Where the Admin Dashboard asks the server whether the variables set its account.
73
+ exports.SERVER_TWILIO_ENVIRONMENT_ROUTE = "/global-config/twilio-environment";
74
+ /*
75
+ * Said when someone tries to change an account the variables set: the
76
+ * server refuses the write (GlobalConfigService), and the docs and the
77
+ * Admin Dashboard say where the account is changed instead.
78
+ */
79
+ exports.SERVER_TWILIO_SET_BY_ENVIRONMENT_MESSAGE = `This server's Twilio account is set by environment variables (${ServerTwilioEnvironmentVariable.AccountSid} and the other GLOBAL_TWILIO_ variables), so it cannot be changed in the Admin Dashboard. Change those variables - twilio in the Helm chart's values, or config.env with Docker Compose - and restart OneUptime.`;
80
+ // "callsandsms" for "Calls and SMS", "calls-and-sms" and "CALLS_AND_SMS".
81
+ const comparableUse = (value) => {
82
+ return value.toLowerCase().replace(/[^a-z]/g, "");
83
+ };
84
+ // "A", "A and B", "A, B and C".
85
+ const listed = (names) => {
86
+ if (names.length <= 1) {
87
+ return names.join("");
88
+ }
89
+ return `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
90
+ };
91
+ const NO_ACCOUNT_ANSWER = {
92
+ isSetByEnvironment: false,
93
+ usedFor: null,
94
+ accountSid: null,
95
+ hasAuthToken: false,
96
+ primaryPhoneNumber: null,
97
+ secondaryPhoneNumbers: null,
98
+ smsPhoneNumbers: null,
99
+ problems: [],
100
+ };
101
+ class ServerTwilioEnvironment {
102
+ /*
103
+ * The use GLOBAL_TWILIO_USED_FOR names, calls and SMS when it is empty,
104
+ * or null when it names none of the three.
105
+ */
106
+ static readUse(value) {
107
+ const written = (value || "").trim();
108
+ if (!written) {
109
+ return TwilioConfigUse_1.DEFAULT_TWILIO_CONFIG_USE;
110
+ }
111
+ for (const use of TwilioConfigUse_1.TWILIO_CONFIG_USES) {
112
+ if (comparableUse(use) === comparableUse(written)) {
113
+ return use;
114
+ }
115
+ }
116
+ return null;
117
+ }
118
+ /*
119
+ * The server's Twilio account as the environment sets it - process.env on
120
+ * the server, read again on every call, so nothing it held goes stale.
121
+ * Each value is read without the whitespace around it: a token read from
122
+ * a file keeps its final newline (helm --set-file, Terraform's file()).
123
+ */
124
+ static read(environment) {
125
+ const value = (variable) => {
126
+ const written = environment[variable];
127
+ return typeof written === "string" ? written.trim() : "";
128
+ };
129
+ const accountSid = value(ServerTwilioEnvironmentVariable.AccountSid);
130
+ if (!accountSid) {
131
+ const unused = exports.SERVER_TWILIO_ENVIRONMENT_VARIABLES.filter((variable) => {
132
+ return Boolean(value(variable));
133
+ });
134
+ return {
135
+ isSet: false,
136
+ account: null,
137
+ problems: unused.length > 0
138
+ ? [
139
+ `${listed(unused)} ${unused.length === 1 ? "is" : "are"} set, but ${ServerTwilioEnvironmentVariable.AccountSid} is not, so nothing reads ${unused.length === 1 ? "it" : "them"}: the Twilio account saved in the Admin Dashboard is used. Set ${ServerTwilioEnvironmentVariable.AccountSid} too, or remove ${unused.length === 1 ? "it" : "them"}.`,
140
+ ]
141
+ : [],
142
+ };
143
+ }
144
+ const problems = [];
145
+ const authToken = value(ServerTwilioEnvironmentVariable.AuthToken);
146
+ if (!authToken) {
147
+ problems.push(`${ServerTwilioEnvironmentVariable.AuthToken} is not set: Twilio refuses the account without its auth token.`);
148
+ }
149
+ const usedForText = value(ServerTwilioEnvironmentVariable.UsedFor);
150
+ const use = ServerTwilioEnvironment.readUse(usedForText);
151
+ if (!use) {
152
+ problems.push(`${ServerTwilioEnvironmentVariable.UsedFor} must be ${exports.SERVER_TWILIO_USED_FOR_VALUES[TwilioConfigUse_1.TwilioConfigUse.CallsAndSms]}, ${exports.SERVER_TWILIO_USED_FOR_VALUES[TwilioConfigUse_1.TwilioConfigUse.SmsOnly]} or ${exports.SERVER_TWILIO_USED_FOR_VALUES[TwilioConfigUse_1.TwilioConfigUse.CallsOnly]}, not "${(0, RefusedValue_1.refusedValue)(usedForText)}".`);
153
+ }
154
+ const primaryText = value(ServerTwilioEnvironmentVariable.PrimaryPhoneNumber);
155
+ let primaryPhoneNumber = undefined;
156
+ if (primaryText) {
157
+ try {
158
+ primaryPhoneNumber = new Phone_1.default(primaryText);
159
+ }
160
+ catch (_a) {
161
+ problems.push(`${ServerTwilioEnvironmentVariable.PrimaryPhoneNumber}: "${(0, RefusedValue_1.refusedValue)(primaryText)}" is not a phone number. Write it with its country code, like +14155550100.`);
162
+ }
163
+ }
164
+ const secondaryText = value(ServerTwilioEnvironmentVariable.SecondaryPhoneNumbers);
165
+ const smsText = value(ServerTwilioEnvironmentVariable.SmsPhoneNumbers);
166
+ for (const [variable, text] of [
167
+ [ServerTwilioEnvironmentVariable.SecondaryPhoneNumbers, secondaryText],
168
+ [ServerTwilioEnvironmentVariable.SmsPhoneNumbers, smsText],
169
+ ]) {
170
+ const error = TwilioPhoneNumbers_1.default.getListError(text);
171
+ if (error) {
172
+ problems.push(`${variable}: ${error}`);
173
+ }
174
+ }
175
+ /*
176
+ * The numbers its use takes, as the Admin Dashboard's form asks for
177
+ * them (TwilioConfigUses.getMissingNumberError): SMS numbers for an
178
+ * account used for SMS only, a number to make calls from for the rest.
179
+ */
180
+ if (use === TwilioConfigUse_1.TwilioConfigUse.SmsOnly) {
181
+ if (TwilioPhoneNumbers_1.default.getListEntries(smsText).length === 0) {
182
+ problems.push(`${ServerTwilioEnvironmentVariable.SmsPhoneNumbers} is not set: an account used for SMS only sends every SMS from one of them.`);
183
+ }
184
+ }
185
+ else if (use && !primaryText) {
186
+ problems.push(`${ServerTwilioEnvironmentVariable.PrimaryPhoneNumber} is not set: calls go out from it.`);
187
+ }
188
+ const account = {
189
+ twilioAccountSID: accountSid,
190
+ twilioAuthToken: authToken,
191
+ twilioUsedFor: use || TwilioConfigUse_1.DEFAULT_TWILIO_CONFIG_USE,
192
+ twilioSecondaryPhoneNumbers: secondaryText,
193
+ twilioSmsPhoneNumbers: smsText,
194
+ };
195
+ if (primaryPhoneNumber) {
196
+ account.twilioPrimaryPhoneNumber = primaryPhoneNumber;
197
+ }
198
+ return {
199
+ isSet: true,
200
+ account: account,
201
+ problems: problems,
202
+ };
203
+ }
204
+ // Whether the account the variables set can send: set, with nothing wrong.
205
+ static isUsable(reading) {
206
+ return (reading.isSet && reading.account !== null && reading.problems.length === 0);
207
+ }
208
+ // What the Admin Dashboard is told: never the auth token.
209
+ static toAnswer(reading) {
210
+ if (!reading.isSet || !reading.account) {
211
+ return Object.assign(Object.assign({}, NO_ACCOUNT_ANSWER), { problems: [...reading.problems] });
212
+ }
213
+ const account = reading.account;
214
+ return {
215
+ isSetByEnvironment: true,
216
+ usedFor: account.twilioUsedFor,
217
+ accountSid: account.twilioAccountSID,
218
+ hasAuthToken: Boolean(account.twilioAuthToken),
219
+ primaryPhoneNumber: account.twilioPrimaryPhoneNumber
220
+ ? account.twilioPrimaryPhoneNumber.toString()
221
+ : null,
222
+ secondaryPhoneNumbers: account.twilioSecondaryPhoneNumbers || null,
223
+ smsPhoneNumbers: account.twilioSmsPhoneNumbers || null,
224
+ problems: [...reading.problems],
225
+ };
226
+ }
227
+ /*
228
+ * The answer as the Admin Dashboard reads it back. Anything that is not
229
+ * the answer's shape reads as the variables not set, so the page shows
230
+ * the saved account and its Edit button, and the server still refuses a
231
+ * write it must not take.
232
+ */
233
+ static answerFromJSON(json) {
234
+ if (!json || typeof json !== "object" || Array.isArray(json)) {
235
+ return Object.assign(Object.assign({}, NO_ACCOUNT_ANSWER), { problems: [] });
236
+ }
237
+ const data = json;
238
+ const text = (key) => {
239
+ const read = data[key];
240
+ return typeof read === "string" && read.trim() ? read : null;
241
+ };
242
+ const usedFor = data["usedFor"];
243
+ return {
244
+ isSetByEnvironment: data["isSetByEnvironment"] === true,
245
+ usedFor: TwilioConfigUse_1.TWILIO_CONFIG_USES.includes(usedFor)
246
+ ? usedFor
247
+ : null,
248
+ accountSid: text("accountSid"),
249
+ hasAuthToken: data["hasAuthToken"] === true,
250
+ primaryPhoneNumber: text("primaryPhoneNumber"),
251
+ secondaryPhoneNumbers: text("secondaryPhoneNumbers"),
252
+ smsPhoneNumbers: text("smsPhoneNumbers"),
253
+ problems: Array.isArray(data["problems"])
254
+ ? data["problems"].filter((problem) => {
255
+ return typeof problem === "string" && problem.length > 0;
256
+ })
257
+ : [],
258
+ };
259
+ }
260
+ /*
261
+ * What the server says once as it starts, so nobody looks for the
262
+ * account in the Admin Dashboard: the variables set it, or are set and
263
+ * unused. Null when no variable is set.
264
+ */
265
+ static getStartupNotice(reading) {
266
+ if (!reading.isSet) {
267
+ return null;
268
+ }
269
+ return `The server's Twilio account is set by environment variables (${ServerTwilioEnvironmentVariable.AccountSid} and the other GLOBAL_TWILIO_ variables): the account saved in the Admin Dashboard is not used.`;
270
+ }
271
+ // What is wrong with the variables, as the server says it when it starts.
272
+ static getStartupWarning(reading) {
273
+ if (reading.problems.length === 0) {
274
+ return null;
275
+ }
276
+ if (!reading.isSet) {
277
+ return reading.problems.join(" ");
278
+ }
279
+ return `The Twilio account set by environment variables sends no SMS and makes no calls until this is fixed: ${reading.problems.join(" ")}`;
280
+ }
281
+ }
282
+ exports.default = ServerTwilioEnvironment;
@@ -0,0 +1,7 @@
1
+ import commonJsModule from "./ServerTwilioEnvironment.js";
2
+ export default commonJsModule.default;
3
+ export const SERVER_TWILIO_ENVIRONMENT_ROUTE = commonJsModule.SERVER_TWILIO_ENVIRONMENT_ROUTE;
4
+ export const SERVER_TWILIO_ENVIRONMENT_VARIABLES = commonJsModule.SERVER_TWILIO_ENVIRONMENT_VARIABLES;
5
+ export const SERVER_TWILIO_SET_BY_ENVIRONMENT_MESSAGE = commonJsModule.SERVER_TWILIO_SET_BY_ENVIRONMENT_MESSAGE;
6
+ export const SERVER_TWILIO_USED_FOR_VALUES = commonJsModule.SERVER_TWILIO_USED_FOR_VALUES;
7
+ export const ServerTwilioEnvironmentVariable = commonJsModule.ServerTwilioEnvironmentVariable;
@@ -1,4 +1,5 @@
1
1
  import { CloudProvider } from "./CloudPlatform.mjs";
2
+ import { Translator } from "../Translator.mjs";
2
3
  export declare enum CloudServiceModel {
3
4
  IaaS = "iaas",
4
5
  PaaS = "paas"
@@ -70,6 +71,7 @@ export interface CloudNamedOnlyResourceType {
70
71
  export declare const NAMED_ONLY_RESOURCE_TYPES: ReadonlyArray<CloudNamedOnlyResourceType>;
71
72
  export declare function getReadableCloudResourceType(type: string | null | undefined): string;
72
73
  export declare function getCloudResourceTypeDisplayName(provider: string | null | undefined, type: string | null | undefined): string;
74
+ export declare function getCloudResourceTypeText(provider: string | null | undefined, type: string | null | undefined, translator: Pick<Translator, "translateText">): string;
73
75
  export declare function getCanonicalCloudResourceType(provider: string, type: string): string;
74
76
  export declare function getAwsCloudWatchRulesForNamespace(namespace: string): ReadonlyArray<AwsCloudWatchResourceRule>;
75
77
  export declare const AWS_CLOUDWATCH_DISCOVERY_NAMESPACES: ReadonlyArray<string>;
@@ -1,4 +1,5 @@
1
1
  import { CloudProvider } from "./CloudPlatform";
2
+ import { Translator } from "../Translator";
2
3
  export declare enum CloudServiceModel {
3
4
  IaaS = "iaas",
4
5
  PaaS = "paas"
@@ -70,6 +71,7 @@ export interface CloudNamedOnlyResourceType {
70
71
  export declare const NAMED_ONLY_RESOURCE_TYPES: ReadonlyArray<CloudNamedOnlyResourceType>;
71
72
  export declare function getReadableCloudResourceType(type: string | null | undefined): string;
72
73
  export declare function getCloudResourceTypeDisplayName(provider: string | null | undefined, type: string | null | undefined): string;
74
+ export declare function getCloudResourceTypeText(provider: string | null | undefined, type: string | null | undefined, translator: Pick<Translator, "translateText">): string;
73
75
  export declare function getCanonicalCloudResourceType(provider: string, type: string): string;
74
76
  export declare function getAwsCloudWatchRulesForNamespace(namespace: string): ReadonlyArray<AwsCloudWatchResourceRule>;
75
77
  export declare const AWS_CLOUDWATCH_DISCOVERY_NAMESPACES: ReadonlyArray<string>;
@@ -7,6 +7,7 @@ exports.isInventoryOnlyCloudResourceType = isInventoryOnlyCloudResourceType;
7
7
  exports.getCloudResourceTypeLabel = getCloudResourceTypeLabel;
8
8
  exports.getReadableCloudResourceType = getReadableCloudResourceType;
9
9
  exports.getCloudResourceTypeDisplayName = getCloudResourceTypeDisplayName;
10
+ exports.getCloudResourceTypeText = getCloudResourceTypeText;
10
11
  exports.getCanonicalCloudResourceType = getCanonicalCloudResourceType;
11
12
  exports.getAwsCloudWatchRulesForNamespace = getAwsCloudWatchRulesForNamespace;
12
13
  exports.getGcpMonitoredResourceRule = getGcpMonitoredResourceRule;
@@ -1405,9 +1406,11 @@ function getReadableCloudResourceType(type) {
1405
1406
  return trimmed;
1406
1407
  }
1407
1408
  /*
1408
- * What a page calls a resource of this type: the catalog's label, a named
1409
- * only type's (Subnet, Security Group), else the type in words
1410
- * (getReadableCloudResourceType). For a page only: what is stored - a
1409
+ * What a page calls a resource of this type, in English: the catalog's
1410
+ * label, a named only type's (Subnet, Security Group), else the type in
1411
+ * words (getReadableCloudResourceType). A list of resources, which never
1412
+ * holds a named only type, draws it as it comes; where one can be named, a
1413
+ * page draws getCloudResourceTypeText. For a page only: what is stored - a
1411
1414
  * resource's name, a rule, the AI's facts - keeps getCloudResourceTypeLabel,
1412
1415
  * whose fallback is the type as the cloud spells it.
1413
1416
  */
@@ -1424,6 +1427,33 @@ function getCloudResourceTypeDisplayName(provider, type) {
1424
1427
  }
1425
1428
  return getReadableCloudResourceType(type);
1426
1429
  }
1430
+ // The words the catalog lists its types under: the clouds' product names.
1431
+ const LISTED_TYPE_LABELS = new Set(exports.CLOUD_RESOURCE_TYPES.map((descriptor) => {
1432
+ return descriptor.label;
1433
+ }));
1434
+ /*
1435
+ * A resource type's name as a page draws it, by one rule on every page
1436
+ * (#7659). The catalog's labels are the clouds' product names - "Virtual
1437
+ * Machine", "EC2 Instance", "Cloud Run Service" - drawn as written in every
1438
+ * language: as the docs' tables list them, as a resource's name carries
1439
+ * them ("web-01 (Virtual Machine)"), and as the lists, the Type filters and
1440
+ * their chips, the topology and a resource's own page draw them. So is a
1441
+ * type in words ("Transit Gateway (EC2)"). Only a named only type's label
1442
+ * is a common noun, drawn in the reader's language ("Subred") - unless a
1443
+ * listed type is called the same ("Instance Group", "Network Interface",
1444
+ * "KMS Key"): those words are a product's name, and one resource reads the
1445
+ * same whether OneUptime holds it or only a link to it.
1446
+ */
1447
+ function getCloudResourceTypeText(provider, type, translator) {
1448
+ const name = getCloudResourceTypeDisplayName(provider, type);
1449
+ if (!provider ||
1450
+ !type ||
1451
+ LISTED_TYPE_LABELS.has(name) ||
1452
+ !NAMED_ONLY_LABELS.has(typeLookupKey(provider, type))) {
1453
+ return name;
1454
+ }
1455
+ return translator.translateText(name) || name;
1456
+ }
1427
1457
  /*
1428
1458
  * The type spelled the way the catalog spells it - Azure Monitor's
1429
1459
  * `Microsoft.ServiceBus/Namespaces` becomes `Microsoft.ServiceBus/namespaces`
@@ -18,6 +18,7 @@ export const getCanonicalCloudResourceType = commonJsModule.getCanonicalCloudRes
18
18
  export const getCloudResourceTypeDescriptor = commonJsModule.getCloudResourceTypeDescriptor;
19
19
  export const getCloudResourceTypeDisplayName = commonJsModule.getCloudResourceTypeDisplayName;
20
20
  export const getCloudResourceTypeLabel = commonJsModule.getCloudResourceTypeLabel;
21
+ export const getCloudResourceTypeText = commonJsModule.getCloudResourceTypeText;
21
22
  export const getGcpMonitoredResourceRule = commonJsModule.getGcpMonitoredResourceRule;
22
23
  export const getReadableCloudResourceType = commonJsModule.getReadableCloudResourceType;
23
24
  export const isInventoryOnlyCloudResourceType = commonJsModule.isInventoryOnlyCloudResourceType;