@oneuptime/common 10.0.52 → 10.0.54

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 (405) hide show
  1. package/Models/AnalyticsModels/Metric.ts +78 -0
  2. package/Server/API/AIAgentDataAPI.ts +6 -1
  3. package/Server/API/BillingAPI.ts +28 -6
  4. package/Server/API/CommonAPI.ts +11 -0
  5. package/Server/API/DashboardAPI.ts +6 -2
  6. package/Server/API/DashboardDomainAPI.ts +10 -3
  7. package/Server/API/GitHubAPI.ts +58 -14
  8. package/Server/API/MicrosoftTeamsAPI.ts +97 -33
  9. package/Server/API/OpenSourceDeploymentAPI.ts +2 -2
  10. package/Server/API/SlackAPI.ts +107 -36
  11. package/Server/API/StatusAPI.ts +37 -16
  12. package/Server/API/StatusPageAPI.ts +97 -23
  13. package/Server/API/StatusPageDomainAPI.ts +6 -3
  14. package/Server/API/TelemetryAPI.ts +81 -0
  15. package/Server/API/UserAPI.ts +3 -3
  16. package/Server/API/UserCallAPI.ts +5 -2
  17. package/Server/API/UserEmailAPI.ts +5 -2
  18. package/Server/API/UserPushAPI.ts +9 -3
  19. package/Server/API/UserSmsAPI.ts +5 -2
  20. package/Server/API/UserWhatsAppAPI.ts +5 -2
  21. package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.ts +47 -0
  22. package/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.ts +35 -0
  23. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  24. package/Server/Middleware/NotificationMiddleware.ts +2 -2
  25. package/Server/Middleware/ProjectAuthorization.ts +6 -0
  26. package/Server/Middleware/SCIMAuthorization.ts +2 -1
  27. package/Server/Middleware/SlackAuthorization.ts +28 -10
  28. package/Server/Middleware/TelemetryIngest.ts +16 -3
  29. package/Server/Middleware/UserAuthorization.ts +22 -5
  30. package/Server/Middleware/WhatsAppAuthorization.ts +15 -4
  31. package/Server/Services/AIAgentService.ts +13 -6
  32. package/Server/Services/AIService.ts +9 -3
  33. package/Server/Services/AlertEpisodeFeedService.ts +17 -5
  34. package/Server/Services/AlertEpisodeService.ts +34 -3
  35. package/Server/Services/AlertEpisodeStateTimelineService.ts +80 -22
  36. package/Server/Services/AlertFeedService.ts +17 -5
  37. package/Server/Services/AlertGroupingEngineService.ts +36 -7
  38. package/Server/Services/AlertService.ts +60 -8
  39. package/Server/Services/AlertStateTimelineService.ts +29 -7
  40. package/Server/Services/AnalyticsDatabaseService.ts +59 -25
  41. package/Server/Services/BillingInvoiceService.ts +7 -3
  42. package/Server/Services/BillingService.ts +9 -2
  43. package/Server/Services/DashboardDomainService.ts +56 -22
  44. package/Server/Services/DashboardService.ts +11 -4
  45. package/Server/Services/DatabaseService.ts +31 -11
  46. package/Server/Services/IncidentEpisodeFeedService.ts +17 -5
  47. package/Server/Services/IncidentEpisodeService.ts +34 -3
  48. package/Server/Services/IncidentEpisodeStateTimelineService.ts +80 -22
  49. package/Server/Services/IncidentFeedService.ts +33 -9
  50. package/Server/Services/IncidentGroupingEngineService.ts +35 -6
  51. package/Server/Services/IncidentService.ts +103 -9
  52. package/Server/Services/IncidentSlaRuleService.ts +16 -4
  53. package/Server/Services/IncidentSlaService.ts +20 -4
  54. package/Server/Services/IncidentStateTimelineService.ts +120 -31
  55. package/Server/Services/KubernetesClusterService.ts +62 -14
  56. package/Server/Services/LabelService.ts +14 -1
  57. package/Server/Services/MonitorFeedService.ts +33 -9
  58. package/Server/Services/MonitorProbeService.ts +31 -2
  59. package/Server/Services/MonitorService.ts +35 -4
  60. package/Server/Services/MonitorStatusTimelineService.ts +68 -20
  61. package/Server/Services/NotificationService.ts +4 -2
  62. package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +53 -9
  63. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +9 -2
  64. package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +29 -8
  65. package/Server/Services/OnCallDutyPolicyFeedService.ts +33 -8
  66. package/Server/Services/OnCallDutyPolicyScheduleService.ts +97 -24
  67. package/Server/Services/OnCallDutyPolicyService.ts +2 -1
  68. package/Server/Services/OpenTelemetryIngestService.ts +51 -20
  69. package/Server/Services/ProbeService.ts +16 -7
  70. package/Server/Services/ProjectService.ts +29 -11
  71. package/Server/Services/ScheduledMaintenanceFeedService.ts +17 -4
  72. package/Server/Services/ScheduledMaintenanceService.ts +52 -6
  73. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +72 -20
  74. package/Server/Services/StatusPageDomainService.ts +59 -23
  75. package/Server/Services/StatusPageService.ts +26 -8
  76. package/Server/Services/StatusPageSubscriberService.ts +382 -111
  77. package/Server/Services/TeamMemberService.ts +9 -3
  78. package/Server/Services/TelemetryAttributeService.ts +117 -4
  79. package/Server/Services/UserNotificationRuleService.ts +9 -3
  80. package/Server/Services/UserService.ts +6 -4
  81. package/Server/Services/UserWhatsAppService.ts +9 -3
  82. package/Server/Services/WorkflowService.ts +7 -3
  83. package/Server/Services/WorkspaceNotificationRuleService.ts +398 -156
  84. package/Server/Types/Domain.ts +15 -5
  85. package/Server/Types/Workflow/Components/API/Post.ts +22 -8
  86. package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +12 -4
  87. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +10 -0
  88. package/Server/Utils/CodeRepository/CodeRepository.ts +62 -13
  89. package/Server/Utils/Express.ts +1 -0
  90. package/Server/Utils/Greenlock/Greenlock.ts +75 -20
  91. package/Server/Utils/LLM/LLMService.ts +22 -7
  92. package/Server/Utils/Logger.ts +93 -13
  93. package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
  94. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -5
  95. package/Server/Utils/Monitor/MonitorIncident.ts +17 -3
  96. package/Server/Utils/Monitor/MonitorStatusTimeline.ts +6 -1
  97. package/Server/Utils/Profiling.ts +11 -5
  98. package/Server/Utils/Realtime.ts +90 -31
  99. package/Server/Utils/Response.ts +2 -2
  100. package/Server/Utils/StartServer.ts +43 -9
  101. package/Server/Utils/Telemetry/SpanUtil.ts +90 -0
  102. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +58 -15
  103. package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +58 -15
  104. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +19 -3
  105. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +87 -22
  106. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +12 -3
  107. package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +25 -7
  108. package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +55 -8
  109. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +100 -22
  110. package/Server/Utils/Workspace/Slack/Actions/Alert.ts +35 -9
  111. package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +32 -8
  112. package/Server/Utils/Workspace/Slack/Actions/Auth.ts +3 -1
  113. package/Server/Utils/Workspace/Slack/Actions/Incident.ts +52 -11
  114. package/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.ts +4 -1
  115. package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +89 -20
  116. package/Server/Utils/Workspace/Slack/Slack.ts +498 -247
  117. package/Server/Utils/Workspace/Workspace.ts +33 -11
  118. package/Server/Utils/Workspace/WorkspaceBase.ts +3 -1
  119. package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +8 -2
  120. package/Tests/Server/Middleware/UserAuthorization.test.ts +1 -1
  121. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +12 -3
  122. package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +60 -38
  123. package/UI/Components/Charts/Area/AreaChart.tsx +35 -1
  124. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +7 -0
  125. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +33 -0
  126. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +33 -0
  127. package/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.ts +14 -0
  128. package/UI/Components/Charts/Line/LineChart.tsx +35 -1
  129. package/UI/Components/Charts/Types/ExemplarPoint.ts +6 -0
  130. package/UI/Components/Dictionary/Dictionary.tsx +13 -1
  131. package/UI/Components/Filters/FiltersForm.tsx +2 -0
  132. package/UI/Components/Filters/JSONFilter.tsx +5 -1
  133. package/UI/Components/Filters/Types/Filter.ts +2 -0
  134. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
  135. package/UI/Components/ModelTable/BaseModelTable.tsx +10 -6
  136. package/UI/Components/Navbar/NavBar.tsx +10 -0
  137. package/build/dist/Models/AnalyticsModels/Metric.js +70 -0
  138. package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
  139. package/build/dist/Server/API/AIAgentDataAPI.js +6 -6
  140. package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
  141. package/build/dist/Server/API/BillingAPI.js +13 -13
  142. package/build/dist/Server/API/BillingAPI.js.map +1 -1
  143. package/build/dist/Server/API/CommonAPI.js +5 -0
  144. package/build/dist/Server/API/CommonAPI.js.map +1 -1
  145. package/build/dist/Server/API/DashboardAPI.js +2 -2
  146. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  147. package/build/dist/Server/API/DashboardDomainAPI.js +3 -3
  148. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
  149. package/build/dist/Server/API/GitHubAPI.js +19 -19
  150. package/build/dist/Server/API/GitHubAPI.js.map +1 -1
  151. package/build/dist/Server/API/MicrosoftTeamsAPI.js +34 -34
  152. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  153. package/build/dist/Server/API/OpenSourceDeploymentAPI.js +2 -2
  154. package/build/dist/Server/API/OpenSourceDeploymentAPI.js.map +1 -1
  155. package/build/dist/Server/API/SlackAPI.js +38 -38
  156. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  157. package/build/dist/Server/API/StatusAPI.js +16 -16
  158. package/build/dist/Server/API/StatusAPI.js.map +1 -1
  159. package/build/dist/Server/API/StatusPageAPI.js +52 -52
  160. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  161. package/build/dist/Server/API/StatusPageDomainAPI.js +3 -3
  162. package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
  163. package/build/dist/Server/API/TelemetryAPI.js +39 -0
  164. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  165. package/build/dist/Server/API/UserAPI.js +3 -3
  166. package/build/dist/Server/API/UserAPI.js.map +1 -1
  167. package/build/dist/Server/API/UserCallAPI.js +2 -2
  168. package/build/dist/Server/API/UserCallAPI.js.map +1 -1
  169. package/build/dist/Server/API/UserEmailAPI.js +2 -2
  170. package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
  171. package/build/dist/Server/API/UserPushAPI.js +3 -3
  172. package/build/dist/Server/API/UserPushAPI.js.map +1 -1
  173. package/build/dist/Server/API/UserSmsAPI.js +2 -2
  174. package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
  175. package/build/dist/Server/API/UserWhatsAppAPI.js +2 -2
  176. package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
  177. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js +40 -0
  178. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js.map +1 -0
  179. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js +18 -0
  180. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js.map +1 -0
  181. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  182. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  183. package/build/dist/Server/Middleware/NotificationMiddleware.js +2 -2
  184. package/build/dist/Server/Middleware/NotificationMiddleware.js.map +1 -1
  185. package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -0
  186. package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
  187. package/build/dist/Server/Middleware/SCIMAuthorization.js +2 -2
  188. package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
  189. package/build/dist/Server/Middleware/SlackAuthorization.js +10 -10
  190. package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
  191. package/build/dist/Server/Middleware/TelemetryIngest.js +9 -4
  192. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  193. package/build/dist/Server/Middleware/UserAuthorization.js +10 -5
  194. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  195. package/build/dist/Server/Middleware/WhatsAppAuthorization.js +6 -6
  196. package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
  197. package/build/dist/Server/Services/AIAgentService.js +13 -7
  198. package/build/dist/Server/Services/AIAgentService.js.map +1 -1
  199. package/build/dist/Server/Services/AIService.js +9 -2
  200. package/build/dist/Server/Services/AIService.js.map +1 -1
  201. package/build/dist/Server/Services/AlertEpisodeFeedService.js +17 -5
  202. package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -1
  203. package/build/dist/Server/Services/AlertEpisodeService.js +40 -10
  204. package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
  205. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +81 -24
  206. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
  207. package/build/dist/Server/Services/AlertFeedService.js +17 -5
  208. package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
  209. package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -28
  210. package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
  211. package/build/dist/Server/Services/AlertService.js +72 -20
  212. package/build/dist/Server/Services/AlertService.js.map +1 -1
  213. package/build/dist/Server/Services/AlertStateTimelineService.js +36 -13
  214. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  215. package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -28
  216. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  217. package/build/dist/Server/Services/BillingInvoiceService.js +7 -2
  218. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  219. package/build/dist/Server/Services/BillingService.js +8 -8
  220. package/build/dist/Server/Services/BillingService.js.map +1 -1
  221. package/build/dist/Server/Services/DashboardDomainService.js +49 -27
  222. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
  223. package/build/dist/Server/Services/DashboardService.js +11 -4
  224. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  225. package/build/dist/Server/Services/DatabaseService.js +32 -12
  226. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  227. package/build/dist/Server/Services/IncidentEpisodeFeedService.js +17 -5
  228. package/build/dist/Server/Services/IncidentEpisodeFeedService.js.map +1 -1
  229. package/build/dist/Server/Services/IncidentEpisodeService.js +40 -10
  230. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  231. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +81 -24
  232. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
  233. package/build/dist/Server/Services/IncidentFeedService.js +34 -10
  234. package/build/dist/Server/Services/IncidentFeedService.js.map +1 -1
  235. package/build/dist/Server/Services/IncidentGroupingEngineService.js +43 -29
  236. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  237. package/build/dist/Server/Services/IncidentService.js +116 -28
  238. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  239. package/build/dist/Server/Services/IncidentSlaRuleService.js +19 -11
  240. package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
  241. package/build/dist/Server/Services/IncidentSlaService.js +21 -14
  242. package/build/dist/Server/Services/IncidentSlaService.js.map +1 -1
  243. package/build/dist/Server/Services/IncidentStateTimelineService.js +130 -37
  244. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  245. package/build/dist/Server/Services/KubernetesClusterService.js +51 -14
  246. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  247. package/build/dist/Server/Services/LabelService.js +10 -1
  248. package/build/dist/Server/Services/LabelService.js.map +1 -1
  249. package/build/dist/Server/Services/MonitorFeedService.js +34 -10
  250. package/build/dist/Server/Services/MonitorFeedService.js.map +1 -1
  251. package/build/dist/Server/Services/MonitorProbeService.js +23 -3
  252. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  253. package/build/dist/Server/Services/MonitorService.js +42 -11
  254. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  255. package/build/dist/Server/Services/MonitorStatusTimelineService.js +69 -21
  256. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  257. package/build/dist/Server/Services/NotificationService.js +4 -3
  258. package/build/dist/Server/Services/NotificationService.js.map +1 -1
  259. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +49 -12
  260. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
  261. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +9 -3
  262. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  263. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +26 -11
  264. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
  265. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +34 -10
  266. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
  267. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +94 -37
  268. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  269. package/build/dist/Server/Services/OnCallDutyPolicyService.js +1 -1
  270. package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
  271. package/build/dist/Server/Services/OpenTelemetryIngestService.js +45 -17
  272. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  273. package/build/dist/Server/Services/ProbeService.js +13 -7
  274. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  275. package/build/dist/Server/Services/ProjectService.js +41 -21
  276. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  277. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +17 -5
  278. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
  279. package/build/dist/Server/Services/ScheduledMaintenanceService.js +71 -24
  280. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  281. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +72 -24
  282. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  283. package/build/dist/Server/Services/StatusPageDomainService.js +55 -29
  284. package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
  285. package/build/dist/Server/Services/StatusPageService.js +29 -9
  286. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  287. package/build/dist/Server/Services/StatusPageSubscriberService.js +393 -130
  288. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  289. package/build/dist/Server/Services/TeamMemberService.js +10 -2
  290. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  291. package/build/dist/Server/Services/TelemetryAttributeService.js +83 -6
  292. package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
  293. package/build/dist/Server/Services/UserNotificationRuleService.js +10 -2
  294. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  295. package/build/dist/Server/Services/UserService.js +8 -3
  296. package/build/dist/Server/Services/UserService.js.map +1 -1
  297. package/build/dist/Server/Services/UserWhatsAppService.js +10 -2
  298. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
  299. package/build/dist/Server/Services/WorkflowService.js +7 -2
  300. package/build/dist/Server/Services/WorkflowService.js.map +1 -1
  301. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +367 -180
  302. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
  303. package/build/dist/Server/Types/Domain.js +12 -6
  304. package/build/dist/Server/Types/Domain.js.map +1 -1
  305. package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -7
  306. package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
  307. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +11 -4
  308. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
  309. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +7 -0
  310. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  311. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +45 -17
  312. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
  313. package/build/dist/Server/Utils/Express.js.map +1 -1
  314. package/build/dist/Server/Utils/Greenlock/Greenlock.js +36 -29
  315. package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
  316. package/build/dist/Server/Utils/LLM/LLMService.js +18 -6
  317. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  318. package/build/dist/Server/Utils/Logger.js +61 -13
  319. package/build/dist/Server/Utils/Logger.js.map +1 -1
  320. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +23 -20
  321. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  322. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +13 -4
  323. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  324. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -22
  325. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  326. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +6 -3
  327. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
  328. package/build/dist/Server/Utils/Profiling.js +9 -6
  329. package/build/dist/Server/Utils/Profiling.js.map +1 -1
  330. package/build/dist/Server/Utils/Realtime.js +50 -34
  331. package/build/dist/Server/Utils/Realtime.js.map +1 -1
  332. package/build/dist/Server/Utils/Response.js +2 -2
  333. package/build/dist/Server/Utils/Response.js.map +1 -1
  334. package/build/dist/Server/Utils/StartServer.js +23 -11
  335. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  336. package/build/dist/Server/Utils/Telemetry/SpanUtil.js +52 -0
  337. package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -0
  338. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +58 -15
  339. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
  340. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +58 -15
  341. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
  342. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +19 -5
  343. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
  344. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +90 -26
  345. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
  346. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +12 -3
  347. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -1
  348. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +25 -7
  349. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -1
  350. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +58 -19
  351. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
  352. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +102 -29
  353. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  354. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +38 -9
  355. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
  356. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +34 -8
  357. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -1
  358. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +3 -1
  359. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
  360. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +55 -13
  361. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
  362. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js +5 -1
  363. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js.map +1 -1
  364. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +91 -26
  365. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
  366. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +355 -270
  367. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  368. package/build/dist/Server/Utils/Workspace/Workspace.js +21 -12
  369. package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
  370. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +3 -1
  371. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
  372. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +9 -2
  373. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -1
  374. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js +1 -1
  375. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js.map +1 -1
  376. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js +12 -6
  377. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js.map +1 -1
  378. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +31 -30
  379. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
  380. package/build/dist/UI/Components/Charts/Area/AreaChart.js +20 -2
  381. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  382. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
  383. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  384. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +9 -2
  385. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  386. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +9 -2
  387. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  388. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js +2 -0
  389. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js.map +1 -0
  390. package/build/dist/UI/Components/Charts/Line/LineChart.js +20 -2
  391. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  392. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js +2 -0
  393. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js.map +1 -0
  394. package/build/dist/UI/Components/Dictionary/Dictionary.js +9 -1
  395. package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
  396. package/build/dist/UI/Components/Filters/FiltersForm.js +1 -1
  397. package/build/dist/UI/Components/Filters/FiltersForm.js.map +1 -1
  398. package/build/dist/UI/Components/Filters/JSONFilter.js +1 -1
  399. package/build/dist/UI/Components/Filters/JSONFilter.js.map +1 -1
  400. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
  401. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +9 -5
  402. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  403. package/build/dist/UI/Components/Navbar/NavBar.js +9 -1
  404. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  405. package/package.json +1 -1
