@oneuptime/common 12.0.28 → 12.0.30

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 (367) hide show
  1. package/Models/DatabaseModels/DashboardDomain.ts +43 -0
  2. package/Models/DatabaseModels/Index.ts +11 -0
  3. package/Models/DatabaseModels/MonitorTemplate.ts +15 -3
  4. package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +43 -0
  5. package/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.ts +662 -0
  6. package/Models/DatabaseModels/ProjectOnCallCalendarFeed.ts +584 -0
  7. package/Models/DatabaseModels/StatusPageDomain.ts +43 -0
  8. package/Models/DatabaseModels/UserOnCallCalendarFeed.ts +546 -0
  9. package/Models/DatabaseModels/UserOnCallShiftReminder.ts +231 -0
  10. package/Models/DatabaseModels/UserOnCallShiftReminderLog.ts +331 -0
  11. package/Server/API/DashboardDomainAPI.ts +74 -0
  12. package/Server/API/MicrosoftTeamsAPI.ts +81 -180
  13. package/Server/API/OnCallCalendarAPI.ts +2194 -0
  14. package/Server/API/StatusPageDomainAPI.ts +74 -0
  15. package/Server/EnvironmentConfig.ts +138 -0
  16. package/Server/Infrastructure/OnCallCalendarFeedCache.ts +1050 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/1790200000000-AllowNullMonitorNameOnMonitorTemplate.ts +43 -0
  18. package/Server/Infrastructure/Postgres/SchemaMigrations/1790300000000-AddCertificateReissueRequestedAtToDomains.ts +40 -0
  19. package/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.ts +253 -0
  20. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
  21. package/Server/Middleware/OnCallCalendarFeedRateLimit.ts +487 -0
  22. package/Server/Middleware/ProjectAuthorization.ts +6 -1
  23. package/Server/Services/DashboardDomainService.ts +131 -0
  24. package/Server/Services/Index.ts +12 -0
  25. package/Server/Services/LogPipelineProcessorService.ts +88 -0
  26. package/Server/Services/MonitorTemplateService.ts +70 -11
  27. package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +32 -0
  28. package/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.ts +260 -0
  29. package/Server/Services/OnCallDutyPolicyScheduleLayerService.ts +70 -3
  30. package/Server/Services/OnCallDutyPolicyScheduleLayerUserService.ts +138 -3
  31. package/Server/Services/OnCallDutyPolicyScheduleService.ts +1465 -134
  32. package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +167 -31
  33. package/Server/Services/ProjectOnCallCalendarFeedService.ts +192 -0
  34. package/Server/Services/StatusPageDomainService.ts +163 -3
  35. package/Server/Services/StatusPagePrivateUserSessionService.ts +197 -56
  36. package/Server/Services/TeamMemberService.ts +489 -1
  37. package/Server/Services/TeamService.ts +50 -0
  38. package/Server/Services/UserNotificationSettingService.ts +44 -1
  39. package/Server/Services/UserOnCallCalendarFeedService.ts +159 -0
  40. package/Server/Services/UserOnCallShiftReminderLogService.ts +151 -0
  41. package/Server/Services/UserOnCallShiftReminderService.ts +112 -0
  42. package/Server/Types/Domain.ts +17 -0
  43. package/Server/Utils/APIKey/AccessPermission.ts +24 -0
  44. package/Server/Utils/Greenlock/Greenlock.ts +156 -58
  45. package/Server/Utils/LogPipelineProcessorValidation.ts +112 -0
  46. package/Server/Utils/OnCall/CalendarFeedToken.ts +241 -0
  47. package/Server/Utils/OnCall/OnCallCalendarFeedRenderer.ts +1488 -0
  48. package/Server/Utils/OnCall/OnCallCalendarFeedUrls.ts +230 -0
  49. package/Server/Utils/OnCall/OnCallShiftChangeListeners.ts +227 -0
  50. package/Server/Utils/OnCall/OnCallShiftMaterializer.ts +1127 -0
  51. package/Server/Utils/OnCall/OnCallShiftReminderListener.ts +174 -0
  52. package/Server/Utils/OnCall/OnCallShiftReminderRunner.ts +2584 -0
  53. package/Server/Utils/Response.ts +134 -0
  54. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.ts +1094 -45
  55. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +153 -17
  56. package/Server/Utils/StartServer.ts +10 -0
  57. package/Server/Utils/Telemetry/AppMetrics.ts +51 -0
  58. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +23 -11
  59. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +0 -170
  60. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Authorization.ts +158 -0
  61. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +23 -11
  62. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +35 -13
  63. package/Tests/App/Dashboard/MonitorTemplateColumnAndFacet.test.tsx +505 -0
  64. package/Tests/App/Dashboard/OnCallCalendarFeedLinks.test.tsx +229 -0
  65. package/Tests/App/Dashboard/OnCallCalendarFeedPlanGate.test.tsx +489 -0
  66. package/Tests/App/Dashboard/OnCallCalendarFeedSideMenus.test.tsx +149 -0
  67. package/Tests/App/Dashboard/OnCallCalendarFeedUtil.test.ts +855 -0
  68. package/Tests/App/Dashboard/OnCallPersonalCalendarFeed.test.tsx +1209 -0
  69. package/Tests/App/Dashboard/OnCallSharedCalendarFeedCard.test.tsx +1019 -0
  70. package/Tests/App/Dashboard/OnCallShiftRemindersAndUpcomingShifts.test.tsx +655 -0
  71. package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +73 -0
  72. package/Tests/App/StatusPage/StatusPageLoginCodeBootstrap.test.ts +106 -0
  73. package/Tests/App/StatusPage/StatusPageLoginCodeUtil.test.ts +84 -0
  74. package/Tests/App/StatusPage/StatusPageRedirectSafety.test.ts +119 -0
  75. package/Tests/Models/MonitorTemplateMonitorNameColumn.test.ts +258 -0
  76. package/Tests/Models/OnCallCalendarFeedModels.test.ts +642 -0
  77. package/Tests/Models/OnCallDutyPolicyScheduleCalendarFeed.test.ts +288 -0
  78. package/Tests/Models/OnCallDutyPolicyScheduleShiftConfigVersion.test.ts +88 -0
  79. package/Tests/Models/UserOnCallShiftReminderModels.test.ts +368 -0
  80. package/Tests/Server/API/CustomDomainReissueSslAPI.test.ts +469 -0
  81. package/Tests/Server/API/Helpers.ts +8 -0
  82. package/Tests/Server/API/MicrosoftTeamsBotMessagesEndpoint.test.ts +729 -0
  83. package/Tests/Server/API/MicrosoftTeamsBotTestEndpoint.test.ts +26 -0
  84. package/Tests/Server/API/MicrosoftTeamsLegacyWebhookRemoval.test.ts +402 -0
  85. package/Tests/Server/API/OnCallCalendarAPI.test.ts +4461 -0
  86. package/Tests/Server/EnvironmentConfigOnCallCalendarFeed.test.ts +357 -0
  87. package/Tests/Server/Infrastructure/OnCallCalendarFeedCache.test.ts +1589 -0
  88. package/Tests/Server/Infrastructure/Postgres/AddOnCallCalendarFeedsMigration.test.ts +369 -0
  89. package/Tests/Server/Middleware/OnCallCalendarFeedRateLimit.test.ts +1365 -0
  90. package/Tests/Server/Middleware/ProjectAuthorizationApiKeyMiddleware.test.ts +4 -0
  91. package/Tests/Server/Services/AddCertificateReissueRequestedAtToDomainsMigration.test.ts +287 -0
  92. package/Tests/Server/Services/CustomDomainCertificateReissue.test.ts +477 -0
  93. package/Tests/Server/Services/FeedRetentionConsistency.test.ts +70 -0
  94. package/Tests/Server/Services/LogPipelineProcessorSaveValidation.test.ts +249 -0
  95. package/Tests/Server/Services/MonitorTemplateServiceBulkSync.test.ts +549 -0
  96. package/Tests/Server/Services/MonitorTemplateServiceNetworkDeviceSync.test.ts +16 -3
  97. package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +57 -0
  98. package/Tests/Server/Services/OnCallCalendarFeedServices.test.ts +1103 -0
  99. package/Tests/Server/Services/OnCallDutyPolicyScheduleResolver.test.ts +1037 -0
  100. package/Tests/Server/Services/OnCallShiftConfigPropagation.test.ts +1270 -0
  101. package/Tests/Server/Services/SecurityEventLastErrorColumnWidth.test.ts +151 -15
  102. package/Tests/Server/Services/StatusPagePrivateUserSessionService.test.ts +587 -0
  103. package/Tests/Server/Services/TeamDeleteMemberCleanup.test.ts +156 -0
  104. package/Tests/Server/Services/TeamMemberOnCallCleanup.test.ts +755 -0
  105. package/Tests/Server/Services/UserNotificationSettingShiftReminderDefaults.test.ts +267 -0
  106. package/Tests/Server/Services/UserOnCallShiftReminderServices.test.ts +583 -0
  107. package/Tests/Server/Types/Database/Permissions/ApiKeyFileAccess.test.ts +286 -0
  108. package/Tests/Server/Types/Database/Permissions/MonitorTemplateColumnAccess.test.ts +328 -0
  109. package/Tests/Server/Types/Database/Permissions/OnCallCalendarFeedPermissions.test.ts +254 -0
  110. package/Tests/Server/Types/Database/QueryHelperFindWithSameTextAndIsNull.test.ts +83 -0
  111. package/Tests/Server/Utils/AI/SRE/ConfidenceSignal.test.ts +377 -0
  112. package/Tests/Server/Utils/APIKey/AccessPermission.test.ts +16 -1
  113. package/Tests/Server/Utils/Greenlock/CertificateRenewalSchedule.test.ts +250 -0
  114. package/Tests/Server/Utils/LogPipelineProcessorValidation.test.ts +198 -0
  115. package/Tests/Server/Utils/OnCall/CalendarFeedToken.test.ts +467 -0
  116. package/Tests/Server/Utils/OnCall/OnCallCalendarFeedRenderer.test.ts +2142 -0
  117. package/Tests/Server/Utils/OnCall/OnCallCalendarFeedUrls.test.ts +278 -0
  118. package/Tests/Server/Utils/OnCall/OnCallResolverTestHarness.ts +440 -0
  119. package/Tests/Server/Utils/OnCall/OnCallShiftChangeListeners.test.ts +314 -0
  120. package/Tests/Server/Utils/OnCall/OnCallShiftMaterializer.test.ts +1502 -0
  121. package/Tests/Server/Utils/OnCall/OnCallShiftReminderListener.test.ts +491 -0
  122. package/Tests/Server/Utils/OnCall/OnCallShiftReminderRunner.test.ts +3088 -0
  123. package/Tests/Server/Utils/OnCall/OnCallShiftReminderTestHarness.ts +910 -0
  124. package/Tests/Server/Utils/ResponseSendCalendarResponse.test.ts +561 -0
  125. package/Tests/Server/Utils/SecurityEvent/ConnectorErrorMessage.test.ts +48 -9
  126. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsAuth.test.ts +726 -0
  127. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsClient.test.ts +74 -11
  128. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsErrorHandling.test.ts +1107 -0
  129. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +20 -3
  130. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +51 -11
  131. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerHardening.test.ts +1246 -0
  132. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsRequestContract.test.ts +961 -0
  133. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsResponseParsing.test.ts +653 -0
  134. package/Tests/Server/Utils/StartServerEncryptionSecretWarning.test.ts +64 -0
  135. package/Tests/Server/Utils/Telemetry/AppMetrics.test.ts +29 -0
  136. package/Tests/Server/Utils/Workspace/MicrosoftTeamsActionAuthorization.test.ts +880 -0
  137. package/Tests/Types/API/HTTPResponse.test.ts +175 -0
  138. package/Tests/Types/API/Route.test.ts +36 -4
  139. package/Tests/Types/Calendar/ICalendar.test.ts +488 -0
  140. package/Tests/Types/Database/DatabaseProperty.test.ts +171 -0
  141. package/Tests/Types/DateLocalShortDateTimeString.test.ts +518 -0
  142. package/Tests/Types/DateLocalTimeString.test.ts +259 -0
  143. package/Tests/Types/DateUserPrefers12HourFormat.test.ts +316 -0
  144. package/Tests/Types/NotificationSetting/NotificationSettingEventType.test.ts +53 -0
  145. package/Tests/Types/OnCallDutyPolicy/CalendarFeedTestFixtures.ts +310 -0
  146. package/Tests/Types/OnCallDutyPolicy/CalendarFeedWindow.test.ts +205 -0
  147. package/Tests/Types/OnCallDutyPolicy/LayerUtilLayerMetaAndIterationCap.test.ts +458 -0
  148. package/Tests/Types/OnCallDutyPolicy/MaterializedShift.test.ts +197 -0
  149. package/Tests/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.test.ts +1986 -0
  150. package/Tests/Types/OnCallDutyPolicy/ScheduleShiftUtilGroupKey.test.ts +678 -0
  151. package/Tests/Types/OnCallDutyPolicy/ShiftSeamUtil.test.ts +417 -0
  152. package/Tests/UI/Components/LogsHistogram.test.tsx +41 -2
  153. package/Tests/UI/Components/LogsViewerEmptyStateTimeRange.test.tsx +212 -0
  154. package/Tests/UI/Components/TelemetryChartClockFormat.test.tsx +359 -0
  155. package/Tests/UI/Components/TimeRangePickerClockFormat.test.tsx +422 -0
  156. package/Tests/UI/Components/TimeRangePickerDropdown.test.tsx +146 -8
  157. package/Tests/UI/MicrosoftTeams/MicrosoftTeamsMessagingEndpointGuidance.test.tsx +520 -0
  158. package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +10 -0
  159. package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +2 -0
  160. package/Tests/UI/Utils/Navigation.test.ts +82 -0
  161. package/Tests/Utils/Array.test.ts +100 -0
  162. package/Tests/Utils/CertificateReissue.test.ts +225 -0
  163. package/Tests/Utils/Grok/Grok.test.ts +492 -0
  164. package/Tests/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.test.ts +181 -13
  165. package/Types/API/Route.ts +20 -5
  166. package/Types/Calendar/ICalendar.ts +442 -0
  167. package/Types/Date.ts +143 -13
  168. package/Types/Email/EmailTemplateType.ts +2 -0
  169. package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
  170. package/Types/OnCallDutyPolicy/CalendarFeedWindow.ts +140 -0
  171. package/Types/OnCallDutyPolicy/Layer.ts +190 -35
  172. package/Types/OnCallDutyPolicy/MaterializedShift.ts +274 -0
  173. package/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.ts +1415 -0
  174. package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +159 -4
  175. package/Types/OnCallDutyPolicy/ShiftSeamUtil.ts +106 -0
  176. package/Types/Rum/SessionReplay.ts +62 -1
  177. package/UI/Components/Date/TimeRangePickerDropdown.tsx +9 -5
  178. package/UI/Components/LogsViewer/LogsViewer.tsx +12 -7
  179. package/UI/Components/LogsViewer/components/HistogramTooltip.tsx +18 -17
  180. package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +21 -28
  181. package/UI/Components/LogsViewer/components/LogsHistogram.tsx +2 -4
  182. package/UI/Components/TelemetryViewer/components/TelemetryHistogram.tsx +2 -4
  183. package/UI/Components/TelemetryViewer/components/TelemetryHistogramTooltip.tsx +17 -16
  184. package/UI/Utils/Navigation.ts +42 -0
  185. package/Utils/Array.ts +37 -0
  186. package/Utils/CertificateReissue.ts +128 -0
  187. package/Utils/Grok/Grok.ts +461 -0
  188. package/Utils/Grok/GrokPatterns.ts +118 -0
  189. package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +58 -6
  190. package/build/dist/Models/DatabaseModels/DashboardDomain.js +44 -0
  191. package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -1
  192. package/build/dist/Models/DatabaseModels/Index.js +11 -0
  193. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  194. package/build/dist/Models/DatabaseModels/MonitorTemplate.js +17 -4
  195. package/build/dist/Models/DatabaseModels/MonitorTemplate.js.map +1 -1
  196. package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +44 -0
  197. package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
  198. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js +699 -0
  199. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js.map +1 -0
  200. package/build/dist/Models/DatabaseModels/ProjectOnCallCalendarFeed.js +620 -0
  201. package/build/dist/Models/DatabaseModels/ProjectOnCallCalendarFeed.js.map +1 -0
  202. package/build/dist/Models/DatabaseModels/StatusPageDomain.js +44 -0
  203. package/build/dist/Models/DatabaseModels/StatusPageDomain.js.map +1 -1
  204. package/build/dist/Models/DatabaseModels/UserOnCallCalendarFeed.js +585 -0
  205. package/build/dist/Models/DatabaseModels/UserOnCallCalendarFeed.js.map +1 -0
  206. package/build/dist/Models/DatabaseModels/UserOnCallShiftReminder.js +247 -0
  207. package/build/dist/Models/DatabaseModels/UserOnCallShiftReminder.js.map +1 -0
  208. package/build/dist/Models/DatabaseModels/UserOnCallShiftReminderLog.js +355 -0
  209. package/build/dist/Models/DatabaseModels/UserOnCallShiftReminderLog.js.map +1 -0
  210. package/build/dist/Server/API/DashboardDomainAPI.js +43 -1
  211. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
  212. package/build/dist/Server/API/MicrosoftTeamsAPI.js +74 -118
  213. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  214. package/build/dist/Server/API/OnCallCalendarAPI.js +1371 -0
  215. package/build/dist/Server/API/OnCallCalendarAPI.js.map +1 -0
  216. package/build/dist/Server/API/StatusPageDomainAPI.js +43 -1
  217. package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
  218. package/build/dist/Server/EnvironmentConfig.js +102 -0
  219. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  220. package/build/dist/Server/Infrastructure/OnCallCalendarFeedCache.js +663 -0
  221. package/build/dist/Server/Infrastructure/OnCallCalendarFeedCache.js.map +1 -0
  222. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790200000000-AllowNullMonitorNameOnMonitorTemplate.js +34 -0
  223. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790200000000-AllowNullMonitorNameOnMonitorTemplate.js.map +1 -0
  224. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790300000000-AddCertificateReissueRequestedAtToDomains.js +28 -0
  225. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790300000000-AddCertificateReissueRequestedAtToDomains.js.map +1 -0
  226. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.js +103 -0
  227. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.js.map +1 -0
  228. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
  229. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  230. package/build/dist/Server/Middleware/OnCallCalendarFeedRateLimit.js +342 -0
  231. package/build/dist/Server/Middleware/OnCallCalendarFeedRateLimit.js.map +1 -0
  232. package/build/dist/Server/Middleware/ProjectAuthorization.js +6 -1
  233. package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
  234. package/build/dist/Server/Services/DashboardDomainService.js +104 -0
  235. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
  236. package/build/dist/Server/Services/Index.js +12 -0
  237. package/build/dist/Server/Services/Index.js.map +1 -1
  238. package/build/dist/Server/Services/LogPipelineProcessorService.js +65 -0
  239. package/build/dist/Server/Services/LogPipelineProcessorService.js.map +1 -1
  240. package/build/dist/Server/Services/MonitorTemplateService.js +57 -11
  241. package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
  242. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +20 -0
  243. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
  244. package/build/dist/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.js +219 -0
  245. package/build/dist/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.js.map +1 -0
  246. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js +47 -3
  247. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js.map +1 -1
  248. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js +112 -3
  249. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js.map +1 -1
  250. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +955 -9
  251. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  252. package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +93 -6
  253. package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
  254. package/build/dist/Server/Services/ProjectOnCallCalendarFeedService.js +157 -0
  255. package/build/dist/Server/Services/ProjectOnCallCalendarFeedService.js.map +1 -0
  256. package/build/dist/Server/Services/StatusPageDomainService.js +132 -3
  257. package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
  258. package/build/dist/Server/Services/StatusPagePrivateUserSessionService.js +112 -32
  259. package/build/dist/Server/Services/StatusPagePrivateUserSessionService.js.map +1 -1
  260. package/build/dist/Server/Services/TeamMemberService.js +396 -1
  261. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  262. package/build/dist/Server/Services/TeamService.js +43 -0
  263. package/build/dist/Server/Services/TeamService.js.map +1 -1
  264. package/build/dist/Server/Services/UserNotificationSettingService.js +26 -1
  265. package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
  266. package/build/dist/Server/Services/UserOnCallCalendarFeedService.js +140 -0
  267. package/build/dist/Server/Services/UserOnCallCalendarFeedService.js.map +1 -0
  268. package/build/dist/Server/Services/UserOnCallShiftReminderLogService.js +116 -0
  269. package/build/dist/Server/Services/UserOnCallShiftReminderLogService.js.map +1 -0
  270. package/build/dist/Server/Services/UserOnCallShiftReminderService.js +92 -0
  271. package/build/dist/Server/Services/UserOnCallShiftReminderService.js.map +1 -0
  272. package/build/dist/Server/Types/Domain.js +16 -0
  273. package/build/dist/Server/Types/Domain.js.map +1 -1
  274. package/build/dist/Server/Utils/APIKey/AccessPermission.js +24 -0
  275. package/build/dist/Server/Utils/APIKey/AccessPermission.js.map +1 -1
  276. package/build/dist/Server/Utils/Greenlock/Greenlock.js +110 -35
  277. package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
  278. package/build/dist/Server/Utils/LogPipelineProcessorValidation.js +77 -0
  279. package/build/dist/Server/Utils/LogPipelineProcessorValidation.js.map +1 -0
  280. package/build/dist/Server/Utils/OnCall/CalendarFeedToken.js +161 -0
  281. package/build/dist/Server/Utils/OnCall/CalendarFeedToken.js.map +1 -0
  282. package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedRenderer.js +983 -0
  283. package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedRenderer.js.map +1 -0
  284. package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedUrls.js +155 -0
  285. package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedUrls.js.map +1 -0
  286. package/build/dist/Server/Utils/OnCall/OnCallShiftChangeListeners.js +145 -0
  287. package/build/dist/Server/Utils/OnCall/OnCallShiftChangeListeners.js.map +1 -0
  288. package/build/dist/Server/Utils/OnCall/OnCallShiftMaterializer.js +752 -0
  289. package/build/dist/Server/Utils/OnCall/OnCallShiftMaterializer.js.map +1 -0
  290. package/build/dist/Server/Utils/OnCall/OnCallShiftReminderListener.js +92 -0
  291. package/build/dist/Server/Utils/OnCall/OnCallShiftReminderListener.js.map +1 -0
  292. package/build/dist/Server/Utils/OnCall/OnCallShiftReminderRunner.js +1786 -0
  293. package/build/dist/Server/Utils/OnCall/OnCallShiftReminderRunner.js.map +1 -0
  294. package/build/dist/Server/Utils/Response.js +97 -0
  295. package/build/dist/Server/Utils/Response.js.map +1 -1
  296. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js +777 -36
  297. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js.map +1 -1
  298. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +108 -17
  299. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -1
  300. package/build/dist/Server/Utils/StartServer.js +9 -1
  301. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  302. package/build/dist/Server/Utils/Telemetry/AppMetrics.js +41 -0
  303. package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
  304. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +17 -6
  305. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
  306. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +0 -159
  307. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
  308. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Authorization.js +128 -0
  309. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Authorization.js.map +1 -0
  310. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +17 -6
  311. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
  312. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +25 -13
  313. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  314. package/build/dist/Types/API/Route.js +16 -5
  315. package/build/dist/Types/API/Route.js.map +1 -1
  316. package/build/dist/Types/Calendar/ICalendar.js +290 -0
  317. package/build/dist/Types/Calendar/ICalendar.js.map +1 -0
  318. package/build/dist/Types/Date.js +115 -13
  319. package/build/dist/Types/Date.js.map +1 -1
  320. package/build/dist/Types/Email/EmailTemplateType.js +2 -0
  321. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  322. package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
  323. package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
  324. package/build/dist/Types/OnCallDutyPolicy/CalendarFeedWindow.js +97 -0
  325. package/build/dist/Types/OnCallDutyPolicy/CalendarFeedWindow.js.map +1 -0
  326. package/build/dist/Types/OnCallDutyPolicy/Layer.js +113 -19
  327. package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
  328. package/build/dist/Types/OnCallDutyPolicy/MaterializedShift.js +134 -0
  329. package/build/dist/Types/OnCallDutyPolicy/MaterializedShift.js.map +1 -0
  330. package/build/dist/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.js +800 -0
  331. package/build/dist/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.js.map +1 -0
  332. package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +97 -3
  333. package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
  334. package/build/dist/Types/OnCallDutyPolicy/ShiftSeamUtil.js +77 -0
  335. package/build/dist/Types/OnCallDutyPolicy/ShiftSeamUtil.js.map +1 -0
  336. package/build/dist/Types/Rum/SessionReplay.js +38 -0
  337. package/build/dist/Types/Rum/SessionReplay.js.map +1 -1
  338. package/build/dist/UI/Components/Date/TimeRangePickerDropdown.js +9 -5
  339. package/build/dist/UI/Components/Date/TimeRangePickerDropdown.js.map +1 -1
  340. package/build/dist/UI/Components/LogsViewer/LogsViewer.js +12 -7
  341. package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
  342. package/build/dist/UI/Components/LogsViewer/components/HistogramTooltip.js +15 -14
  343. package/build/dist/UI/Components/LogsViewer/components/HistogramTooltip.js.map +1 -1
  344. package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +17 -22
  345. package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
  346. package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js +2 -4
  347. package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js.map +1 -1
  348. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js +2 -4
  349. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js.map +1 -1
  350. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogramTooltip.js +15 -14
  351. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogramTooltip.js.map +1 -1
  352. package/build/dist/UI/Utils/Navigation.js +30 -0
  353. package/build/dist/UI/Utils/Navigation.js.map +1 -1
  354. package/build/dist/Utils/Array.js +25 -0
  355. package/build/dist/Utils/Array.js.map +1 -1
  356. package/build/dist/Utils/CertificateReissue.js +97 -0
  357. package/build/dist/Utils/CertificateReissue.js.map +1 -0
  358. package/build/dist/Utils/Grok/Grok.js +324 -0
  359. package/build/dist/Utils/Grok/Grok.js.map +1 -0
  360. package/build/dist/Utils/Grok/GrokPatterns.js +112 -0
  361. package/build/dist/Utils/Grok/GrokPatterns.js.map +1 -0
  362. package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +63 -3
  363. package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -1
  364. package/package.json +1 -1
  365. package/UI/Utils/JsonWebToken.ts +0 -14
  366. package/build/dist/UI/Utils/JsonWebToken.js +0 -10
  367. package/build/dist/UI/Utils/JsonWebToken.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../../Types/API/Route.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAE5D,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAc,UAAU,EAAE,MAAM,SAAS,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,gBAAgB;IAEjD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,IAAW,KAAK,CAAC,CAAS;QACxB,MAAM,oBAAoB,GACxB,uCAAuC,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,YAAmB,KAAsB;QACvC,KAAK,EAAE,CAAC;QAdF,WAAM,GAAW,EAAE,CAAC;QAe1B,IAAI,KAAK,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YACpC,KAAK,GAAG,KAAK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AI,WAAW,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;QAC9C,CAAC;QAED,4BAA4B;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC;IACd,CAAC;;AA7HuB,mBAAa,GAAW,0BAA0B,AAArC,CAAsC;eADxD,KAAK"}
