@oneuptime/common 10.0.53 → 10.0.55
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.
- package/Models/AnalyticsModels/Metric.ts +78 -0
- package/Server/API/AIAgentDataAPI.ts +6 -1
- package/Server/API/BillingAPI.ts +28 -6
- package/Server/API/CommonAPI.ts +11 -0
- package/Server/API/DashboardAPI.ts +6 -2
- package/Server/API/DashboardDomainAPI.ts +10 -3
- package/Server/API/GitHubAPI.ts +58 -14
- package/Server/API/MicrosoftTeamsAPI.ts +97 -33
- package/Server/API/OpenSourceDeploymentAPI.ts +2 -2
- package/Server/API/SlackAPI.ts +107 -36
- package/Server/API/StatusAPI.ts +37 -16
- package/Server/API/StatusPageAPI.ts +97 -23
- package/Server/API/StatusPageDomainAPI.ts +6 -3
- package/Server/API/UserAPI.ts +3 -3
- package/Server/API/UserCallAPI.ts +5 -2
- package/Server/API/UserEmailAPI.ts +5 -2
- package/Server/API/UserPushAPI.ts +9 -3
- package/Server/API/UserSmsAPI.ts +5 -2
- package/Server/API/UserWhatsAppAPI.ts +5 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Middleware/NotificationMiddleware.ts +2 -2
- package/Server/Middleware/ProjectAuthorization.ts +6 -0
- package/Server/Middleware/SCIMAuthorization.ts +2 -1
- package/Server/Middleware/SlackAuthorization.ts +28 -10
- package/Server/Middleware/TelemetryIngest.ts +16 -3
- package/Server/Middleware/UserAuthorization.ts +22 -5
- package/Server/Middleware/WhatsAppAuthorization.ts +15 -4
- package/Server/Services/AIAgentService.ts +13 -6
- package/Server/Services/AIService.ts +9 -3
- package/Server/Services/AlertEpisodeFeedService.ts +17 -5
- package/Server/Services/AlertEpisodeService.ts +34 -3
- package/Server/Services/AlertEpisodeStateTimelineService.ts +80 -22
- package/Server/Services/AlertFeedService.ts +17 -5
- package/Server/Services/AlertGroupingEngineService.ts +36 -7
- package/Server/Services/AlertService.ts +60 -8
- package/Server/Services/AlertStateTimelineService.ts +29 -7
- package/Server/Services/AnalyticsDatabaseService.ts +59 -25
- package/Server/Services/BillingInvoiceService.ts +7 -3
- package/Server/Services/BillingService.ts +9 -2
- package/Server/Services/DashboardDomainService.ts +56 -22
- package/Server/Services/DashboardService.ts +11 -4
- package/Server/Services/DatabaseService.ts +31 -11
- package/Server/Services/IncidentEpisodeFeedService.ts +17 -5
- package/Server/Services/IncidentEpisodeService.ts +34 -3
- package/Server/Services/IncidentEpisodeStateTimelineService.ts +80 -22
- package/Server/Services/IncidentFeedService.ts +33 -9
- package/Server/Services/IncidentGroupingEngineService.ts +35 -6
- package/Server/Services/IncidentService.ts +103 -9
- package/Server/Services/IncidentSlaRuleService.ts +16 -4
- package/Server/Services/IncidentSlaService.ts +20 -4
- package/Server/Services/IncidentStateTimelineService.ts +120 -31
- package/Server/Services/KubernetesClusterService.ts +62 -14
- package/Server/Services/MonitorFeedService.ts +33 -9
- package/Server/Services/MonitorProbeService.ts +46 -23
- package/Server/Services/MonitorService.ts +35 -4
- package/Server/Services/MonitorStatusTimelineService.ts +68 -20
- package/Server/Services/NotificationService.ts +4 -2
- package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +53 -9
- package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +9 -2
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +29 -8
- package/Server/Services/OnCallDutyPolicyFeedService.ts +33 -8
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +97 -24
- package/Server/Services/OnCallDutyPolicyService.ts +2 -1
- package/Server/Services/OpenTelemetryIngestService.ts +51 -20
- package/Server/Services/ProbeService.ts +16 -7
- package/Server/Services/ProjectService.ts +21 -7
- package/Server/Services/ScheduledMaintenanceFeedService.ts +17 -4
- package/Server/Services/ScheduledMaintenanceService.ts +52 -6
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +72 -20
- package/Server/Services/StatusPageDomainService.ts +59 -23
- package/Server/Services/StatusPageService.ts +26 -8
- package/Server/Services/StatusPageSubscriberService.ts +382 -111
- package/Server/Services/TeamMemberService.ts +9 -3
- package/Server/Services/UserNotificationRuleService.ts +9 -3
- package/Server/Services/UserService.ts +6 -4
- package/Server/Services/UserWhatsAppService.ts +9 -3
- package/Server/Services/WorkflowService.ts +7 -3
- package/Server/Services/WorkspaceNotificationRuleService.ts +398 -156
- package/Server/Types/Domain.ts +15 -5
- package/Server/Types/Workflow/Components/API/Post.ts +22 -8
- package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +12 -4
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +10 -0
- package/Server/Utils/CodeRepository/CodeRepository.ts +62 -13
- package/Server/Utils/Express.ts +1 -0
- package/Server/Utils/Greenlock/Greenlock.ts +75 -20
- package/Server/Utils/LLM/LLMService.ts +22 -7
- package/Server/Utils/Logger.ts +93 -13
- package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -5
- package/Server/Utils/Monitor/MonitorIncident.ts +17 -3
- package/Server/Utils/Monitor/MonitorStatusTimeline.ts +6 -1
- package/Server/Utils/Profiling.ts +11 -5
- package/Server/Utils/Realtime.ts +90 -31
- package/Server/Utils/Response.ts +2 -2
- package/Server/Utils/StartServer.ts +43 -9
- package/Server/Utils/Telemetry/SpanUtil.ts +90 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +58 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +58 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +19 -3
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +87 -22
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +12 -3
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +25 -7
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +55 -8
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +100 -22
- package/Server/Utils/Workspace/Slack/Actions/Alert.ts +35 -9
- package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +32 -8
- package/Server/Utils/Workspace/Slack/Actions/Auth.ts +3 -1
- package/Server/Utils/Workspace/Slack/Actions/Incident.ts +52 -11
- package/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.ts +4 -1
- package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +89 -20
- package/Server/Utils/Workspace/Slack/Slack.ts +498 -247
- package/Server/Utils/Workspace/Workspace.ts +33 -11
- package/Server/Utils/Workspace/WorkspaceBase.ts +3 -1
- package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +8 -2
- package/Tests/Server/Middleware/UserAuthorization.test.ts +1 -1
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +12 -3
- package/UI/Components/Charts/Area/AreaChart.tsx +35 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +7 -0
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +33 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +33 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.ts +14 -0
- package/UI/Components/Charts/Line/LineChart.tsx +35 -1
- package/UI/Components/Charts/Types/ExemplarPoint.ts +6 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
- package/UI/Components/Navbar/NavBar.tsx +10 -0
- package/build/dist/Models/AnalyticsModels/Metric.js +70 -0
- package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
- package/build/dist/Server/API/AIAgentDataAPI.js +6 -6
- package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
- package/build/dist/Server/API/BillingAPI.js +13 -13
- package/build/dist/Server/API/BillingAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +5 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardAPI.js +2 -2
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardDomainAPI.js +3 -3
- package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
- package/build/dist/Server/API/GitHubAPI.js +19 -19
- package/build/dist/Server/API/GitHubAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +34 -34
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/OpenSourceDeploymentAPI.js +2 -2
- package/build/dist/Server/API/OpenSourceDeploymentAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +38 -38
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusAPI.js +16 -16
- package/build/dist/Server/API/StatusAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +52 -52
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageDomainAPI.js +3 -3
- package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
- package/build/dist/Server/API/UserAPI.js +3 -3
- package/build/dist/Server/API/UserAPI.js.map +1 -1
- package/build/dist/Server/API/UserCallAPI.js +2 -2
- package/build/dist/Server/API/UserCallAPI.js.map +1 -1
- package/build/dist/Server/API/UserEmailAPI.js +2 -2
- package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
- package/build/dist/Server/API/UserPushAPI.js +3 -3
- package/build/dist/Server/API/UserPushAPI.js.map +1 -1
- package/build/dist/Server/API/UserSmsAPI.js +2 -2
- package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
- package/build/dist/Server/API/UserWhatsAppAPI.js +2 -2
- package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/NotificationMiddleware.js +2 -2
- package/build/dist/Server/Middleware/NotificationMiddleware.js.map +1 -1
- package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -0
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/SCIMAuthorization.js +2 -2
- package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/SlackAuthorization.js +10 -10
- package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +9 -4
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +10 -5
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js +6 -6
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AIAgentService.js +13 -7
- package/build/dist/Server/Services/AIAgentService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +9 -2
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeFeedService.js +17 -5
- package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeService.js +40 -10
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +81 -24
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AlertFeedService.js +17 -5
- package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
- package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -28
- package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +72 -20
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/AlertStateTimelineService.js +36 -13
- package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -28
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/BillingInvoiceService.js +7 -2
- package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +8 -8
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DashboardDomainService.js +49 -27
- package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
- package/build/dist/Server/Services/DashboardService.js +11 -4
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +32 -12
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeFeedService.js +17 -5
- package/build/dist/Server/Services/IncidentEpisodeFeedService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +40 -10
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +81 -24
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentFeedService.js +34 -10
- package/build/dist/Server/Services/IncidentFeedService.js.map +1 -1
- package/build/dist/Server/Services/IncidentGroupingEngineService.js +43 -29
- package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +116 -28
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSlaRuleService.js +19 -11
- package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSlaService.js +21 -14
- package/build/dist/Server/Services/IncidentSlaService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +130 -37
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterService.js +51 -14
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
- package/build/dist/Server/Services/MonitorFeedService.js +34 -10
- package/build/dist/Server/Services/MonitorFeedService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +32 -16
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +42 -11
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorStatusTimelineService.js +69 -21
- package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
- package/build/dist/Server/Services/NotificationService.js +4 -3
- package/build/dist/Server/Services/NotificationService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +49 -12
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +9 -3
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +26 -11
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +34 -10
- package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +94 -37
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/OpenTelemetryIngestService.js +45 -17
- package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +13 -7
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +33 -17
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +17 -5
- package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +71 -24
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +72 -24
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageDomainService.js +55 -29
- package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +29 -9
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberService.js +393 -130
- package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +10 -2
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +10 -2
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +8 -3
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserWhatsAppService.js +10 -2
- package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
- package/build/dist/Server/Services/WorkflowService.js +7 -2
- package/build/dist/Server/Services/WorkflowService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +367 -180
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Types/Domain.js +12 -6
- package/build/dist/Server/Types/Domain.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -7
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +11 -4
- package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +7 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +45 -17
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/Greenlock/Greenlock.js +36 -29
- package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +18 -6
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Logger.js +61 -13
- package/build/dist/Server/Utils/Logger.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +23 -20
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +13 -4
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -22
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +6 -3
- package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
- package/build/dist/Server/Utils/Profiling.js +9 -6
- package/build/dist/Server/Utils/Profiling.js.map +1 -1
- package/build/dist/Server/Utils/Realtime.js +50 -34
- package/build/dist/Server/Utils/Realtime.js.map +1 -1
- package/build/dist/Server/Utils/Response.js +2 -2
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +23 -11
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/SpanUtil.js +52 -0
- package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +58 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +58 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +19 -5
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +90 -26
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +12 -3
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +25 -7
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +58 -19
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +102 -29
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +38 -9
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +34 -8
- package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +3 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +55 -13
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js +5 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +91 -26
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +355 -270
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Workspace.js +21 -12
- package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +3 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +9 -2
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -1
- package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js +1 -1
- package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js.map +1 -1
- package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js +12 -6
- package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js.map +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +20 -2
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +9 -2
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +9 -2
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +20 -2
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js +2 -0
- package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
- package/build/dist/UI/Components/Navbar/NavBar.js +9 -1
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/package.json +1 -1
package/Server/Types/Domain.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import logger from "../Utils/Logger";
|
|
1
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
2
2
|
import DomainCommon from "../../Types/Domain";
|
|
3
3
|
import { PromiseRejectErrorFunction } from "../../Types/FunctionTypes";
|
|
4
4
|
import dns from "dns";
|
|
@@ -13,9 +13,14 @@ export default class Domain extends DomainCommon {
|
|
|
13
13
|
dns.resolveCname(
|
|
14
14
|
data.domain,
|
|
15
15
|
(err: Error | null, addresses: string[]) => {
|
|
16
|
+
const domainLogAttributes: LogAttributes = {
|
|
17
|
+
domain: data.domain,
|
|
18
|
+
};
|
|
19
|
+
|
|
16
20
|
if (err) {
|
|
17
21
|
logger.debug(
|
|
18
22
|
`DNS CNAME lookup failed for domain ${data.domain}: ${err.message}`,
|
|
23
|
+
domainLogAttributes,
|
|
19
24
|
);
|
|
20
25
|
|
|
21
26
|
// Handle specific DNS error types with user-friendly messages
|
|
@@ -89,9 +94,14 @@ export default class Domain extends DomainCommon {
|
|
|
89
94
|
dns.resolveTxt(
|
|
90
95
|
domain.toString(),
|
|
91
96
|
(err: Error | null, data: Array<Array<string>>) => {
|
|
97
|
+
const domainLogAttributes: LogAttributes = {
|
|
98
|
+
domain: domain.toString(),
|
|
99
|
+
};
|
|
100
|
+
|
|
92
101
|
if (err) {
|
|
93
102
|
logger.debug(
|
|
94
103
|
`DNS TXT lookup failed for domain ${domain.toString()}: ${err.message}`,
|
|
104
|
+
domainLogAttributes,
|
|
95
105
|
);
|
|
96
106
|
|
|
97
107
|
// Handle specific DNS error types with user-friendly messages
|
|
@@ -136,10 +146,10 @@ export default class Domain extends DomainCommon {
|
|
|
136
146
|
);
|
|
137
147
|
}
|
|
138
148
|
|
|
139
|
-
logger.debug("Verify TXT Record");
|
|
140
|
-
logger.debug("Domain " + domain.toString());
|
|
141
|
-
logger.debug("Data: ");
|
|
142
|
-
logger.debug(data);
|
|
149
|
+
logger.debug("Verify TXT Record", domainLogAttributes);
|
|
150
|
+
logger.debug("Domain " + domain.toString(), domainLogAttributes);
|
|
151
|
+
logger.debug("Data: ", domainLogAttributes);
|
|
152
|
+
logger.debug(data, domainLogAttributes);
|
|
143
153
|
|
|
144
154
|
let isVerified: boolean = false;
|
|
145
155
|
for (const item of data) {
|
|
@@ -12,7 +12,7 @@ import ComponentMetadata, {
|
|
|
12
12
|
import ComponentID from "../../../../../Types/Workflow/ComponentID";
|
|
13
13
|
import APIComponents from "../../../../../Types/Workflow/Components/API";
|
|
14
14
|
import API from "../../../../../Utils/API";
|
|
15
|
-
import logger from "../../../../Utils/Logger";
|
|
15
|
+
import logger, { LogAttributes } from "../../../../Utils/Logger";
|
|
16
16
|
import CaptureSpan from "../../../../Utils/Telemetry/CaptureSpan";
|
|
17
17
|
|
|
18
18
|
export default class ApiPost extends ComponentCode {
|
|
@@ -42,24 +42,35 @@ export default class ApiPost extends ComponentCode {
|
|
|
42
42
|
|
|
43
43
|
let apiResult: HTTPResponse<JSONObject> | HTTPErrorResponse | null = null;
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const workflowLogAttributes: LogAttributes = {
|
|
46
|
+
projectId: options.projectId.toString(),
|
|
47
|
+
workflowId: options.workflowId.toString(),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
logger.debug("API Post Component is running.", workflowLogAttributes);
|
|
46
51
|
|
|
47
52
|
const url: URL = args["url"] as URL;
|
|
48
53
|
if (!url) {
|
|
49
54
|
throw options.onError(new BadDataException("URL is required"));
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
logger.debug(`URL: ${url}
|
|
57
|
+
logger.debug(`URL: ${url}`, workflowLogAttributes);
|
|
53
58
|
|
|
54
59
|
const requestBody: JSONObject = args["request-body"] as JSONObject;
|
|
55
60
|
|
|
56
|
-
logger.debug(
|
|
61
|
+
logger.debug(
|
|
62
|
+
`Request Body: ${JSON.stringify(requestBody)}`,
|
|
63
|
+
workflowLogAttributes,
|
|
64
|
+
);
|
|
57
65
|
|
|
58
66
|
const requestHeaders: Dictionary<string> = args[
|
|
59
67
|
"request-headers"
|
|
60
68
|
] as Dictionary<string>;
|
|
61
69
|
|
|
62
|
-
logger.debug(
|
|
70
|
+
logger.debug(
|
|
71
|
+
`Request Headers: ${JSON.stringify(requestHeaders)}`,
|
|
72
|
+
workflowLogAttributes,
|
|
73
|
+
);
|
|
63
74
|
|
|
64
75
|
try {
|
|
65
76
|
apiResult = await API.post({
|
|
@@ -68,7 +79,7 @@ export default class ApiPost extends ComponentCode {
|
|
|
68
79
|
headers: args["request-headers"] as Dictionary<string>,
|
|
69
80
|
});
|
|
70
81
|
|
|
71
|
-
logger.debug("API Post Component is done.");
|
|
82
|
+
logger.debug("API Post Component is done.", workflowLogAttributes);
|
|
72
83
|
|
|
73
84
|
return Promise.resolve({
|
|
74
85
|
returnValues: ApiComponentUtils.getReturnValues(apiResult),
|
|
@@ -89,8 +100,11 @@ export default class ApiPost extends ComponentCode {
|
|
|
89
100
|
});
|
|
90
101
|
}
|
|
91
102
|
|
|
92
|
-
logger.debug(
|
|
93
|
-
|
|
103
|
+
logger.debug(
|
|
104
|
+
"API Post Component is done with error.",
|
|
105
|
+
workflowLogAttributes,
|
|
106
|
+
);
|
|
107
|
+
logger.debug(err, workflowLogAttributes);
|
|
94
108
|
|
|
95
109
|
return Promise.resolve({
|
|
96
110
|
returnValues: {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ExpressResponse,
|
|
7
7
|
NextFunction,
|
|
8
8
|
} from "../../../../Utils/Express";
|
|
9
|
-
import logger from "../../../../Utils/Logger";
|
|
9
|
+
import logger, { LogAttributes } from "../../../../Utils/Logger";
|
|
10
10
|
import Response from "../../../../Utils/Response";
|
|
11
11
|
import Select from "../../../Database/Select";
|
|
12
12
|
import { RunOptions, RunReturnType } from "../../ComponentCode";
|
|
@@ -131,8 +131,13 @@ export default class OnTriggerBaseModel<
|
|
|
131
131
|
|
|
132
132
|
let select: Select<TBaseModel> = args["select"] as Select<TBaseModel>;
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
const runLogAttributes: LogAttributes = {
|
|
135
|
+
projectId: options.projectId.toString(),
|
|
136
|
+
workflowId: options.workflowId.toString(),
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
logger.debug("Select: ", runLogAttributes);
|
|
140
|
+
logger.debug(select, runLogAttributes);
|
|
136
141
|
|
|
137
142
|
if (select && typeof select === "string") {
|
|
138
143
|
select = JSONFunctions.parse(select) as Select<TBaseModel>;
|
|
@@ -236,7 +241,10 @@ export default class OnTriggerBaseModel<
|
|
|
236
241
|
listenOn = JSON.parse(listenOn);
|
|
237
242
|
}
|
|
238
243
|
} catch (err) {
|
|
239
|
-
logger.error(err
|
|
244
|
+
logger.error(err, {
|
|
245
|
+
projectId: req.params["projectId"],
|
|
246
|
+
workflowId: workflow.id?.toString(),
|
|
247
|
+
});
|
|
240
248
|
continue;
|
|
241
249
|
}
|
|
242
250
|
|
|
@@ -856,6 +856,16 @@ export default class StatementGenerator<TBaseModel extends AnalyticsBaseModel> {
|
|
|
856
856
|
return statement;
|
|
857
857
|
}
|
|
858
858
|
|
|
859
|
+
public toDropSkipIndexStatement(indexName: string): string {
|
|
860
|
+
const databaseName: string = this.database.getDatasourceOptions().database!;
|
|
861
|
+
const statement: string = `ALTER TABLE ${databaseName}.${this.model.tableName} DROP INDEX IF EXISTS ${indexName}`;
|
|
862
|
+
|
|
863
|
+
logger.debug(`${this.model.tableName} Drop Skip Index Statement`);
|
|
864
|
+
logger.debug(statement);
|
|
865
|
+
|
|
866
|
+
return statement;
|
|
867
|
+
}
|
|
868
|
+
|
|
859
869
|
public toDropColumnStatement(columnName: string): string {
|
|
860
870
|
const statement: string = `ALTER TABLE ${this.database.getDatasourceOptions()
|
|
861
871
|
.database!}.${this.model.tableName} DROP COLUMN IF EXISTS ${columnName}`;
|
|
@@ -2,7 +2,7 @@ import path from "path";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import Execute from "../Execute";
|
|
4
4
|
import LocalFile from "../LocalFile";
|
|
5
|
-
import logger from "../Logger";
|
|
5
|
+
import logger, { LogAttributes } from "../Logger";
|
|
6
6
|
import CaptureSpan from "../Telemetry/CaptureSpan";
|
|
7
7
|
import CodeRepositoryFile from "./CodeRepositoryFile";
|
|
8
8
|
import Dictionary from "../../../Types/Dictionary";
|
|
@@ -91,11 +91,17 @@ export default class CodeRepositoryUtil {
|
|
|
91
91
|
]);
|
|
92
92
|
await this.runGitCommand(data.repoPath, ["checkout", data.branchName]);
|
|
93
93
|
} catch (error) {
|
|
94
|
+
const branchLogAttributes: LogAttributes = {
|
|
95
|
+
repoPath: data.repoPath,
|
|
96
|
+
branchName: data.branchName,
|
|
97
|
+
};
|
|
98
|
+
|
|
94
99
|
logger.debug(
|
|
95
100
|
`Branch ${data.branchName} not found. Creating a new branch instead.`,
|
|
101
|
+
branchLogAttributes,
|
|
96
102
|
);
|
|
97
103
|
|
|
98
|
-
logger.debug(error);
|
|
104
|
+
logger.debug(error, branchLogAttributes);
|
|
99
105
|
|
|
100
106
|
await this.runGitCommand(data.repoPath, [
|
|
101
107
|
"checkout",
|
|
@@ -172,7 +178,10 @@ export default class CodeRepositoryUtil {
|
|
|
172
178
|
`${data.repoPath}/${data.directoryPath}`,
|
|
173
179
|
);
|
|
174
180
|
|
|
175
|
-
logger.debug("Deleting directory: " + totalPath
|
|
181
|
+
logger.debug("Deleting directory: " + totalPath, {
|
|
182
|
+
repoPath: data.repoPath,
|
|
183
|
+
directoryPath: data.directoryPath,
|
|
184
|
+
});
|
|
176
185
|
|
|
177
186
|
await LocalFile.deleteDirectory(totalPath);
|
|
178
187
|
}
|
|
@@ -182,8 +191,14 @@ export default class CodeRepositoryUtil {
|
|
|
182
191
|
repoPath: string;
|
|
183
192
|
branchName: string;
|
|
184
193
|
}): Promise<void> {
|
|
194
|
+
const createBranchLogAttributes: LogAttributes = {
|
|
195
|
+
repoPath: data.repoPath,
|
|
196
|
+
branchName: data.branchName,
|
|
197
|
+
};
|
|
198
|
+
|
|
185
199
|
logger.debug(
|
|
186
200
|
`Creating git branch '${data.branchName}' in ${path.resolve(data.repoPath)}`,
|
|
201
|
+
createBranchLogAttributes,
|
|
187
202
|
);
|
|
188
203
|
|
|
189
204
|
const stdout: string = await this.runGitCommand(data.repoPath, [
|
|
@@ -192,7 +207,7 @@ export default class CodeRepositoryUtil {
|
|
|
192
207
|
data.branchName,
|
|
193
208
|
]);
|
|
194
209
|
|
|
195
|
-
logger.debug(stdout);
|
|
210
|
+
logger.debug(stdout, createBranchLogAttributes);
|
|
196
211
|
}
|
|
197
212
|
|
|
198
213
|
@CaptureSpan()
|
|
@@ -200,8 +215,14 @@ export default class CodeRepositoryUtil {
|
|
|
200
215
|
repoPath: string;
|
|
201
216
|
branchName: string;
|
|
202
217
|
}): Promise<void> {
|
|
218
|
+
const checkoutLogAttributes: LogAttributes = {
|
|
219
|
+
repoPath: data.repoPath,
|
|
220
|
+
branchName: data.branchName,
|
|
221
|
+
};
|
|
222
|
+
|
|
203
223
|
logger.debug(
|
|
204
224
|
`Checking out git branch '${data.branchName}' in ${path.resolve(data.repoPath)}`,
|
|
225
|
+
checkoutLogAttributes,
|
|
205
226
|
);
|
|
206
227
|
|
|
207
228
|
const stdout: string = await this.runGitCommand(data.repoPath, [
|
|
@@ -209,7 +230,7 @@ export default class CodeRepositoryUtil {
|
|
|
209
230
|
data.branchName,
|
|
210
231
|
]);
|
|
211
232
|
|
|
212
|
-
logger.debug(stdout);
|
|
233
|
+
logger.debug(stdout, checkoutLogAttributes);
|
|
213
234
|
}
|
|
214
235
|
|
|
215
236
|
@CaptureSpan()
|
|
@@ -249,13 +270,21 @@ export default class CodeRepositoryUtil {
|
|
|
249
270
|
);
|
|
250
271
|
}
|
|
251
272
|
|
|
273
|
+
const addFilesLogAttributes: LogAttributes = {
|
|
274
|
+
repoPath: data.repoPath,
|
|
275
|
+
};
|
|
276
|
+
|
|
252
277
|
if (sanitizedRelativeFilePaths.length === 0) {
|
|
253
|
-
logger.debug(
|
|
278
|
+
logger.debug(
|
|
279
|
+
"git add skipped because no file paths were provided",
|
|
280
|
+
addFilesLogAttributes,
|
|
281
|
+
);
|
|
254
282
|
return;
|
|
255
283
|
}
|
|
256
284
|
|
|
257
285
|
logger.debug(
|
|
258
286
|
`Adding ${sanitizedRelativeFilePaths.length} file(s) to git in ${path.resolve(data.repoPath)}`,
|
|
287
|
+
addFilesLogAttributes,
|
|
259
288
|
);
|
|
260
289
|
|
|
261
290
|
const stdout: string = await this.runGitCommand(data.repoPath, [
|
|
@@ -263,7 +292,7 @@ export default class CodeRepositoryUtil {
|
|
|
263
292
|
...sanitizedRelativeFilePaths,
|
|
264
293
|
]);
|
|
265
294
|
|
|
266
|
-
logger.debug(stdout);
|
|
295
|
+
logger.debug(stdout, addFilesLogAttributes);
|
|
267
296
|
}
|
|
268
297
|
|
|
269
298
|
@CaptureSpan()
|
|
@@ -271,7 +300,14 @@ export default class CodeRepositoryUtil {
|
|
|
271
300
|
repoPath: string;
|
|
272
301
|
username: string;
|
|
273
302
|
}): Promise<void> {
|
|
274
|
-
|
|
303
|
+
const setUsernameLogAttributes: LogAttributes = {
|
|
304
|
+
repoPath: data.repoPath,
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
logger.debug(
|
|
308
|
+
`Setting git user.name in ${path.resolve(data.repoPath)}`,
|
|
309
|
+
setUsernameLogAttributes,
|
|
310
|
+
);
|
|
275
311
|
|
|
276
312
|
const stdout: string = await this.runGitCommand(data.repoPath, [
|
|
277
313
|
"config",
|
|
@@ -279,7 +315,7 @@ export default class CodeRepositoryUtil {
|
|
|
279
315
|
data.username,
|
|
280
316
|
]);
|
|
281
317
|
|
|
282
|
-
logger.debug(stdout);
|
|
318
|
+
logger.debug(stdout, setUsernameLogAttributes);
|
|
283
319
|
}
|
|
284
320
|
|
|
285
321
|
@CaptureSpan()
|
|
@@ -287,7 +323,11 @@ export default class CodeRepositoryUtil {
|
|
|
287
323
|
repoPath: string;
|
|
288
324
|
message: string;
|
|
289
325
|
}): Promise<void> {
|
|
290
|
-
|
|
326
|
+
const commitLogAttributes: LogAttributes = {
|
|
327
|
+
repoPath: data.repoPath,
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
logger.debug("Executing git commit", commitLogAttributes);
|
|
291
331
|
|
|
292
332
|
const stdout: string = await Execute.executeCommandFile({
|
|
293
333
|
command: "git",
|
|
@@ -295,7 +335,7 @@ export default class CodeRepositoryUtil {
|
|
|
295
335
|
cwd: data.repoPath,
|
|
296
336
|
});
|
|
297
337
|
|
|
298
|
-
logger.debug(stdout);
|
|
338
|
+
logger.debug(stdout, commitLogAttributes);
|
|
299
339
|
}
|
|
300
340
|
|
|
301
341
|
@CaptureSpan()
|
|
@@ -323,7 +363,15 @@ export default class CodeRepositoryUtil {
|
|
|
323
363
|
`./${relativeTarget}`,
|
|
324
364
|
);
|
|
325
365
|
|
|
326
|
-
|
|
366
|
+
const commitHashLogAttributes: LogAttributes = {
|
|
367
|
+
repoPath: data.repoPath,
|
|
368
|
+
filePath: data.filePath,
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
logger.debug(
|
|
372
|
+
`Getting last commit hash for ${gitArgument} in ${repoRoot}`,
|
|
373
|
+
commitHashLogAttributes,
|
|
374
|
+
);
|
|
327
375
|
|
|
328
376
|
const hash: string = await this.runGitCommand(repoRoot, [
|
|
329
377
|
"log",
|
|
@@ -332,7 +380,7 @@ export default class CodeRepositoryUtil {
|
|
|
332
380
|
gitArgument,
|
|
333
381
|
]);
|
|
334
382
|
|
|
335
|
-
logger.debug(hash);
|
|
383
|
+
logger.debug(hash, commitHashLogAttributes);
|
|
336
384
|
|
|
337
385
|
return hash.trim();
|
|
338
386
|
}
|
|
@@ -490,6 +538,7 @@ export default class CodeRepositoryUtil {
|
|
|
490
538
|
return arg.includes(" ") ? `"${arg}"` : arg;
|
|
491
539
|
})
|
|
492
540
|
.join(" ")}`,
|
|
541
|
+
{ repoPath },
|
|
493
542
|
);
|
|
494
543
|
|
|
495
544
|
return Execute.executeCommandFile({
|
package/Server/Utils/Express.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface OneUptimeRequest extends express.Request {
|
|
|
37
37
|
userType?: UserType;
|
|
38
38
|
userAuthorization?: JSONWebTokenData;
|
|
39
39
|
tenantId?: ObjectID;
|
|
40
|
+
requestId?: string;
|
|
40
41
|
userGlobalAccessPermission?: UserGlobalAccessPermission;
|
|
41
42
|
userTenantAccessPermission?: Dictionary<UserTenantAccessPermission>; // tenantId <-> UserTenantAccessPermission;
|
|
42
43
|
rawFormUrlEncodedBody?: string;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import AcmeCertificateService from "../../Services/AcmeCertificateService";
|
|
7
7
|
import AcmeChallengeService from "../../Services/AcmeChallengeService";
|
|
8
8
|
import QueryHelper from "../../Types/Database/QueryHelper";
|
|
9
|
-
import logger from "../Logger";
|
|
9
|
+
import logger, { LogAttributes } from "../Logger";
|
|
10
10
|
import SortOrder from "../../../Types/BaseDatabase/SortOrder";
|
|
11
11
|
import LIMIT_MAX from "../../../Types/Database/LimitMax";
|
|
12
12
|
import OneUptimeDate from "../../../Types/Date";
|
|
@@ -56,6 +56,7 @@ export default class GreenlockUtil {
|
|
|
56
56
|
|
|
57
57
|
logger.debug(
|
|
58
58
|
`Found ${certificates.length} certificates which are expiring soon`,
|
|
59
|
+
{ certificateCount: certificates.length },
|
|
59
60
|
);
|
|
60
61
|
|
|
61
62
|
// order certificate for each domain
|
|
@@ -65,7 +66,14 @@ export default class GreenlockUtil {
|
|
|
65
66
|
continue;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
const certLogAttributes: LogAttributes = {
|
|
70
|
+
domain: certificate.domain,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
logger.debug(
|
|
74
|
+
`Renewing certificate for domain: ${certificate.domain}`,
|
|
75
|
+
certLogAttributes,
|
|
76
|
+
);
|
|
69
77
|
|
|
70
78
|
try {
|
|
71
79
|
//validate cname
|
|
@@ -76,6 +84,7 @@ export default class GreenlockUtil {
|
|
|
76
84
|
if (!isValidCname) {
|
|
77
85
|
logger.debug(
|
|
78
86
|
`CNAME is not valid for domain: ${certificate.domain}`,
|
|
87
|
+
certLogAttributes,
|
|
79
88
|
);
|
|
80
89
|
|
|
81
90
|
// if cname is not valid then remove the domain
|
|
@@ -84,9 +93,13 @@ export default class GreenlockUtil {
|
|
|
84
93
|
|
|
85
94
|
logger.error(
|
|
86
95
|
`Cname is not valid for domain: ${certificate.domain}`,
|
|
96
|
+
certLogAttributes,
|
|
87
97
|
);
|
|
88
98
|
} else {
|
|
89
|
-
logger.debug(
|
|
99
|
+
logger.debug(
|
|
100
|
+
`CNAME is valid for domain: ${certificate.domain}`,
|
|
101
|
+
certLogAttributes,
|
|
102
|
+
);
|
|
90
103
|
|
|
91
104
|
await GreenlockUtil.orderCert({
|
|
92
105
|
domain: certificate.domain,
|
|
@@ -95,13 +108,15 @@ export default class GreenlockUtil {
|
|
|
95
108
|
|
|
96
109
|
logger.debug(
|
|
97
110
|
`Certificate renewed for domain: ${certificate.domain}`,
|
|
111
|
+
certLogAttributes,
|
|
98
112
|
);
|
|
99
113
|
}
|
|
100
114
|
} catch (e) {
|
|
101
115
|
logger.error(
|
|
102
116
|
`Error renewing certificate for domain: ${certificate.domain}`,
|
|
117
|
+
certLogAttributes,
|
|
103
118
|
);
|
|
104
|
-
logger.error(e);
|
|
119
|
+
logger.error(e, certLogAttributes);
|
|
105
120
|
}
|
|
106
121
|
}
|
|
107
122
|
} catch (e) {
|
|
@@ -127,7 +142,7 @@ export default class GreenlockUtil {
|
|
|
127
142
|
},
|
|
128
143
|
});
|
|
129
144
|
} catch (err) {
|
|
130
|
-
logger.error(`Error removing domain: ${domain}
|
|
145
|
+
logger.error(`Error removing domain: ${domain}`, { domain });
|
|
131
146
|
throw err;
|
|
132
147
|
}
|
|
133
148
|
}
|
|
@@ -137,14 +152,20 @@ export default class GreenlockUtil {
|
|
|
137
152
|
domain: string;
|
|
138
153
|
validateCname: (domain: string) => Promise<boolean>;
|
|
139
154
|
}): Promise<void> {
|
|
155
|
+
const orderLogAttributes: LogAttributes = {
|
|
156
|
+
domain: data.domain,
|
|
157
|
+
};
|
|
158
|
+
|
|
140
159
|
try {
|
|
141
160
|
logger.debug(
|
|
142
161
|
`GreenlockUtil - Ordering certificate for domain: ${data.domain}`,
|
|
162
|
+
orderLogAttributes,
|
|
143
163
|
);
|
|
144
164
|
|
|
145
165
|
let { domain } = data;
|
|
146
166
|
|
|
147
167
|
domain = domain.trim().toLowerCase();
|
|
168
|
+
orderLogAttributes["domain"] = domain;
|
|
148
169
|
|
|
149
170
|
const acmeAccountKeyInBase64: string = LetsEncryptAccountKey;
|
|
150
171
|
|
|
@@ -163,20 +184,29 @@ export default class GreenlockUtil {
|
|
|
163
184
|
|
|
164
185
|
//validate cname
|
|
165
186
|
|
|
166
|
-
logger.debug(
|
|
187
|
+
logger.debug(
|
|
188
|
+
`Validating cname for domain: ${domain}`,
|
|
189
|
+
orderLogAttributes,
|
|
190
|
+
);
|
|
167
191
|
|
|
168
192
|
const isValidCname: boolean = await data.validateCname(domain);
|
|
169
193
|
|
|
170
194
|
if (!isValidCname) {
|
|
171
|
-
logger.debug(
|
|
172
|
-
|
|
195
|
+
logger.debug(
|
|
196
|
+
`CNAME is not valid for domain: ${domain}`,
|
|
197
|
+
orderLogAttributes,
|
|
198
|
+
);
|
|
199
|
+
logger.debug(`Removing domain: ${domain}`, orderLogAttributes);
|
|
173
200
|
|
|
174
201
|
await GreenlockUtil.removeDomain(domain);
|
|
175
|
-
logger.error(
|
|
202
|
+
logger.error(
|
|
203
|
+
`Cname is not valid for domain: ${domain}`,
|
|
204
|
+
orderLogAttributes,
|
|
205
|
+
);
|
|
176
206
|
throw new BadDataException("Cname is not valid for domain " + domain);
|
|
177
207
|
}
|
|
178
208
|
|
|
179
|
-
logger.debug(`Cname is valid for domain: ${domain}
|
|
209
|
+
logger.debug(`Cname is valid for domain: ${domain}`, orderLogAttributes);
|
|
180
210
|
|
|
181
211
|
const client: acme.Client = new acme.Client({
|
|
182
212
|
directoryUrl: acme.directory.letsencrypt.production,
|
|
@@ -187,7 +217,10 @@ export default class GreenlockUtil {
|
|
|
187
217
|
commonName: domain,
|
|
188
218
|
});
|
|
189
219
|
|
|
190
|
-
logger.debug(
|
|
220
|
+
logger.debug(
|
|
221
|
+
`Ordering certificate for domain: ${domain}`,
|
|
222
|
+
orderLogAttributes,
|
|
223
|
+
);
|
|
191
224
|
|
|
192
225
|
const certificate: string = await client.auto({
|
|
193
226
|
csr: certificateRequest,
|
|
@@ -204,6 +237,7 @@ export default class GreenlockUtil {
|
|
|
204
237
|
if (challenge.type === "http-01") {
|
|
205
238
|
logger.debug(
|
|
206
239
|
`Creating challenge for domain: ${authz.identifier.value}`,
|
|
240
|
+
orderLogAttributes,
|
|
207
241
|
);
|
|
208
242
|
|
|
209
243
|
const acmeChallenge: AcmeChallenge = new AcmeChallenge();
|
|
@@ -220,6 +254,7 @@ export default class GreenlockUtil {
|
|
|
220
254
|
|
|
221
255
|
logger.debug(
|
|
222
256
|
`Challenge created for domain: ${authz.identifier.value}`,
|
|
257
|
+
orderLogAttributes,
|
|
223
258
|
);
|
|
224
259
|
}
|
|
225
260
|
},
|
|
@@ -231,6 +266,7 @@ export default class GreenlockUtil {
|
|
|
231
266
|
|
|
232
267
|
logger.debug(
|
|
233
268
|
`Removing challenge for domain: ${authz.identifier.value}`,
|
|
269
|
+
orderLogAttributes,
|
|
234
270
|
);
|
|
235
271
|
|
|
236
272
|
if (challenge.type === "http-01") {
|
|
@@ -248,11 +284,15 @@ export default class GreenlockUtil {
|
|
|
248
284
|
|
|
249
285
|
logger.debug(
|
|
250
286
|
`Challenge removed for domain: ${authz.identifier.value}`,
|
|
287
|
+
orderLogAttributes,
|
|
251
288
|
);
|
|
252
289
|
},
|
|
253
290
|
});
|
|
254
291
|
|
|
255
|
-
logger.debug(
|
|
292
|
+
logger.debug(
|
|
293
|
+
`Certificate ordered for domain: ${domain}`,
|
|
294
|
+
orderLogAttributes,
|
|
295
|
+
);
|
|
256
296
|
|
|
257
297
|
// get expires at date from certificate
|
|
258
298
|
const cert: acme.CertificateInfo =
|
|
@@ -260,8 +300,8 @@ export default class GreenlockUtil {
|
|
|
260
300
|
const issuedAt: Date = cert.notBefore;
|
|
261
301
|
const expiresAt: Date = cert.notAfter;
|
|
262
302
|
|
|
263
|
-
logger.debug(`Certificate expires at: ${expiresAt}
|
|
264
|
-
logger.debug(`Certificate issued at: ${issuedAt}
|
|
303
|
+
logger.debug(`Certificate expires at: ${expiresAt}`, orderLogAttributes);
|
|
304
|
+
logger.debug(`Certificate issued at: ${issuedAt}`, orderLogAttributes);
|
|
265
305
|
|
|
266
306
|
// check if the certificate is already in the database.
|
|
267
307
|
const existingCertificate: AcmeCertificate | null =
|
|
@@ -278,7 +318,10 @@ export default class GreenlockUtil {
|
|
|
278
318
|
});
|
|
279
319
|
|
|
280
320
|
if (existingCertificate) {
|
|
281
|
-
logger.debug(
|
|
321
|
+
logger.debug(
|
|
322
|
+
`Updating certificate for domain: ${domain}`,
|
|
323
|
+
orderLogAttributes,
|
|
324
|
+
);
|
|
282
325
|
|
|
283
326
|
// update the certificate
|
|
284
327
|
await AcmeCertificateService.updateBy({
|
|
@@ -298,9 +341,15 @@ export default class GreenlockUtil {
|
|
|
298
341
|
},
|
|
299
342
|
});
|
|
300
343
|
|
|
301
|
-
logger.debug(
|
|
344
|
+
logger.debug(
|
|
345
|
+
`Certificate updated for domain: ${domain}`,
|
|
346
|
+
orderLogAttributes,
|
|
347
|
+
);
|
|
302
348
|
} else {
|
|
303
|
-
logger.debug(
|
|
349
|
+
logger.debug(
|
|
350
|
+
`Creating certificate for domain: ${domain}`,
|
|
351
|
+
orderLogAttributes,
|
|
352
|
+
);
|
|
304
353
|
// create the certificate
|
|
305
354
|
const acmeCertificate: AcmeCertificate = new AcmeCertificate();
|
|
306
355
|
|
|
@@ -317,11 +366,17 @@ export default class GreenlockUtil {
|
|
|
317
366
|
},
|
|
318
367
|
});
|
|
319
368
|
|
|
320
|
-
logger.debug(
|
|
369
|
+
logger.debug(
|
|
370
|
+
`Certificate created for domain: ${domain}`,
|
|
371
|
+
orderLogAttributes,
|
|
372
|
+
);
|
|
321
373
|
}
|
|
322
374
|
} catch (e) {
|
|
323
|
-
logger.error(
|
|
324
|
-
|
|
375
|
+
logger.error(
|
|
376
|
+
`Error ordering certificate for domain: ${data.domain}`,
|
|
377
|
+
orderLogAttributes,
|
|
378
|
+
);
|
|
379
|
+
logger.error(e, orderLogAttributes);
|
|
325
380
|
|
|
326
381
|
if (e instanceof Exception) {
|
|
327
382
|
throw e;
|
|
@@ -5,7 +5,7 @@ import { JSONObject } from "../../../Types/JSON";
|
|
|
5
5
|
import API from "../../../Utils/API";
|
|
6
6
|
import LlmType from "../../../Types/LLM/LlmType";
|
|
7
7
|
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
8
|
-
import logger from "../Logger";
|
|
8
|
+
import logger, { LogAttributes } from "../Logger";
|
|
9
9
|
import CaptureSpan from "../Telemetry/CaptureSpan";
|
|
10
10
|
|
|
11
11
|
export interface LLMMessage {
|
|
@@ -92,9 +92,14 @@ export default class LLMService {
|
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
+
const openAILogAttributes: LogAttributes = {
|
|
96
|
+
llmType: config.llmType,
|
|
97
|
+
modelName: modelName,
|
|
98
|
+
};
|
|
99
|
+
|
|
95
100
|
if (response instanceof HTTPErrorResponse) {
|
|
96
|
-
logger.error("Error from OpenAI API:");
|
|
97
|
-
logger.error(response);
|
|
101
|
+
logger.error("Error from OpenAI API:", openAILogAttributes);
|
|
102
|
+
logger.error(response, openAILogAttributes);
|
|
98
103
|
throw new BadDataException(
|
|
99
104
|
`OpenAI API error: ${JSON.stringify(response.jsonData)}`,
|
|
100
105
|
);
|
|
@@ -175,9 +180,14 @@ export default class LLMService {
|
|
|
175
180
|
},
|
|
176
181
|
});
|
|
177
182
|
|
|
183
|
+
const anthropicLogAttributes: LogAttributes = {
|
|
184
|
+
llmType: config.llmType,
|
|
185
|
+
modelName: modelName,
|
|
186
|
+
};
|
|
187
|
+
|
|
178
188
|
if (response instanceof HTTPErrorResponse) {
|
|
179
|
-
logger.error("Error from Anthropic API:");
|
|
180
|
-
logger.error(response);
|
|
189
|
+
logger.error("Error from Anthropic API:", anthropicLogAttributes);
|
|
190
|
+
logger.error(response, anthropicLogAttributes);
|
|
181
191
|
throw new BadDataException(
|
|
182
192
|
`Anthropic API error: ${JSON.stringify(response.jsonData)}`,
|
|
183
193
|
);
|
|
@@ -253,9 +263,14 @@ export default class LLMService {
|
|
|
253
263
|
},
|
|
254
264
|
});
|
|
255
265
|
|
|
266
|
+
const ollamaLogAttributes: LogAttributes = {
|
|
267
|
+
llmType: config.llmType,
|
|
268
|
+
modelName: modelName,
|
|
269
|
+
};
|
|
270
|
+
|
|
256
271
|
if (response instanceof HTTPErrorResponse) {
|
|
257
|
-
logger.error("Error from Ollama API:");
|
|
258
|
-
logger.error(response);
|
|
272
|
+
logger.error("Error from Ollama API:", ollamaLogAttributes);
|
|
273
|
+
logger.error(response, ollamaLogAttributes);
|
|
259
274
|
throw new BadDataException(
|
|
260
275
|
`Ollama API error: ${JSON.stringify(response.jsonData)}`,
|
|
261
276
|
);
|