@@ -70,7 +70,10 @@ export default class MicrosoftTeamsIncidentActions {
70
70
  }): Promise<void> {
71
71
  const { teamsRequest, action } = data;
72
72
 
73
- logger.debug("Handling Microsoft Teams incident action:");
73
+ logger.debug("Handling Microsoft Teams incident action:", {
74
+ projectId: teamsRequest.projectId.toString(),
75
+ actionType: action.actionType,
76
+ });
74
77
  logger.debug(action);
75
78
 
76
79
  try {
@@ -104,11 +107,17 @@ export default class MicrosoftTeamsIncidentActions {
104
107
  break;
105
108
 
106
109
  default:
107
- logger.debug("Unhandled incident action: " + action.actionType);
110
+ logger.debug("Unhandled incident action: " + action.actionType, {
111
+ projectId: teamsRequest.projectId.toString(),
112
+ actionType: action.actionType,
113
+ });
108
114
  break;
109
115
  }
110
116
  } catch (error) {
111
- logger.error("Error handling Microsoft Teams incident action:");
117
+ logger.error("Error handling Microsoft Teams incident action:", {
118
+ projectId: teamsRequest.projectId.toString(),
119
+ actionType: action.actionType,
120
+ });
112
121
  logger.error(error);
113
122
  }
114
123
 
@@ -124,11 +133,16 @@ export default class MicrosoftTeamsIncidentActions {
124
133
  const incidentId: string = data.action.actionValue || "";
125
134
 
126
135
  if (!incidentId) {
127
- logger.error("No incident ID provided for acknowledge action");
136
+ logger.error("No incident ID provided for acknowledge action", {
137
+ projectId: data.teamsRequest.projectId.toString(),
138
+ });
128
139
  return;
129
140
  }
130
141
 
131
- logger.debug("Acknowledging incident: " + incidentId);
142
+ logger.debug("Acknowledging incident: " + incidentId, {
143
+ projectId: data.teamsRequest.projectId.toString(),
144
+ incidentId: incidentId,
145
+ });
132
146
 
133
147
  try {
134
148
  // Get the incident
@@ -152,13 +166,19 @@ export default class MicrosoftTeamsIncidentActions {
152
166
  });
153
167
 
154
168
  if (!incident) {
155
- logger.error("Incident not found: " + incidentId);
169
+ logger.error("Incident not found: " + incidentId, {
170
+ projectId: data.teamsRequest.projectId.toString(),
171
+ incidentId: incidentId,
172
+ });
156
173
  return;
157
174
  }
158
175
 
159
176
  // Check if already acknowledged
160
177
  if (incident.currentIncidentState?.isAcknowledgedState) {
161
- logger.debug("Incident is already acknowledged");
178
+ logger.debug("Incident is already acknowledged", {
179
+ projectId: data.teamsRequest.projectId.toString(),
180
+ incidentId: incidentId,
181
+ });
162
182
  return;
163
183
  }
164
184
 
@@ -174,9 +194,15 @@ export default class MicrosoftTeamsIncidentActions {
174
194
  oneUptimeUserId,
175
195
  );
176
196
 
177
- logger.debug("Incident acknowledged successfully");
197
+ logger.debug("Incident acknowledged successfully", {
198
+ projectId: data.teamsRequest.projectId.toString(),
199
+ incidentId: incidentId,
200
+ });
178
201
  } catch (error) {
179
- logger.error("Error acknowledging incident:");
202
+ logger.error("Error acknowledging incident:", {
203
+ projectId: data.teamsRequest.projectId.toString(),
204
+ incidentId: incidentId,
205
+ });
180
206
  logger.error(error);
181
207
  }
182
208
  }