@@ -0,0 +1,290 @@
1
+ import BadDataException from "../Exception/BadDataException";
2
+ /*
3
+ * Zero-dependency RFC 5545 (iCalendar) serializer for subscription feeds.
4
+ *
5
+ * Deliberate choices, recorded here because every one of them was a
6
+ * decision, not an omission:
7
+ *
8
+ * - No METHOD. RFC 5546 (iTIP) would require ORGANIZER on a PUBLISH, and
9
+ * subscription feeds are not iTIP messages; Google, Apple and Outlook all
10
+ * treat a METHOD-less VCALENDAR as a plain calendar, which is what we are.
11
+ * - DTSTAMP = the feed input's last-modified instant, not "now". Without
12
+ * METHOD, RFC 5545 §3.8.7.2 reads DTSTAMP as the last revision, and using
13
+ * it makes an unchanged schedule serialize to a byte-identical body so ETags
14
+ * and body caches work.
15
+ * - No VTIMEZONE and no TZID. Every DTSTART/DTEND is an absolute UTC instant
16
+ * ("...Z"). The engine already resolves wall-clock rules into instants, the
17
+ * client converts to the viewer's zone, and shipping a VTIMEZONE database
18
+ * would lag IANA. Wall-clock renderings go in DESCRIPTION instead.
19
+ * - No VALARM (reminders are delivered by OneUptime's own notification path so
20
+ * they honour the user's notification settings), no RRULE (shifts are
21
+ * materialised individually so overrides and rotations never desynchronise),
22
+ * no CLASS (Outlook maps CLASS:PRIVATE to Private sensitivity and Google to
23
+ * private visibility, which blanks a shared team calendar for everyone but
24
+ * its owner), no ORGANIZER/ATTENDEE.
25
+ * - Both REFRESH-INTERVAL;VALUE=DURATION (RFC 7986) and X-PUBLISHED-TTL are
26
+ * emitted from the same duration: classic Outlook honours X-PUBLISHED-TTL
27
+ * when "Update Limit" is on and never refreshes a feed without it.
28
+ * - Property order inside VCALENDAR and VEVENT is fixed so equal inputs give
29
+ * equal bytes.
30
+ *
31
+ * Wire format: CRLF line breaks, content lines folded at 75 octets on UTF-8
32
+ * character boundaries (RFC 5545 §3.1), TEXT values escaped per §3.3.11.
33
+ */
34
+ export const ICALENDAR_LINE_BREAK = "\r\n";
35
+ // RFC 5545 §3.1: lines SHOULD NOT be longer than 75 octets, excluding CRLF.
36
+ export const ICALENDAR_MAX_LINE_OCTETS = 75;
37
+ export const ICALENDAR_VERSION = "2.0";
38
+ export var ICalendarEventStatus;
39
+ (function (ICalendarEventStatus) {
40
+ ICalendarEventStatus["Confirmed"] = "CONFIRMED";
41
+ ICalendarEventStatus["Tentative"] = "TENTATIVE";
42
+ ICalendarEventStatus["Cancelled"] = "CANCELLED";
43
+ })(ICalendarEventStatus || (ICalendarEventStatus = {}));
44
+ export var ICalendarTransparency;
45
+ (function (ICalendarTransparency) {
46
+ ICalendarTransparency["Transparent"] = "TRANSPARENT";
47
+ ICalendarTransparency["Opaque"] = "OPAQUE";
48
+ })(ICalendarTransparency || (ICalendarTransparency = {}));
49
+ const ISO_8601_DURATION_REGEX = /^P(?:\d+W|(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+S)?)?)$/;
50
+ // RFC 5545 §3.2: a parameter value holding any of these must be quoted.
51
+ const RESERVED_PARAMETER_CHARACTERS = /[;:,]/;
52
+ export default class ICalendar {
53
+ static serialize(document) {
54
+ const lines = [];
55
+ lines.push("BEGIN:VCALENDAR");
56
+ lines.push(`VERSION:${ICALENDAR_VERSION}`);
57
+ lines.push(ICalendar.contentLine("PRODID", document.calendar.productId));
58
+ lines.push("CALSCALE:GREGORIAN");
59
+ const calendar = document.calendar;
60
+ if (calendar.name !== undefined && calendar.name !== "") {
61
+ lines.push(ICalendar.textLine("NAME", calendar.name));
62
+ }
63
+ const displayName = calendar.displayName !== undefined && calendar.displayName !== ""
64
+ ? calendar.displayName
65
+ : calendar.name;
66
+ if (displayName !== undefined && displayName !== "") {
67
+ lines.push(ICalendar.textLine("X-WR-CALNAME", displayName));
68
+ }
69
+ if (calendar.description !== undefined && calendar.description !== "") {
70
+ lines.push(ICalendar.textLine("X-WR-CALDESC", calendar.description));
71
+ }
72
+ if (calendar.timezone !== undefined && calendar.timezone !== "") {
73
+ lines.push(ICalendar.textLine("X-WR-TIMEZONE", calendar.timezone));
74
+ }
75
+ if (calendar.refreshInterval !== undefined) {
76
+ const duration = ICalendar.validateDuration(calendar.refreshInterval);
77
+ lines.push(ICalendar.contentLine("REFRESH-INTERVAL", duration, {
78
+ VALUE: "DURATION",
79
+ }));
80
+ lines.push(ICalendar.contentLine("X-PUBLISHED-TTL", duration));
81
+ }
82
+ if (calendar.lastModified !== undefined) {
83
+ lines.push(ICalendar.contentLine("LAST-MODIFIED", ICalendar.formatUtcDateTime(calendar.lastModified)));
84
+ }
85
+ for (const event of document.events) {
86
+ lines.push(...ICalendar.serializeEvent(event));
87
+ }
88
+ lines.push("END:VCALENDAR");
89
+ return (lines
90
+ .map((line) => {
91
+ return ICalendar.foldLine(line);
92
+ })
93
+ .join(ICALENDAR_LINE_BREAK) + ICALENDAR_LINE_BREAK);
94
+ }
95
+ /*
96
+ * The unfolded content lines of one VEVENT, in the fixed order. Exposed so
97
+ * tests and callers can inspect a single event without a whole document.
98
+ */
99
+ static serializeEvent(event) {
100
+ if (!event.uid || event.uid.trim() === "") {
101
+ throw new BadDataException("iCalendar event UID must not be empty");
102
+ }
103
+ if (event.end.getTime() <= event.start.getTime()) {
104
+ throw new BadDataException(`iCalendar event ${event.uid} must end after it starts`);
105
+ }
106
+ const lines = [];
107
+ lines.push("BEGIN:VEVENT");
108
+ lines.push(ICalendar.textLine("UID", event.uid));
109
+ lines.push(ICalendar.contentLine("DTSTAMP", ICalendar.formatUtcDateTime(event.dtStamp)));
110
+ if (event.lastModified !== undefined) {
111
+ lines.push(ICalendar.contentLine("LAST-MODIFIED", ICalendar.formatUtcDateTime(event.lastModified)));
112
+ }
113
+ if (event.sequence !== undefined) {
114
+ lines.push(ICalendar.contentLine("SEQUENCE", String(ICalendar.validateSequence(event.sequence))));
115
+ }
116
+ lines.push(ICalendar.contentLine("DTSTART", ICalendar.formatUtcDateTime(event.start)));
117
+ lines.push(ICalendar.contentLine("DTEND", ICalendar.formatUtcDateTime(event.end)));
118
+ lines.push(ICalendar.textLine("SUMMARY", event.summary));
119
+ if (event.description !== undefined && event.description !== "") {
120
+ lines.push(ICalendar.textLine("DESCRIPTION", event.description));
121
+ }
122
+ if (event.location !== undefined && event.location !== "") {
123
+ lines.push(ICalendar.textLine("LOCATION", event.location));
124
+ }
125
+ if (event.url !== undefined && event.url !== "") {
126
+ // URI value type: not TEXT-escaped, but never allowed to break the line.
127
+ lines.push(ICalendar.contentLine("URL", ICalendar.stripLineBreaks(event.url)));
128
+ }
129
+ if (event.status !== undefined) {
130
+ lines.push(ICalendar.contentLine("STATUS", event.status));
131
+ }
132
+ if (event.transparency !== undefined) {
133
+ lines.push(ICalendar.contentLine("TRANSP", event.transparency));
134
+ }
135
+ if (event.categories !== undefined && event.categories.length > 0) {
136
+ lines.push(ICalendar.contentLine("CATEGORIES", event.categories
137
+ .map((category) => {
138
+ return ICalendar.escapeText(category);
139
+ })
140
+ .join(",")));
141
+ }
142
+ lines.push("END:VEVENT");
143
+ return lines;
144
+ }
145
+ /*
146
+ * RFC 5545 §3.3.11 TEXT escaping: backslash, semicolon and comma are
147
+ * escaped; a newline becomes the two characters "\n"; carriage returns and
148
+ * other control characters (which TEXT may not contain) are dropped.
149
+ */
150
+ static escapeText(text) {
151
+ let result = "";
152
+ for (const char of text) {
153
+ if (char === "\\") {
154
+ result += "\\\\";
155
+ }
156
+ else if (char === ";") {
157
+ result += "\\;";
158
+ }
159
+ else if (char === ",") {
160
+ result += "\\,";
161
+ }
162
+ else if (char === "\n") {
163
+ result += "\\n";
164
+ }
165
+ else if (char === "\t") {
166
+ result += char;
167
+ }
168
+ else if (ICalendar.isControlCharacter(char)) {
169
+ continue;
170
+ }
171
+ else {
172
+ result += char;
173
+ }
174
+ }
175
+ return result;
176
+ }
177
+ // "YYYYMMDDTHHMMSSZ" — RFC 5545 §3.3.5 form #2, UTC.
178
+ static formatUtcDateTime(date) {
179
+ if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
180
+ throw new BadDataException("iCalendar date is not a valid Date");
181
+ }
182
+ const pad = (value) => {
183
+ return value < 10 ? `0${value}` : String(value);
184
+ };
185
+ return (`${date.getUTCFullYear()}${pad(date.getUTCMonth() + 1)}${pad(date.getUTCDate())}` +
186
+ `T${pad(date.getUTCHours())}${pad(date.getUTCMinutes())}${pad(date.getUTCSeconds())}Z`);
187
+ }
188
+ /*
189
+ * Fold one logical content line at 75 octets (RFC 5545 §3.1). The
190
+ * continuation lines start with a single space that counts toward their
191
+ * own 75-octet budget. Never splits inside a UTF-8 multi-byte sequence:
192
+ * the walk is per code point and each code point's octet length is known.
193
+ */
194
+ static foldLine(line) {
195
+ if (ICalendar.getUtf8OctetLength(line) <= ICALENDAR_MAX_LINE_OCTETS) {
196
+ return line;
197
+ }
198
+ const pieces = [];
199
+ let current = "";
200
+ let currentOctets = 0;
201
+ // The first physical line has the full budget; continuations lose one to the leading space.
202
+ let budget = ICALENDAR_MAX_LINE_OCTETS;
203
+ for (const char of line) {
204
+ const octets = ICalendar.getUtf8OctetLength(char);
205
+ if (currentOctets + octets > budget) {
206
+ pieces.push(current);
207
+ current = "";
208
+ currentOctets = 0;
209
+ budget = ICALENDAR_MAX_LINE_OCTETS - 1;
210
+ }
211
+ current += char;
212
+ currentOctets += octets;
213
+ }
214
+ if (current !== "") {
215
+ pieces.push(current);
216
+ }
217
+ return pieces.join(`${ICALENDAR_LINE_BREAK} `);
218
+ }
219
+ // Reverse of foldLine, for tests and readers: joins continuation lines.
220
+ static unfold(body) {
221
+ return body.replace(/\r\n[ \t]/g, "");
222
+ }
223
+ static getUtf8OctetLength(text) {
224
+ var _a;
225
+ let octets = 0;
226
+ for (const char of text) {
227
+ const codePoint = (_a = char.codePointAt(0)) !== null && _a !== void 0 ? _a : 0;
228
+ if (codePoint < 0x80) {
229
+ octets += 1;
230
+ }
231
+ else if (codePoint < 0x800) {
232
+ octets += 2;
233
+ }
234
+ else if (codePoint < 0x10000) {
235
+ octets += 3;
236
+ }
237
+ else {
238
+ octets += 4;
239
+ }
240
+ }
241
+ return octets;
242
+ }
243
+ /*
244
+ * "NAME;PARAM=value:value" with the value used verbatim (callers escape
245
+ * TEXT values themselves or use textLine). Parameter values that contain
246
+ * characters RFC 5545 §3.2 reserves are quoted; double quotes inside them
247
+ * are dropped because there is no way to escape them.
248
+ */
249
+ static contentLine(name, value, parameters) {
250
+ var _a;
251
+ let line = name.toUpperCase();
252
+ if (parameters) {
253
+ for (const parameterName of Object.keys(parameters)) {
254
+ const rawValue = ((_a = parameters[parameterName]) !== null && _a !== void 0 ? _a : "").replace(/"/g, "");
255
+ const needsQuotes = RESERVED_PARAMETER_CHARACTERS.test(rawValue);
256
+ line += `;${parameterName.toUpperCase()}=${needsQuotes ? `"${rawValue}"` : rawValue}`;
257
+ }
258
+ }
259
+ return `${line}:${ICalendar.stripLineBreaks(value)}`;
260
+ }
261
+ // A TEXT property: the value is escaped per §3.3.11.
262
+ static textLine(name, value) {
263
+ return ICalendar.contentLine(name, ICalendar.escapeText(value));
264
+ }
265
+ static validateDuration(duration) {
266
+ const trimmed = duration.trim().toUpperCase();
267
+ if (!ISO_8601_DURATION_REGEX.test(trimmed) ||
268
+ trimmed === "P" ||
269
+ trimmed === "PT") {
270
+ throw new BadDataException(`iCalendar refresh interval must be an ISO 8601 duration, got "${duration}"`);
271
+ }
272
+ return trimmed;
273
+ }
274
+ static validateSequence(sequence) {
275
+ if (!Number.isInteger(sequence) || sequence < 0) {
276
+ throw new BadDataException(`iCalendar SEQUENCE must be a non-negative integer, got ${sequence}`);
277
+ }
278
+ return sequence;
279
+ }
280
+ static isControlCharacter(char) {
281
+ var _a;
282
+ const codePoint = (_a = char.codePointAt(0)) !== null && _a !== void 0 ? _a : 0;
283
+ return codePoint < 0x20 || codePoint === 0x7f;
284
+ }
285
+ // Line breaks can never appear inside a content line, whatever the value type.
286
+ static stripLineBreaks(value) {
287
+ return value.replace(/[\r\n]+/g, "");
288
+ }
289
+ }
290
+ //# sourceMappingURL=ICalendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICalendar.js","sourceRoot":"","sources":["../../../../Types/Calendar/ICalendar.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAW,MAAM,CAAC;AAEnD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAW,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAW,KAAK,CAAC;AAE/C,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,+CAAuB,CAAA;IACvB,+CAAuB,CAAA;AACzB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oDAA2B,CAAA;IAC3B,0CAAiB,CAAA;AACnB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AA0CD,MAAM,uBAAuB,GAC3B,wDAAwD,CAAC;AAE3D,wEAAwE;AACxE,MAAM,6BAA6B,GAAW,OAAO,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,SAAS;IACrB,MAAM,CAAC,SAAS,CAAC,QAA2B;QACjD,MAAM,KAAK,GAAkB,EAAE,CAAC;QAEhC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QA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AI,CAAC,WAAW,CAAC,CAAC,CAAC,mCAAI,CAAC,CAAC;QACnD,OAAO,SAAS,GAAG,IAAI,IAAI,SAAS,KAAK,IAAI,CAAC;IAChD,CAAC;IAED,+EAA+E;IACvE,MAAM,CAAC,eAAe,CAAC,KAAa;QAC1C,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -135,22 +135,36 @@ class OneUptimeDate {
135
135
  date = this.fromString(date);
