@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.
- 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/TelemetryAPI.ts +81 -0
- 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/LabelService.ts +14 -1
- package/Server/Services/MonitorFeedService.ts +33 -9
- package/Server/Services/MonitorProbeService.ts +31 -2
- 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 +29 -11
- 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/TelemetryAttributeService.ts +117 -4
- 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/BulkUpdate/BulkUpdateForm.tsx +60 -38
- 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/Dictionary/Dictionary.tsx +13 -1
- package/UI/Components/Filters/FiltersForm.tsx +2 -0
- package/UI/Components/Filters/JSONFilter.tsx +5 -1
- package/UI/Components/Filters/Types/Filter.ts +2 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
- package/UI/Components/ModelTable/BaseModelTable.tsx +10 -6
- 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/TelemetryAPI.js +39 -0
- package/build/dist/Server/API/TelemetryAPI.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/LabelService.js +10 -1
- package/build/dist/Server/Services/LabelService.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 +23 -3
- 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 +41 -21
- 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/TelemetryAttributeService.js +83 -6
- package/build/dist/Server/Services/TelemetryAttributeService.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/BulkUpdate/BulkUpdateForm.js +31 -30
- package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.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/Dictionary/Dictionary.js +9 -1
- package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
- package/build/dist/UI/Components/Filters/FiltersForm.js +1 -1
- package/build/dist/UI/Components/Filters/FiltersForm.js.map +1 -1
- package/build/dist/UI/Components/Filters/JSONFilter.js +1 -1
- package/build/dist/UI/Components/Filters/JSONFilter.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +9 -5
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- 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
|
@@ -8,7 +8,7 @@ import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
|
8
8
|
import Select from "../Types/Database/Select";
|
|
9
9
|
import UpdateBy from "../Types/Database/UpdateBy";
|
|
10
10
|
import Errors from "../Utils/Errors";
|
|
11
|
-
import logger from "../Utils/Logger";
|
|
11
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
12
12
|
import AccessTokenService from "./AccessTokenService";
|
|
13
13
|
import BillingService from "./BillingService";
|
|
14
14
|
import DatabaseService from "./DatabaseService";
|
|
@@ -180,7 +180,10 @@ export class TeamMemberService extends DatabaseService<TeamMember> {
|
|
|
180
180
|
userId: user.id!,
|
|
181
181
|
},
|
|
182
182
|
).catch((err: Error) => {
|
|
183
|
-
logger.error(err
|
|
183
|
+
logger.error(err, {
|
|
184
|
+
projectId: createBy.data.projectId?.toString(),
|
|
185
|
+
userId: user?.id?.toString(),
|
|
186
|
+
} as LogAttributes);
|
|
184
187
|
});
|
|
185
188
|
}
|
|
186
189
|
}
|
|
@@ -326,7 +329,10 @@ export class TeamMemberService extends DatabaseService<TeamMember> {
|
|
|
326
329
|
userId: member.userId!,
|
|
327
330
|
endsAt: OneUptimeDate.getCurrentDate(),
|
|
328
331
|
}).catch((err: Error) => {
|
|
329
|
-
logger.error(err
|
|
332
|
+
logger.error(err, {
|
|
333
|
+
projectId: member.projectId?.toString(),
|
|
334
|
+
userId: member.userId?.toString(),
|
|
335
|
+
} as LogAttributes);
|
|
330
336
|
});
|
|
331
337
|
|
|
332
338
|
if (member.team?.shouldHaveAtLeastOneMember) {
|
|
@@ -71,6 +71,7 @@ export class TelemetryAttributeService {
|
|
|
71
71
|
public async fetchAttributes(data: {
|
|
72
72
|
projectId: ObjectID;
|
|
73
73
|
telemetryType: TelemetryType;
|
|
74
|
+
metricName?: string | undefined;
|
|
74
75
|
}): Promise<string[]> {
|
|
75
76
|
const source: TelemetrySource | null = this.getTelemetrySource(
|
|
76
77
|
data.telemetryType,
|
|
@@ -83,6 +84,7 @@ export class TelemetryAttributeService {
|
|
|
83
84
|
const cacheKey: string = TelemetryAttributeService.getCacheKey(
|
|
84
85
|
data.projectId,
|
|
85
86
|
data.telemetryType,
|
|
87
|
+
data.metricName,
|
|
86
88
|
);
|
|
87
89
|
|
|
88
90
|
const cachedEntry: TelemetryAttributesCacheEntry | null =
|
|
@@ -98,6 +100,7 @@ export class TelemetryAttributeService {
|
|
|
98
100
|
attributes = await TelemetryAttributeService.fetchAttributesFromDatabase({
|
|
99
101
|
projectId: data.projectId,
|
|
100
102
|
source,
|
|
103
|
+
metricName: data.metricName,
|
|
101
104
|
});
|
|
102
105
|
} catch (error) {
|
|
103
106
|
if (cachedEntry) {
|
|
@@ -122,8 +125,13 @@ export class TelemetryAttributeService {
|
|
|
122
125
|
private static getCacheKey(
|
|
123
126
|
projectId: ObjectID,
|
|
124
127
|
telemetryType: TelemetryType,
|
|
128
|
+
metricName?: string | undefined,
|
|
125
129
|
): string {
|
|
126
|
-
|
|
130
|
+
const base: string = `${projectId.toString()}:${telemetryType}`;
|
|
131
|
+
if (metricName) {
|
|
132
|
+
return `${base}:${metricName}`;
|
|
133
|
+
}
|
|
134
|
+
return base;
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
private static getLookbackStartDate(): Date {
|
|
@@ -219,6 +227,7 @@ export class TelemetryAttributeService {
|
|
|
219
227
|
attributesColumn: string;
|
|
220
228
|
attributeKeysColumn: string;
|
|
221
229
|
timeColumn: string;
|
|
230
|
+
metricName?: string | undefined;
|
|
222
231
|
}): Statement {
|
|
223
232
|
const lookbackStartDate: Date =
|
|
224
233
|
TelemetryAttributeService.getLookbackStartDate();
|
|
@@ -244,7 +253,20 @@ export class TelemetryAttributeService {
|
|
|
244
253
|
AND ${data.timeColumn} >= ${{
|
|
245
254
|
type: TableColumnType.Date,
|
|
246
255
|
value: lookbackStartDate,
|
|
247
|
-
}}
|
|
256
|
+
}}`;
|
|
257
|
+
|
|
258
|
+
if (data.metricName) {
|
|
259
|
+
statement.append(
|
|
260
|
+
SQL`
|
|
261
|
+
AND name = ${{
|
|
262
|
+
type: TableColumnType.Text,
|
|
263
|
+
value: data.metricName,
|
|
264
|
+
}}`,
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
statement.append(
|
|
269
|
+
SQL`
|
|
248
270
|
ORDER BY ${data.timeColumn} DESC
|
|
249
271
|
LIMIT ${{
|
|
250
272
|
type: TableColumnType.Number,
|
|
@@ -258,8 +280,8 @@ export class TelemetryAttributeService {
|
|
|
258
280
|
LIMIT ${{
|
|
259
281
|
type: TableColumnType.Number,
|
|
260
282
|
value: TelemetryAttributeService.ATTRIBUTES_LIMIT,
|
|
261
|
-
}}
|
|
262
|
-
|
|
283
|
+
}}`,
|
|
284
|
+
);
|
|
263
285
|
|
|
264
286
|
return statement;
|
|
265
287
|
}
|
|
@@ -267,6 +289,7 @@ export class TelemetryAttributeService {
|
|
|
267
289
|
private static async fetchAttributesFromDatabase(data: {
|
|
268
290
|
projectId: ObjectID;
|
|
269
291
|
source: TelemetrySource;
|
|
292
|
+
metricName?: string | undefined;
|
|
270
293
|
}): Promise<Array<string>> {
|
|
271
294
|
const statement: Statement =
|
|
272
295
|
TelemetryAttributeService.buildAttributesStatement({
|
|
@@ -275,6 +298,7 @@ export class TelemetryAttributeService {
|
|
|
275
298
|
attributesColumn: data.source.attributesColumn,
|
|
276
299
|
attributeKeysColumn: data.source.attributeKeysColumn,
|
|
277
300
|
timeColumn: data.source.timeColumn,
|
|
301
|
+
metricName: data.metricName,
|
|
278
302
|
});
|
|
279
303
|
|
|
280
304
|
const dbResult: Results = await data.source.service.executeQuery(statement);
|
|
@@ -295,6 +319,95 @@ export class TelemetryAttributeService {
|
|
|
295
319
|
|
|
296
320
|
return Array.from(new Set(attributeKeys));
|
|
297
321
|
}
|
|
322
|
+
|
|
323
|
+
private static readonly ATTRIBUTE_VALUES_LIMIT: number = 100;
|
|
324
|
+
|
|
325
|
+
@CaptureSpan()
|
|
326
|
+
public async fetchAttributeValues(data: {
|
|
327
|
+
projectId: ObjectID;
|
|
328
|
+
telemetryType: TelemetryType;
|
|
329
|
+
metricName?: string | undefined;
|
|
330
|
+
attributeKey: string;
|
|
331
|
+
}): Promise<string[]> {
|
|
332
|
+
const source: TelemetrySource | null = this.getTelemetrySource(
|
|
333
|
+
data.telemetryType,
|
|
334
|
+
);
|
|
335
|
+
|
|
336
|
+
if (!source) {
|
|
337
|
+
return [];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return TelemetryAttributeService.fetchAttributeValuesFromDatabase({
|
|
341
|
+
projectId: data.projectId,
|
|
342
|
+
source,
|
|
343
|
+
metricName: data.metricName,
|
|
344
|
+
attributeKey: data.attributeKey,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
private static async fetchAttributeValuesFromDatabase(data: {
|
|
349
|
+
projectId: ObjectID;
|
|
350
|
+
source: TelemetrySource;
|
|
351
|
+
metricName?: string | undefined;
|
|
352
|
+
attributeKey: string;
|
|
353
|
+
}): Promise<Array<string>> {
|
|
354
|
+
const lookbackStartDate: Date =
|
|
355
|
+
TelemetryAttributeService.getLookbackStartDate();
|
|
356
|
+
|
|
357
|
+
const statement: Statement = SQL`
|
|
358
|
+
SELECT DISTINCT ${data.source.attributesColumn}[${{
|
|
359
|
+
type: TableColumnType.Text,
|
|
360
|
+
value: data.attributeKey,
|
|
361
|
+
}}] AS attributeValue
|
|
362
|
+
FROM ${data.source.tableName}
|
|
363
|
+
WHERE projectId = ${{
|
|
364
|
+
type: TableColumnType.ObjectID,
|
|
365
|
+
value: data.projectId,
|
|
366
|
+
}}
|
|
367
|
+
AND ${data.source.timeColumn} >= ${{
|
|
368
|
+
type: TableColumnType.Date,
|
|
369
|
+
value: lookbackStartDate,
|
|
370
|
+
}}
|
|
371
|
+
AND mapContains(${data.source.attributesColumn}, ${{
|
|
372
|
+
type: TableColumnType.Text,
|
|
373
|
+
value: data.attributeKey,
|
|
374
|
+
}})`;
|
|
375
|
+
|
|
376
|
+
if (data.metricName) {
|
|
377
|
+
statement.append(
|
|
378
|
+
SQL`
|
|
379
|
+
AND name = ${{
|
|
380
|
+
type: TableColumnType.Text,
|
|
381
|
+
value: data.metricName,
|
|
382
|
+
}}`,
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
statement.append(
|
|
387
|
+
SQL`
|
|
388
|
+
ORDER BY attributeValue ASC
|
|
389
|
+
LIMIT ${{
|
|
390
|
+
type: TableColumnType.Number,
|
|
391
|
+
value: TelemetryAttributeService.ATTRIBUTE_VALUES_LIMIT,
|
|
392
|
+
}}`,
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
const dbResult: Results = await data.source.service.executeQuery(statement);
|
|
396
|
+
const response: DbJSONResponse = await dbResult.json<{
|
|
397
|
+
data?: Array<JSONObject>;
|
|
398
|
+
}>();
|
|
399
|
+
|
|
400
|
+
const rows: Array<JSONObject> = response.data || [];
|
|
401
|
+
|
|
402
|
+
return rows
|
|
403
|
+
.map((row: JSONObject) => {
|
|
404
|
+
const val: unknown = row["attributeValue"];
|
|
405
|
+
return typeof val === "string" ? val.trim() : null;
|
|
406
|
+
})
|
|
407
|
+
.filter((val: string | null): val is string => {
|
|
408
|
+
return Boolean(val);
|
|
409
|
+
});
|
|
410
|
+
}
|
|
298
411
|
}
|
|
299
412
|
|
|
300
413
|
export default new TelemetryAttributeService();
|
|
@@ -66,7 +66,7 @@ import NotificationRuleEventType from "../../Types/Workspace/NotificationRules/E
|
|
|
66
66
|
import NotificationRuleWorkspaceChannel from "../../Types/Workspace/NotificationRules/NotificationRuleWorkspaceChannel";
|
|
67
67
|
import PushNotificationUtil from "../Utils/PushNotificationUtil";
|
|
68
68
|
import PushNotificationMessage from "../../Types/PushNotification/PushNotificationMessage";
|
|
69
|
-
import logger from "../Utils/Logger";
|
|
69
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
70
70
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
71
71
|
|
|
72
72
|
export interface NotificationMethodDescriptor {
|
|
@@ -2207,7 +2207,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
2207
2207
|
incidentId: options.triggeredByIncidentId,
|
|
2208
2208
|
userId: userId,
|
|
2209
2209
|
}).catch((error: Error) => {
|
|
2210
|
-
logger.error(error
|
|
2210
|
+
logger.error(error, {
|
|
2211
|
+
projectId: options.projectId?.toString(),
|
|
2212
|
+
userId: userId?.toString(),
|
|
2213
|
+
} as LogAttributes);
|
|
2211
2214
|
});
|
|
2212
2215
|
}
|
|
2213
2216
|
|
|
@@ -2266,7 +2269,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
2266
2269
|
userIds: [data.userId],
|
|
2267
2270
|
},
|
|
2268
2271
|
).catch((error: Error) => {
|
|
2269
|
-
logger.error(error
|
|
2272
|
+
logger.error(error, {
|
|
2273
|
+
projectId: data.projectId?.toString(),
|
|
2274
|
+
userId: data.userId?.toString(),
|
|
2275
|
+
} as LogAttributes);
|
|
2270
2276
|
});
|
|
2271
2277
|
}
|
|
2272
2278
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import { OnCreate, OnDelete, OnUpdate } from "../Types/Database/Hooks";
|
|
7
7
|
import UpdateBy from "../Types/Database/UpdateBy";
|
|
8
8
|
import DeleteBy from "../Types/Database/DeleteBy";
|
|
9
|
-
import logger from "../Utils/Logger";
|
|
9
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
10
10
|
import DatabaseService from "./DatabaseService";
|
|
11
11
|
import EmailVerificationTokenService from "./EmailVerificationTokenService";
|
|
12
12
|
import MailService from "./MailService";
|
|
@@ -97,7 +97,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
97
97
|
*Company:* ${createdItem.companyName?.toString() || "N/A"}`,
|
|
98
98
|
}).catch((err: Error) => {
|
|
99
99
|
// log this error but do not throw it. Not important enough to stop the process.
|
|
100
|
-
logger.error(err
|
|
100
|
+
logger.error(err, {
|
|
101
|
+
userId: createdItem.id?.toString(),
|
|
102
|
+
} as LogAttributes);
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
105
|
|
|
@@ -267,7 +269,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
267
269
|
homeURL: new URL(httpProtocol, host).toString(),
|
|
268
270
|
},
|
|
269
271
|
}).catch((err: Error) => {
|
|
270
|
-
logger.error(err);
|
|
272
|
+
logger.error(err, { userId: user.id?.toString() } as LogAttributes);
|
|
271
273
|
});
|
|
272
274
|
}
|
|
273
275
|
}
|
|
@@ -378,7 +380,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
378
380
|
homeUrl: new URL(httpProtocol, host).toString(),
|
|
379
381
|
},
|
|
380
382
|
}).catch((err: Error) => {
|
|
381
|
-
logger.error(err);
|
|
383
|
+
logger.error(err, { userId: user.id?.toString() } as LogAttributes);
|
|
382
384
|
});
|
|
383
385
|
|
|
384
386
|
await this.updateOneBy({
|
|
@@ -2,7 +2,7 @@ import { IsBillingEnabled } from "../EnvironmentConfig";
|
|
|
2
2
|
import CreateBy from "../Types/Database/CreateBy";
|
|
3
3
|
import DeleteBy from "../Types/Database/DeleteBy";
|
|
4
4
|
import { OnCreate, OnDelete } from "../Types/Database/Hooks";
|
|
5
|
-
import logger from "../Utils/Logger";
|
|
5
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
6
6
|
import DatabaseService from "./DatabaseService";
|
|
7
7
|
import ProjectService from "./ProjectService";
|
|
8
8
|
import UserNotificationRuleService from "./UserNotificationRuleService";
|
|
@@ -117,7 +117,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
117
117
|
): Promise<Model> {
|
|
118
118
|
if (!createdItem.isVerified) {
|
|
119
119
|
this.sendVerificationCode(createdItem).catch((error: Error) => {
|
|
120
|
-
logger.error(error
|
|
120
|
+
logger.error(error, {
|
|
121
|
+
projectId: createdItem.projectId?.toString(),
|
|
122
|
+
userId: createdItem.userId?.toString(),
|
|
123
|
+
} as LogAttributes);
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
|
|
@@ -167,7 +170,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
167
170
|
|
|
168
171
|
public async sendVerificationCode(item: Model): Promise<void> {
|
|
169
172
|
if (!item.projectId || !item.userId || !item.phone) {
|
|
170
|
-
logger.warn("Cannot send WhatsApp verification code. Missing data."
|
|
173
|
+
logger.warn("Cannot send WhatsApp verification code. Missing data.", {
|
|
174
|
+
projectId: item.projectId?.toString(),
|
|
175
|
+
userId: item.userId?.toString(),
|
|
176
|
+
} as LogAttributes);
|
|
171
177
|
throw new BadDataException(
|
|
172
178
|
"Unable to send WhatsApp verification code. Please remove this number and add it again.",
|
|
173
179
|
);
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "../../Types/Workflow/Component";
|
|
17
17
|
import API from "../../Utils/API";
|
|
18
18
|
import Model from "../../Models/DatabaseModels/Workflow";
|
|
19
|
-
import logger from "../Utils/Logger";
|
|
19
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
20
20
|
import UUID from "../../Utils/UUID";
|
|
21
21
|
|
|
22
22
|
export class Service extends DatabaseService<Model> {
|
|
@@ -93,7 +93,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
logger.debug("Updating workflow on the workflow service"
|
|
96
|
+
logger.debug("Updating workflow on the workflow service", {
|
|
97
|
+
workflowId: onUpdate.updateBy.query._id?.toString(),
|
|
98
|
+
} as LogAttributes);
|
|
97
99
|
|
|
98
100
|
await API.post<EmptyResponseData>({
|
|
99
101
|
url: new URL(
|
|
@@ -107,7 +109,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
107
109
|
},
|
|
108
110
|
});
|
|
109
111
|
|
|
110
|
-
logger.debug("Updated workflow on the workflow service"
|
|
112
|
+
logger.debug("Updated workflow on the workflow service", {
|
|
113
|
+
workflowId: onUpdate.updateBy.query._id?.toString(),
|
|
114
|
+
} as LogAttributes);
|
|
111
115
|
|
|
112
116
|
return onUpdate;
|
|
113
117
|
}
|