@@ -189,11 +215,16 @@ export default class MicrosoftTeamsIncidentActions {
189
215
  const incidentId: string = data.action.actionValue || "";
190
216
 
191
217
  if (!incidentId) {
192
- logger.error("No incident ID provided for resolve action");
218
+ logger.error("No incident ID provided for resolve action", {
219
+ projectId: data.teamsRequest.projectId.toString(),
220
+ });
193
221
  return;
194
222
  }
195
223
 
196
- logger.debug("Resolving incident: " + incidentId);
224
+ logger.debug("Resolving incident: " + incidentId, {
225
+ projectId: data.teamsRequest.projectId.toString(),
226
+ incidentId: incidentId,
227
+ });
197
228
 
198
229
  try {
199
230
  // Get the incident
@@ -217,13 +248,19 @@ export default class MicrosoftTeamsIncidentActions {
217
248
  });
218
249
 
219
250
  if (!incident) {
220
- logger.error("Incident not found: " + incidentId);
251
+ logger.error("Incident not found: " + incidentId, {
252
+ projectId: data.teamsRequest.projectId.toString(),
253
+ incidentId: incidentId,
254
+ });
221
255
  return;
222
256
  }
223
257
 
224
258
  // Check if already resolved
225
259
  if (incident.currentIncidentState?.isResolvedState) {
226
- logger.debug("Incident is already resolved");
260
+ logger.debug("Incident is already resolved", {
261
+ projectId: data.teamsRequest.projectId.toString(),
262
+ incidentId: incidentId,
263
+ });
227
264
  return;
228
265
  }
229
266
 
@@ -239,9 +276,15 @@ export default class MicrosoftTeamsIncidentActions {
239
276
  oneUptimeUserId,
240
277
  );
241
278
 
242
- logger.debug("Incident resolved successfully");
279
+ logger.debug("Incident resolved successfully", {
280
+ projectId: data.teamsRequest.projectId.toString(),
281
+ incidentId: incidentId,
282
+ });
243
283
  } catch (error) {
244
- logger.error("Error resolving incident:");
284
+ logger.error("Error resolving incident:", {
285
+ projectId: data.teamsRequest.projectId.toString(),
286
+ incidentId: incidentId,
287
+ });
245
288
  logger.error(error);
246
289
  }