136
136
  return this.getLocalShortMonthName(date);
137
137
  }
138
+ /**
139
+ * The wall clock `date` reads at in the current timezone - "14:30", or
140
+ * "2:30 PM" when the caller asks for a 12-hour clock.
141
+ *
142
+ * `use12HourFormat` is opt-in rather than defaulted to
143
+ * `getUserPrefers12HourFormat()`: the chart x-axes in
144
+ * UI/Components/Charts/Utils/XAxis.ts label ticks with this and are laid out
145
+ * for the fixed width of a 24-hour reading, so they must keep the clock they
146
+ * were built against. Surfaces that show a person a timestamp - histogram
147
+ * ticks and tooltips, span rows - pass
148
+ * `use12HourFormat: OneUptimeDate.getUserPrefers12HourFormat()` explicitly.
149
+ */
138
150
  static getLocalTimeString(date, options) {
139
- var _a, _b;
151
+ var _a, _b, _c;
140
152
  date = this.fromString(date);
141
153
  const includeMinutes = (_a = options === null || options === void 0 ? void 0 : options.includeMinutes) !== null && _a !== void 0 ? _a : true;
142
154
  const includeSeconds = (_b = options === null || options === void 0 ? void 0 : options.includeSeconds) !== null && _b !== void 0 ? _b : false;
143
- const localDate = this.inCurrentTimezone(date);
144
- const hours = this.padDatePart(localDate.hours());
145
- if (!includeMinutes) {
146
- return hours;
155
+ const use12HourFormat = (_c = options === null || options === void 0 ? void 0 : options.use12HourFormat) !== null && _c !== void 0 ? _c : false;
156
+ // "HH" and "h" are the zero-padded 24-hour and the bare 12-hour readings.
157
+ let timeFormat = use12HourFormat ? "h" : "HH";
158
+ if (includeMinutes) {
159
+ timeFormat += ":mm";
160
+ if (includeSeconds) {
161
+ timeFormat += ":ss";
162
+ }
147
163
  }
148
- const minutes = this.padDatePart(localDate.minutes());
149
- if (!includeSeconds) {
150
- return `${hours}:${minutes}`;
164
+ if (use12HourFormat) {
165
+ timeFormat += " A";
151
166
  }
152
- const seconds = this.padDatePart(localDate.seconds());
153
- return `${hours}:${minutes}:${seconds}`;
167
+ return this.inCurrentTimezone(date).format(timeFormat);
154
168
  }
155
169
  static getDateAsLocalDayMonthString(date) {
156
170
  date = this.fromString(date);
@@ -162,6 +176,29 @@ class OneUptimeDate {
162
176
  date = this.fromString(date);
163
177
  return `${this.getDateAsLocalDayMonthString(date)}, ${this.getLocalTimeString(date, { includeMinutes: false })}:00`;
164
178
  }
179
+ /**
180
+ * A compact "Mar 1, 14:30" (or "Mar 1, 2:30 PM") label for one instant, used
181
+ * where a whole window has to fit on a button - the time range picker above
182
+ * the metrics, traces and logs explorers, chiefly.
183
+ *
184
+ * Both halves follow the user's machine: the wall clock is resolved in the
185
+ * configured timezone (falling back to the one the browser reports), and the
186
+ * 12- vs 24-hour choice follows the operating system's clock preference
187
+ * unless a caller overrides it.
188
+ */
189
+ static getDateAsLocalShortDateTimeString(date, options) {
190
+ var _a;
191
+ date = this.fromString(date);
192
+ const use12HourFormat = (_a = options === null || options === void 0 ? void 0 : options.use12HourFormat) !== null && _a !== void 0 ? _a : this.getUserPrefers12HourFormat();
193
+ let timeFormat = use12HourFormat ? "h:mm" : "HH:mm";
194
+ if (options === null || options === void 0 ? void 0 : options.includeSeconds) {
195
+ timeFormat += ":ss";
196
+ }
197
+ if (use12HourFormat) {
198
+ timeFormat += " A";
199
+ }
200
+ return this.inCurrentTimezone(date).format(`MMM D, ${timeFormat}`);
201
+ }
165
202
  static getDateAsLocalMonthYearString(date) {
166
203
  date = this.fromString(date);
167
204
  const month = this.getLocalShortMonthName(date);
@@ -595,6 +632,18 @@ class OneUptimeDate {
595
632
  date2 = this.fromString(date2);
596
633
  return moment(date1).isSame(date2, "day");
597
634
  }
635
+ /**
636
+ * Whether the two instants fall on the same calendar day *in the current
637
+ * timezone*, which is the question a UI is asking when it decides whether a
638
+ * timestamp needs its date spelled out or a bare clock reading will do.
639
+ *
640
+ * `areOnTheSameDay` above answers it in the zone the process happens to run
641
+ * in. Near midnight those two zones disagree, so asking the wrong one drops
642
+ * the date from yesterday's buckets and adds it to today's.
643
+ */
644
+ static areOnTheSameLocalDay(date1, date2) {
645
+ return this.inCurrentTimezone(date1).isSame(this.inCurrentTimezone(date2), "day");
646
+ }
598
647
  static areOnTheSameMonth(date1, date2) {
599
648
  date1 = this.fromString(date1);
600
649
  date2 = this.fromString(date2);
@@ -1034,14 +1083,67 @@ class OneUptimeDate {
1034
1083
  static getCurrentDateAsFormattedString(options) {
1035
1084
  return this.getDateAsFormattedString(new Date(), options);
1036
1085
  }
1086
+ /**
1087
+ * Whether the machine this is running on writes the time of day on a 12-hour
1088
+ * clock, read from the browser's resolved default locale - which browsers
1089
+ * derive from the operating system's language and region, so changing those
1090
+ * changes this. An explicit -u-hc- override on the locale is honoured too.
1091
+ *
1092
+ * Note what this cannot see: the standalone "24-Hour Time" switch macOS and
1093
+ * Windows offer separately from the region. Safari and recent Firefox fold
1094
+ * that into the locale they resolve; Chromium does not. A user who wants a
1095
+ * clock that ignores their region would need an explicit preference stored
1096
+ * alongside the timezone in User Settings - there is none today.
1097
+ *
1098
+ * Asked of Intl rather than inferred from a formatted string. The string
1099
+ * probe below only recognises the Latin "AM"/"PM", so it misread every
1100
+ * 12-hour locale that marks the day period some other way - ko-KR writes
1101
+ * the equivalent of "PM" in Hangul, ar-EG in Arabic script - and served
1102
+ * those users a 24-hour clock against their own convention.
1103
+ */
1037
1104
  static getUserPrefers12HourFormat() {
1038
1105
  if (typeof window === "undefined") {
1039
1106
  // Server-side: default to 12-hour format for user-friendly display
1040
1107
  return true;
1041
1108
  }
1042
- // Client-side: detect user's preferred time format from browser locale
1043
- const testDate = new Date();
1044
- const timeString = testDate.toLocaleTimeString();
1109
+ /*
1110
+ * `hour12` is only reported when the format actually asks for an hour, so
1111
+ * the probe has to request one.
1112
+ */
1113
+ try {
1114
+ /*
1115
+ * Typed structurally rather than as Intl.ResolvedDateTimeFormatOptions:
1116
+ * `hourCycle` only appears on that interface from the ES2021 lib, and
1117
+ * this file has to compile against the older one too.
1118
+ */
1119
+ const resolvedOptions = new Intl.DateTimeFormat(undefined, {
1120
+ hour: "numeric",
1121
+ }).resolvedOptions();
1122
+ if (typeof resolvedOptions.hour12 === "boolean") {
1123
+ return resolvedOptions.hour12;
1124
+ }
1125
+ /*
1126
+ * Older engines report the cycle but not the boolean. h11/h12 are the
1127
+ * two 12-hour cycles; h23/h24 are the 24-hour ones.
1128
+ */
1129
+ if (resolvedOptions.hourCycle) {
1130
+ return (resolvedOptions.hourCycle === "h11" ||
1131
+ resolvedOptions.hourCycle === "h12");
1132
+ }
1133
+ }
1134
+ catch (_a) {
1135
+ /*
1136
+ * A missing or broken Intl must not take every timestamp in the UI down
1137
+ * with it - fall through to the string probe below.
1138
+ */
1139
+ }
1140
+ /*
1141
+ * Last resort: read a formatted time and look for a day-period marker.
1142
+ * This only recognises the Latin "AM"/"PM" - which is exactly why it is the
1143
+ * fallback and not the primary check, since locales like ko-KR and ar-EG
1144
+ * are 12-hour but mark the day period with characters this cannot see.
1145
+ */
1146
+ const timeString = new Date().toLocaleTimeString();
1045
1147
  return (timeString.toLowerCase().includes("am") ||
1046
1148
  timeString.toLowerCase().includes("pm"));
1047
1149
  }