247
290
  }
@@ -649,6 +692,10 @@ export default class MicrosoftTeamsIncidentActions {
649
692
 
650
693
  logger.debug(
651
694
  "Incident created successfully: " + createdIncident.id?.toString(),
695
+ {
696
+ projectId: projectId.toString(),
697
+ incidentId: createdIncident.id?.toString(),
698
+ },
652
699
  );
653
700
 
654
701
  // Update monitor status if specified
@@ -693,7 +740,9 @@ export default class MicrosoftTeamsIncidentActions {
693
740
 
694
741
  return;
695
742
  } catch (error) {
696
- logger.error("Error creating incident from Microsoft Teams:");
743
+ logger.error("Error creating incident from Microsoft Teams:", {
744
+ projectId: projectId.toString(),
745
+ });
697
746
  logger.error(error);
698
747
  await turnContext.sendActivity(
699
748
  "❌ Failed to create incident. Please try again.",
@@ -892,7 +941,9 @@ export default class MicrosoftTeamsIncidentActions {
892
941
  }): Promise<void> {
893
942
  const { teamsRequest, req, res } = data;
894
943
 
895
- logger.debug("Showing new incident card for Microsoft Teams");
944
+ logger.debug("Showing new incident card for Microsoft Teams", {
945
+ projectId: teamsRequest.projectId?.toString(),
946
+ });
896
947
 
897
948
  // Send empty response first
898
949
  Response.sendTextResponse(req, res, "");
@@ -911,7 +962,9 @@ export default class MicrosoftTeamsIncidentActions {
911
962
  * Send card as a message (note: in real Teams bot, this would be sent via TurnContext)
912
963
  * For now, we'll just log it. The actual sending will be done through the bot framework
913
964
  */
914
- logger.debug("New incident card built:");
965
+ logger.debug("New incident card built:", {
966
+ projectId: teamsRequest.projectId.toString(),
967
+ });
915
968
  logger.debug(JSON.stringify(card, null, 2));
916
969
  }
917
970
 
@@ -925,7 +978,9 @@ export default class MicrosoftTeamsIncidentActions {
925
978
  const { teamsRequest, req, res } = data;
926
979
  const { userId, projectId } = teamsRequest;
927
980
 
928
- logger.debug("Submitting new incident from Microsoft Teams");
981
+ logger.debug("Submitting new incident from Microsoft Teams", {
982
+ projectId: projectId?.toString(),
983
+ });
929
984
 
930
985
  if (!projectId) {
931
986
  return Response.sendErrorResponse(
@@ -960,7 +1015,9 @@ export default class MicrosoftTeamsIncidentActions {
960
1015
  (value["onCallDutyPolicies"] as string) || "";
961
1016
 
962
1017
  if (!title || !description || !severityId) {
963
- logger.error("Missing required fields for incident creation");
1018
+ logger.error("Missing required fields for incident creation", {
1019
+ projectId: projectId.toString(),
1020
+ });
964
1021
  return;
965
1022
  }
966
1023
 
@@ -1048,6 +1105,10 @@ export default class MicrosoftTeamsIncidentActions {
1048
1105
 
1049
1106
  logger.debug(
1050
1107
  "Incident created successfully: " + createdIncident.id?.toString(),
1108
+ {
1109
+ projectId: projectId.toString(),
1110
+ incidentId: createdIncident.id?.toString(),
1111
+ },
1051
1112
  );
1052
1113
 
1053
1114
  // Update monitor status if specified
@@ -1073,9 +1134,13 @@ export default class MicrosoftTeamsIncidentActions {
1073
1134
  }
1074
1135
  }
1075
1136
 
1076
- logger.debug("New incident created from Microsoft Teams successfully");
1137
+ logger.debug("New incident created from Microsoft Teams successfully", {
1138
+ projectId: projectId.toString(),
1139
+ });
1077
1140
  } catch (error) {
1078
- logger.error("Error creating incident from Microsoft Teams:");
1141
+ logger.error("Error creating incident from Microsoft Teams:", {
1142
+ projectId: projectId.toString(),
1143
+ });
1079
1144
  logger.error(error);
1080
1145
  }
1081
1146
  }
@@ -29,7 +29,10 @@ export default class MicrosoftTeamsMonitorActions {
29
29
  }): Promise<void> {
30
30
  const { action } = data;
31
31
 
32
- logger.debug("Handling Microsoft Teams monitor action:");
32
+ logger.debug("Handling Microsoft Teams monitor action:", {
33
+ projectId: data.teamsRequest.projectId.toString(),
34
+ actionType: action.actionType,
35
+ });
33
36
  logger.debug(action);
34
37
 
35
38
  try {
@@ -39,11 +42,17 @@ export default class MicrosoftTeamsMonitorActions {
39
42
  break;
40
43
 
41
44
  default:
42
- logger.debug("Unhandled monitor action: " + action.actionType);
45
+ logger.debug("Unhandled monitor action: " + action.actionType, {
46
+ projectId: data.teamsRequest.projectId.toString(),
47
+ actionType: action.actionType,
48
+ });
43
49
  break;
44
50
  }
45
51
  } catch (error) {
46
- logger.error("Error handling Microsoft Teams monitor action:");
52
+ logger.error("Error handling Microsoft Teams monitor action:", {
53
+ projectId: data.teamsRequest.projectId.toString(),
54
+ actionType: action.actionType,
55
+ });
47
56
  logger.error(error);
48
57
  }
49
58
 
@@ -29,7 +29,10 @@ export default class MicrosoftTeamsOnCallDutyActions {
29
29
  }): Promise<void> {
30
30
  const { action } = data;
31
31
 
32
- logger.debug("Handling Microsoft Teams on-call duty action:");
32
+ logger.debug("Handling Microsoft Teams on-call duty action:", {
33
+ projectId: data.teamsRequest.projectId.toString(),
34
+ actionType: action.actionType,
35
+ });
33
36
  logger.debug(action);
34
37
 
35
38
  try {
@@ -39,11 +42,17 @@ export default class MicrosoftTeamsOnCallDutyActions {
39
42
  break;
40
43
 
41
44
  default:
42
- logger.debug("Unhandled on-call duty action: " + action.actionType);
45
+ logger.debug("Unhandled on-call duty action: " + action.actionType, {
46
+ projectId: data.teamsRequest.projectId.toString(),
47
+ actionType: action.actionType,
48
+ });
43
49
  break;
44
50
  }
45
51
  } catch (error) {
46
- logger.error("Error handling Microsoft Teams on-call duty action:");
52
+ logger.error("Error handling Microsoft Teams on-call duty action:", {
53
+ projectId: data.teamsRequest.projectId.toString(),
54
+ actionType: action.actionType,
55
+ });
47
56
  logger.error(error);
48
57
  }
49
58
 
@@ -62,7 +71,9 @@ export default class MicrosoftTeamsOnCallDutyActions {
62
71
  ] as ObjectID;
63
72
 
64
73
  if (!onCallDutyPolicyId) {
65
- logger.error("OnCallDutyPolicy ID is required");
74
+ logger.error("OnCallDutyPolicy ID is required", {
75
+ actionType: actionType,
76
+ });
66
77
  await turnContext.sendActivity("OnCallDutyPolicy ID is required");
67
78
  return;
68
79
  }
@@ -81,7 +92,9 @@ export default class MicrosoftTeamsOnCallDutyActions {
81
92
  });
82
93
 
83
94
  if (!onCallDutyPolicy) {
84
- logger.error("OnCallDutyPolicy not found");
95
+ logger.error("OnCallDutyPolicy not found", {
96
+ onCallDutyPolicyId: onCallDutyPolicyId.toString(),
97
+ });
85
98
  await turnContext.sendActivity("OnCallDutyPolicy not found");
86
99
  return;
87
100
  }
@@ -105,12 +118,17 @@ export default class MicrosoftTeamsOnCallDutyActions {
105
118
  break;
106
119
 
107
120
  default:
108
- logger.error(`Unknown action type: ${actionType}`);
121
+ logger.error(`Unknown action type: ${actionType}`, {
122
+ onCallDutyPolicyId: onCallDutyPolicyId.toString(),
123
+ actionType: actionType,
124
+ });
109
125
  await turnContext.sendActivity("Unknown action type");
110
126
  break;
111
127
  }
112
128
  } catch (error) {
113
- logger.error(`Error handling on-call duty action: ${error}`);
129
+ logger.error(`Error handling on-call duty action: ${error}`, {
130
+ actionType: actionType,
131
+ });
114
132
  await turnContext.sendActivity(
115
133
  "An error occurred while processing the action",
116
134
  );
@@ -65,7 +65,10 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
65
65
  }): Promise<void> {
66
66
  const { action } = data;
67
67
 
68
- logger.debug("Handling Microsoft Teams scheduled maintenance action:");
68
+ logger.debug("Handling Microsoft Teams scheduled maintenance action:", {
69
+ projectId: data.teamsRequest.projectId.toString(),
70
+ actionType: action.actionType,
71
+ });
69
72
  logger.debug(action);
70
73
 
71
74
  try {
@@ -87,12 +90,20 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
87
90
  default:
88
91
  logger.debug(
89
92
  `Unhandled scheduled maintenance action: ${action.actionType}`,
93
+ {
94
+ projectId: data.teamsRequest.projectId.toString(),
95
+ actionType: action.actionType,
96
+ },
90
97
  );
91
98
  break;
92
99
  }
93
100
  } catch (error) {
94
101
  logger.error(
95
102
  "Error handling Microsoft Teams scheduled maintenance action:",
103
+ {
104
+ projectId: data.teamsRequest.projectId.toString(),
105
+ actionType: action.actionType,
106
+ },
96
107
  );
97
108
  logger.error(error);
98
109
  }
@@ -223,6 +234,11 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
223
234
  logger.debug(
224
235
  "Scheduled maintenance created successfully: " +
225
236
  createdScheduledMaintenance.id?.toString(),
237
+ {
238
+ projectId: request.projectId.toString(),
239
+ scheduledMaintenanceId:
240
+ createdScheduledMaintenance.id?.toString(),
241
+ },
226
242
  );
227
243
 
228
244
  // Update monitor status if specified
@@ -269,6 +285,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
269
285
  } catch (error) {
270
286
  logger.error(
271
287
  "Error creating scheduled maintenance from Microsoft Teams:",
288
+ {
289
+ projectId: request.projectId.toString(),
290
+ },
272
291
  );
273
292
  logger.error(error);
274
293
  await turnContext.sendActivity(
@@ -284,7 +303,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
284
303
  ] as ObjectID;
285
304
 
286
305
  if (!scheduledMaintenanceId) {
287
- logger.error("ScheduledMaintenance ID is required");
306
+ logger.error("ScheduledMaintenance ID is required", {
307
+ actionType: actionType,
308
+ });
288
309
  await turnContext.sendActivity("ScheduledMaintenance ID is required");
289
310
  return;
290
311
  }
@@ -309,7 +330,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
309
330
  });
310
331
 
311
332
  if (!scheduledMaintenance) {
312
- logger.error("ScheduledMaintenance not found");
333
+ logger.error("ScheduledMaintenance not found", {
334
+ scheduledMaintenanceId: scheduledMaintenanceId.toString(),
335
+ });
313
336
  await turnContext.sendActivity("ScheduledMaintenance not found");
314
337
  return;
315
338
  }
@@ -459,12 +482,17 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
459
482
  }
460
483
 
461
484
  default:
462
- logger.error(`Unknown action type: ${actionType}`);
485
+ logger.error(`Unknown action type: ${actionType}`, {
486
+ scheduledMaintenanceId: scheduledMaintenanceId.toString(),
487
+ actionType: actionType,
488
+ });
463
489
  await turnContext.sendActivity("Unknown action type");
464
490
  break;
465
491
  }
466
492
  } catch (error) {
467
- logger.error(`Error handling scheduled maintenance action: ${error}`);
493
+ logger.error(`Error handling scheduled maintenance action: ${error}`, {
494
+ actionType: actionType,
495
+ });
468
496
  await turnContext.sendActivity(
469
497
  "An error occurred while processing the action",
470
498
  );
@@ -590,7 +618,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
590
618
  }): Promise<void> {
591
619
  const { teamsRequest, req, res } = data;
592
620
 
593
- logger.debug("Showing new scheduled maintenance card for Microsoft Teams");
621
+ logger.debug("Showing new scheduled maintenance card for Microsoft Teams", {
622
+ projectId: teamsRequest.projectId?.toString(),
623
+ });
594
624
 
595
625
  // Send empty response first
596
626
  Response.sendTextResponse(req, res, "");
@@ -609,7 +639,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
609
639
  * Send card as a message (note: in real Teams bot, this would be sent via TurnContext)
610
640
  * For now, we'll just log it. The actual sending will be done through the bot framework
611
641
  */
612
- logger.debug("New scheduled maintenance card built:");
642
+ logger.debug("New scheduled maintenance card built:", {
643
+ projectId: teamsRequest.projectId.toString(),
644
+ });
613
645
  logger.debug(JSON.stringify(card, null, 2));
614
646
  }
615
647
 
@@ -623,7 +655,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
623
655
  const { teamsRequest, req, res } = data;
624
656
  const { userId, projectId } = teamsRequest;
625
657
 
626
- logger.debug("Submitting new scheduled maintenance from Microsoft Teams");
658
+ logger.debug("Submitting new scheduled maintenance from Microsoft Teams", {
659
+ projectId: projectId?.toString(),
660
+ });
627
661
 
628
662
  if (!projectId) {
629
663
  return Response.sendErrorResponse(
@@ -661,6 +695,9 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
661
695
  if (!title || !description || !startDate || !endDate) {
662
696
  logger.error(
663
697
  "Missing required fields for scheduled maintenance creation",
698
+ {
699
+ projectId: projectId.toString(),
700
+ },
664
701
  );
665
702
  return;
666
703
  }
@@ -733,6 +770,10 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
733
770
  logger.debug(
734
771
  "Scheduled maintenance created successfully: " +
735
772
  createdScheduledMaintenance.id?.toString(),
773
+ {
774
+ projectId: projectId.toString(),
775
+ scheduledMaintenanceId: createdScheduledMaintenance.id?.toString(),
776
+ },
736
777
  );
737
778
 
738
779
  // Update monitor status if specified
@@ -760,10 +801,16 @@ export default class MicrosoftTeamsScheduledMaintenanceActions {
760
801
 
761
802
  logger.debug(
762
803
  "New scheduled maintenance created from Microsoft Teams successfully",
804
+ {
805
+ projectId: projectId.toString(),
806
+ },
763
807
  );
764
808
  } catch (error) {
765
809
  logger.error(
766
810
  "Error creating scheduled maintenance from Microsoft Teams:",
811
+ {
812
+ projectId: projectId.toString(),
813
+ },
767
814
  );
768
815
  logger.error(error);
769
816
  }