@oneuptime/common 8.0.5239 → 8.0.5285
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/DatabaseModels/Index.ts +4 -2
- package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts +5 -3
- package/Models/DatabaseModels/Project.ts +4 -2
- package/Models/DatabaseModels/ProjectSmtpConfig.ts +4 -2
- package/Models/DatabaseModels/StatusPageDomain.ts +6 -4
- package/Models/DatabaseModels/User.ts +0 -46
- package/Models/DatabaseModels/{UserTwoFactorAuth.ts → UserTotpAuth.ts} +16 -16
- package/Models/DatabaseModels/UserWebAuthn.ts +244 -0
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.ts +21 -0
- package/Server/API/BaseAPI.ts +4 -2
- package/Server/API/GlobalConfigAPI.ts +16 -12
- package/Server/API/MicrosoftTeamsAPI.ts +1240 -0
- package/Server/API/ProjectAPI.ts +4 -2
- package/Server/API/ResellerPlanAPI.ts +4 -2
- package/Server/API/SlackAPI.ts +54 -48
- package/Server/API/StatusPageAPI.ts +5 -3
- package/Server/API/UserOnCallLogTimelineAPI.ts +5 -3
- package/Server/API/{UserTwoFactorAuthAPI.ts → UserTotpAuthAPI.ts} +20 -20
- package/Server/API/UserWebAuthnAPI.ts +103 -0
- package/Server/EnvironmentConfig.ts +6 -0
- package/Server/Images/MicrosoftTeams/color.png +0 -0
- package/Server/Images/MicrosoftTeams/outline.png +0 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.ts +4 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1759175457008-MigrationName.ts +27 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1759232954703-MigrationName.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1759234532998-MigrationName.ts +15 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
- package/Server/Infrastructure/Queue.ts +4 -2
- package/Server/Infrastructure/SocketIO.ts +4 -2
- package/Server/Middleware/ProjectAuthorization.ts +5 -3
- package/Server/Middleware/SlackAuthorization.ts +2 -2
- package/Server/Middleware/TelemetryIngest.ts +12 -6
- package/Server/Services/AlertStateTimelineService.ts +34 -18
- package/Server/Services/BillingInvoiceService.ts +8 -4
- package/Server/Services/BillingService.ts +13 -9
- package/Server/Services/DatabaseService.ts +42 -30
- package/Server/Services/IncidentService.ts +5 -3
- package/Server/Services/IncidentStateTimelineService.ts +34 -18
- package/Server/Services/Index.ts +4 -2
- package/Server/Services/MonitorStatusTimelineService.ts +34 -18
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +4 -2
- package/Server/Services/ProjectService.ts +6 -4
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +26 -14
- package/Server/Services/StatusPageService.ts +4 -2
- package/Server/Services/UserService.ts +21 -5
- package/Server/Services/{UserTwoFactorAuthService.ts → UserTotpAuthService.ts} +26 -7
- package/Server/Services/UserWebAuthnService.ts +419 -0
- package/Server/Services/WorkspaceNotificationRuleService.ts +257 -77
- package/Server/Services/WorkspaceProjectAuthTokenService.ts +2 -2
- package/Server/Types/AnalyticsDatabase/ModelPermission.ts +9 -5
- package/Server/Types/Database/Permissions/BasePermission.ts +4 -2
- package/Server/Types/Database/Permissions/TenantPermission.ts +5 -3
- package/Server/Types/Database/QueryHelper.ts +4 -2
- package/Server/Types/Markdown.ts +6 -4
- package/Server/Types/Workflow/ComponentCode.ts +4 -2
- package/Server/Types/Workflow/Components/Conditions/IfElse.ts +5 -3
- package/Server/Types/Workflow/Components/JavaScript.ts +5 -3
- package/Server/Types/Workflow/TriggerCode.ts +4 -2
- package/Server/Utils/AnalyticsDatabase/Statement.ts +4 -2
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +21 -11
- package/Server/Utils/Browser.ts +6 -4
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +4 -2
- package/Server/Utils/LocalFile.ts +14 -0
- package/Server/Utils/Monitor/MonitorResource.ts +17 -9
- package/Server/Utils/Realtime.ts +4 -2
- package/Server/Utils/StartServer.ts +1 -1
- package/Server/Utils/Telemetry.ts +15 -9
- package/Server/Utils/{TwoFactorAuth.ts → TotpAuth.ts} +2 -2
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.ts +75 -16
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +649 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +237 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +1321 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +155 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +119 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +959 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts +16 -14
- package/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts +17 -14
- package/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts +18 -13
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +2547 -14
- package/Server/Utils/Workspace/Slack/Actions/Alert.ts +4 -2
- package/Server/Utils/Workspace/Slack/Actions/Auth.ts +4 -2
- package/Server/Utils/Workspace/Slack/Actions/Incident.ts +14 -10
- package/Server/Utils/Workspace/Slack/Actions/Monitor.ts +4 -2
- package/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts +4 -2
- package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +14 -10
- package/Server/Utils/Workspace/Slack/Messages/Alert.ts +9 -7
- package/Server/Utils/Workspace/Slack/Messages/Incident.ts +9 -7
- package/Server/Utils/Workspace/Slack/Messages/Monitor.ts +9 -7
- package/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts +9 -7
- package/Server/Utils/Workspace/Slack/Slack.ts +6 -0
- package/Server/Utils/Workspace/Workspace.ts +13 -10
- package/Server/Utils/Workspace/WorkspaceBase.ts +9 -0
- package/Tests/Server/API/BaseAPI.test.ts +64 -52
- package/Tests/Server/Services/BillingService.test.ts +4 -4
- package/Tests/Server/Services/TeamMemberService.test.ts +20 -12
- package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +2 -2
- package/Tests/Types/OnCallDutyPolicy/LayerUtil.test.ts +8 -4
- package/Tests/UI/Components/DictionaryOfStrings.test.tsx +4 -2
- package/Tests/UI/Components/FilePicker.test.tsx +2 -2
- package/Tests/Utils/API.test.ts +9 -8
- package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts +5 -3
- package/Types/Html.ts +5 -3
- package/Types/JSONFunctions.ts +5 -5
- package/Types/Metrics/MetricsQuery.ts +6 -4
- package/Types/Monitor/MonitorType.ts +8 -6
- package/Types/OnCallDutyPolicy/Layer.ts +29 -17
- package/Types/Phone.ts +5 -3
- package/Types/Workspace/NotificationRules/BaseNotificationRule.ts +1 -0
- package/Types/Workspace/NotificationRules/CreateChannelNotificationRule.ts +5 -2
- package/Types/Workspace/WorkspaceMessagePayload.ts +1 -0
- package/Types/Workspace/WorkspaceType.ts +13 -0
- package/UI/Components/Charts/Utils/DataPoint.ts +8 -6
- package/UI/Components/Detail/Detail.tsx +4 -1
- package/UI/Components/FilePicker/FilePicker.tsx +1 -1
- package/UI/Components/Forms/Types/Field.ts +4 -2
- package/UI/Components/Image/Image.tsx +1 -1
- package/UI/Components/JSONTable/JSONTable.tsx +4 -2
- package/UI/Components/ModelTable/BaseModelTable.tsx +5 -3
- package/UI/Components/SideMenu/SideMenu.tsx +4 -2
- package/UI/Components/SideMenu/SideMenuItem.tsx +69 -45
- package/UI/Config.ts +3 -0
- package/UI/Utils/API/API.ts +5 -3
- package/UI/Utils/Countries.ts +5 -3
- package/UI/Utils/Login.ts +6 -1
- package/Utils/Base64.ts +13 -0
- package/Utils/Schema/ModelSchema.ts +4 -2
- package/build/dist/Models/DatabaseModels/Index.js +4 -2
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +5 -3
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +4 -2
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectSmtpConfig.js +4 -2
- package/build/dist/Models/DatabaseModels/ProjectSmtpConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js +6 -4
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/User.js +0 -49
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Models/DatabaseModels/{UserTwoFactorAuth.js → UserTotpAuth.js} +27 -27
- package/build/dist/Models/DatabaseModels/UserTotpAuth.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserWebAuthn.js +270 -0
- package/build/dist/Models/DatabaseModels/UserWebAuthn.js.map +1 -0
- package/build/dist/Models/DatabaseModels/WorkspaceProjectAuthToken.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +4 -2
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/GlobalConfigAPI.js +16 -12
- package/build/dist/Server/API/GlobalConfigAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +771 -0
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -0
- package/build/dist/Server/API/ProjectAPI.js +4 -2
- package/build/dist/Server/API/ProjectAPI.js.map +1 -1
- package/build/dist/Server/API/ResellerPlanAPI.js +4 -2
- package/build/dist/Server/API/ResellerPlanAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +53 -47
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +5 -3
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +5 -3
- package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
- package/build/dist/Server/API/{UserTwoFactorAuthAPI.js → UserTotpAuthAPI.js} +16 -16
- package/build/dist/Server/API/UserTotpAuthAPI.js.map +1 -0
- package/build/dist/Server/API/UserWebAuthnAPI.js +65 -0
- package/build/dist/Server/API/UserWebAuthnAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +3 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.js +4 -2
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759175457008-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759175457008-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759232954703-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759232954703-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759234532998-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759234532998-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +4 -2
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Infrastructure/SocketIO.js +4 -2
- package/build/dist/Server/Infrastructure/SocketIO.js.map +1 -1
- package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -3
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +12 -6
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/AlertStateTimelineService.js +34 -18
- package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/BillingInvoiceService.js +8 -4
- package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +13 -9
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +40 -28
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +5 -3
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +34 -18
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +4 -2
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MonitorStatusTimelineService.js +34 -18
- package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +4 -2
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +6 -4
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +26 -14
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +4 -2
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +16 -3
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/{UserTwoFactorAuthService.js → UserTotpAuthService.js} +22 -8
- package/build/dist/Server/Services/UserTotpAuthService.js.map +1 -0
- package/build/dist/Server/Services/UserWebAuthnService.js +365 -0
- package/build/dist/Server/Services/UserWebAuthnService.js.map +1 -0
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +142 -51
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +9 -5
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js +4 -2
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +5 -3
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +4 -2
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +6 -4
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Types/Workflow/ComponentCode.js +4 -2
- package/build/dist/Server/Types/Workflow/ComponentCode.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +5 -3
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js +5 -3
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Server/Types/Workflow/TriggerCode.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js +4 -2
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +21 -11
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Browser.js +6 -4
- package/build/dist/Server/Utils/Browser.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +4 -2
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/LocalFile.js +16 -0
- package/build/dist/Server/Utils/LocalFile.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +17 -9
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Realtime.js +4 -2
- package/build/dist/Server/Utils/Realtime.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry.js +6 -4
- package/build/dist/Server/Utils/Telemetry.js.map +1 -1
- package/build/dist/Server/Utils/{TwoFactorAuth.js → TotpAuth.js} +8 -8
- package/build/dist/Server/Utils/TotpAuth.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js +86 -36
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +531 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +206 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +1102 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +136 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +107 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +795 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.js +16 -14
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.js +16 -14
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.js +15 -13
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +1982 -13
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +4 -2
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +4 -2
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +14 -10
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Monitor.js +4 -2
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Monitor.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.js +4 -2
- package/build/dist/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +14 -10
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Alert.js +9 -7
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Incident.js +9 -7
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Monitor.js +9 -7
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Monitor.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.js +9 -7
- package/build/dist/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +5 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Workspace.js +12 -10
- package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
- package/build/dist/Tests/Server/API/BaseAPI.test.js +59 -47
- package/build/dist/Tests/Server/API/BaseAPI.test.js.map +1 -1
- package/build/dist/Tests/Server/Services/BillingService.test.js +4 -4
- package/build/dist/Tests/Server/Services/BillingService.test.js.map +1 -1
- package/build/dist/Tests/Server/Services/TeamMemberService.test.js +20 -12
- package/build/dist/Tests/Server/Services/TeamMemberService.test.js.map +1 -1
- package/build/dist/Tests/Server/TestingUtils/Services/BillingServiceHelper.js +2 -2
- package/build/dist/Tests/Server/TestingUtils/Services/BillingServiceHelper.js.map +1 -1
- package/build/dist/Tests/Types/OnCallDutyPolicy/LayerUtil.test.js +8 -4
- package/build/dist/Tests/Types/OnCallDutyPolicy/LayerUtil.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/DictionaryOfStrings.test.js +4 -2
- package/build/dist/Tests/UI/Components/DictionaryOfStrings.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/FilePicker.test.js +2 -2
- package/build/dist/Tests/UI/Components/FilePicker.test.js.map +1 -1
- package/build/dist/Tests/Utils/API.test.js +8 -7
- package/build/dist/Tests/Utils/API.test.js.map +1 -1
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +5 -3
- package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js.map +1 -1
- package/build/dist/Types/Html.js +5 -3
- package/build/dist/Types/Html.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +5 -5
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +8 -6
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +29 -17
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/Phone.js +5 -3
- package/build/dist/Types/Phone.js.map +1 -1
- package/build/dist/Types/Workspace/WorkspaceType.js +9 -0
- package/build/dist/Types/Workspace/WorkspaceType.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js +8 -6
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +4 -1
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/FilePicker/FilePicker.js +1 -1
- package/build/dist/UI/Components/FilePicker/FilePicker.js.map +1 -1
- package/build/dist/UI/Components/Image/Image.js +1 -1
- package/build/dist/UI/Components/Image/Image.js.map +1 -1
- package/build/dist/UI/Components/JSONTable/JSONTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +4 -2
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +62 -38
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Config.js +1 -0
- package/build/dist/UI/Config.js.map +1 -1
- package/build/dist/UI/Utils/API/API.js +5 -3
- package/build/dist/UI/Utils/API/API.js.map +1 -1
- package/build/dist/UI/Utils/Countries.js.map +1 -1
- package/build/dist/UI/Utils/Login.js +6 -1
- package/build/dist/UI/Utils/Login.js.map +1 -1
- package/build/dist/Utils/Base64.js +12 -0
- package/build/dist/Utils/Base64.js.map +1 -0
- package/build/dist/Utils/Schema/ModelSchema.js +4 -2
- package/build/dist/Utils/Schema/ModelSchema.js.map +1 -1
- package/package.json +5 -1
- package/build/dist/Models/DatabaseModels/UserTwoFactorAuth.js.map +0 -1
- package/build/dist/Server/API/UserTwoFactorAuthAPI.js.map +0 -1
- package/build/dist/Server/Services/UserTwoFactorAuthService.js.map +0 -1
- package/build/dist/Server/Utils/TwoFactorAuth.js.map +0 -1
package/Server/API/ProjectAPI.ts
CHANGED
|
@@ -25,8 +25,10 @@ export default class ProjectAPI extends BaseAPI<Project, ProjectServiceType> {
|
|
|
25
25
|
public constructor() {
|
|
26
26
|
super(Project, ProjectService);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/*
|
|
29
|
+
* This API lists all the projects where user is its team member.
|
|
30
|
+
* This API is usually used to show project selector dropdown in the UI
|
|
31
|
+
*/
|
|
30
32
|
this.router.post(
|
|
31
33
|
`${new this.entityType()
|
|
32
34
|
.getCrudApiPath()
|
|
@@ -30,8 +30,10 @@ export default class ResellerPlanAPI extends BaseAPI<
|
|
|
30
30
|
public constructor() {
|
|
31
31
|
super(ResellerPlan, ResellerPlanService);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/*
|
|
34
|
+
* Reseller Plan Action API
|
|
35
|
+
* TODO: Refactor this API and make it partner specific.
|
|
36
|
+
*/
|
|
35
37
|
this.router.post(
|
|
36
38
|
`${new this.entityType()
|
|
37
39
|
.getCrudApiPath()
|
package/Server/API/SlackAPI.ts
CHANGED
|
@@ -181,29 +181,31 @@ export default class SlackAPI {
|
|
|
181
181
|
let botUserId: string | undefined = undefined;
|
|
182
182
|
let slackUserAccessToken: string | undefined = undefined;
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
184
|
+
/*
|
|
185
|
+
* ReponseBody is in this format.
|
|
186
|
+
* {
|
|
187
|
+
* "ok": true,
|
|
188
|
+
* "access_token": "sample-token",
|
|
189
|
+
* "token_type": "bot",
|
|
190
|
+
* "scope": "commands,incoming-webhook",
|
|
191
|
+
* "bot_user_id": "U0KRQLJ9H",
|
|
192
|
+
* "app_id": "A0KRD7HC3",
|
|
193
|
+
* "team": {
|
|
194
|
+
* "name": "Slack Pickleball Team",
|
|
195
|
+
* "id": "T9TK3CUKW"
|
|
196
|
+
* },
|
|
197
|
+
* "enterprise": {
|
|
198
|
+
* "name": "slack-pickleball",
|
|
199
|
+
* "id": "E12345678"
|
|
200
|
+
* },
|
|
201
|
+
* "authed_user": {
|
|
202
|
+
* "id": "U1234",
|
|
203
|
+
* "scope": "chat:write",
|
|
204
|
+
* "access_token": "sample-token",
|
|
205
|
+
* "token_type": "user"
|
|
206
|
+
* }
|
|
207
|
+
* }
|
|
208
|
+
*/
|
|
207
209
|
|
|
208
210
|
if (responseBody["ok"] !== true) {
|
|
209
211
|
return Response.sendErrorResponse(
|
|
@@ -407,31 +409,35 @@ export default class SlackAPI {
|
|
|
407
409
|
"id_token"
|
|
408
410
|
] as JSONObject;
|
|
409
411
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
412
|
+
/*
|
|
413
|
+
* Example of Response Body
|
|
414
|
+
* {
|
|
415
|
+
* "iss": "https://slack.com",
|
|
416
|
+
* "sub": "U123ABC456",
|
|
417
|
+
* "aud": "25259531569.1115258246291",
|
|
418
|
+
* "exp": 1626874955,
|
|
419
|
+
* "iat": 1626874655,
|
|
420
|
+
* "auth_time": 1626874655,
|
|
421
|
+
* "nonce": "abcd",
|
|
422
|
+
* "at_hash": "abc...123",
|
|
423
|
+
* "https://slack.com/team_id": "T0123ABC456",
|
|
424
|
+
* "https://slack.com/user_id": "U123ABC456",
|
|
425
|
+
* "email": "alice@example.com",
|
|
426
|
+
* "email_verified": true,
|
|
427
|
+
* "date_email_verified": 1622128723,
|
|
428
|
+
* "locale": "en-US",
|
|
429
|
+
* "name": "Alice",
|
|
430
|
+
* "given_name": "",
|
|
431
|
+
* "family_name": "",
|
|
432
|
+
* "https://slack.com/team_image_230": "https://secure.gravatar.com/avatar/bc.png",
|
|
433
|
+
* "https://slack.com/team_image_default": true
|
|
434
|
+
* }
|
|
435
|
+
*/
|
|
436
|
+
|
|
437
|
+
/*
|
|
438
|
+
* check if the team id matches the project id.
|
|
439
|
+
* get project auth.
|
|
440
|
+
*/
|
|
435
441
|
|
|
436
442
|
const projectAuth: WorkspaceProjectAuthToken | null =
|
|
437
443
|
await WorkspaceProjectAuthTokenService.findOneBy({
|
|
@@ -735,9 +735,11 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
735
735
|
req: req,
|
|
736
736
|
});
|
|
737
737
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
738
|
+
/*
|
|
739
|
+
* get start and end date from request body.
|
|
740
|
+
* if no end date is provided then it will be current date.
|
|
741
|
+
* if no start date is provided then it will be 14 days ago from end date.
|
|
742
|
+
*/
|
|
741
743
|
|
|
742
744
|
let startDate: Date = OneUptimeDate.getSomeDaysAgo(14);
|
|
743
745
|
let endDate: Date = OneUptimeDate.getCurrentDate();
|
|
@@ -93,9 +93,11 @@ export default class UserNotificationLogTimelineAPI extends BaseAPI<
|
|
|
93
93
|
},
|
|
94
94
|
);
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
/*
|
|
97
|
+
* We have this ack page to show the user a confirmation page before acknowledging the notification.
|
|
98
|
+
* this is because email clients automatically make a get request to the url in the email and ack the notification automatically which is not what we want.
|
|
99
|
+
* so we need to create this page for the user to confirm that they want to acknowledge the notification.
|
|
100
|
+
*/
|
|
99
101
|
this.router.get(
|
|
100
102
|
`${new this.entityType()
|
|
101
103
|
.getCrudApiPath()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ObjectID from "../../Types/ObjectID";
|
|
2
2
|
import UserMiddleware from "../Middleware/UserAuthorization";
|
|
3
|
-
import
|
|
4
|
-
Service as
|
|
5
|
-
} from "../Services/
|
|
3
|
+
import UserTotpAuthService, {
|
|
4
|
+
Service as UserTotpAuthServiceType,
|
|
5
|
+
} from "../Services/UserTotpAuthService";
|
|
6
6
|
import {
|
|
7
7
|
ExpressRequest,
|
|
8
8
|
ExpressResponse,
|
|
@@ -10,27 +10,27 @@ import {
|
|
|
10
10
|
OneUptimeRequest,
|
|
11
11
|
} from "../Utils/Express";
|
|
12
12
|
import BaseAPI from "./BaseAPI";
|
|
13
|
-
import
|
|
13
|
+
import UserTotpAuth from "../../Models/DatabaseModels/UserTotpAuth";
|
|
14
14
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
15
|
-
import
|
|
15
|
+
import TotpAuth from "../Utils/TotpAuth";
|
|
16
16
|
import Response from "../Utils/Response";
|
|
17
17
|
import User from "../../Models/DatabaseModels/User";
|
|
18
18
|
import UserService from "../Services/UserService";
|
|
19
19
|
|
|
20
|
-
export default class
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export default class UserTotpAuthAPI extends BaseAPI<
|
|
21
|
+
UserTotpAuth,
|
|
22
|
+
UserTotpAuthServiceType
|
|
23
23
|
> {
|
|
24
24
|
public constructor() {
|
|
25
|
-
super(
|
|
25
|
+
super(UserTotpAuth, UserTotpAuthService);
|
|
26
26
|
|
|
27
27
|
this.router.post(
|
|
28
28
|
`${new this.entityType().getCrudApiPath()?.toString()}/validate`,
|
|
29
29
|
UserMiddleware.getUserMiddleware,
|
|
30
30
|
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
31
31
|
try {
|
|
32
|
-
const
|
|
33
|
-
await
|
|
32
|
+
const userTotpAuth: UserTotpAuth | null =
|
|
33
|
+
await UserTotpAuthService.findOneById({
|
|
34
34
|
id: new ObjectID(req.body["id"]),
|
|
35
35
|
select: {
|
|
36
36
|
twoFactorSecret: true,
|
|
@@ -41,24 +41,24 @@ export default class UserTwoFactorAuthAPI extends BaseAPI<
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
if (!
|
|
45
|
-
throw new BadDataException("
|
|
44
|
+
if (!userTotpAuth) {
|
|
45
|
+
throw new BadDataException("TOTP auth not found");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
if (
|
|
49
|
-
|
|
49
|
+
userTotpAuth.userId?.toString() !==
|
|
50
50
|
(req as OneUptimeRequest).userAuthorization?.userId.toString()
|
|
51
51
|
) {
|
|
52
52
|
throw new BadDataException("Two factor auth not found");
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
if (!
|
|
55
|
+
if (!userTotpAuth.userId) {
|
|
56
56
|
throw new BadDataException("User not found");
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// get user email.
|
|
60
60
|
const user: User | null = await UserService.findOneById({
|
|
61
|
-
id:
|
|
61
|
+
id: userTotpAuth.userId!,
|
|
62
62
|
select: {
|
|
63
63
|
email: true,
|
|
64
64
|
},
|
|
@@ -75,8 +75,8 @@ export default class UserTwoFactorAuthAPI extends BaseAPI<
|
|
|
75
75
|
throw new BadDataException("User email not found");
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const isValid: boolean =
|
|
79
|
-
secret:
|
|
78
|
+
const isValid: boolean = TotpAuth.verifyToken({
|
|
79
|
+
secret: userTotpAuth.twoFactorSecret || "",
|
|
80
80
|
token: req.body["code"] || "",
|
|
81
81
|
email: user.email!,
|
|
82
82
|
});
|
|
@@ -87,8 +87,8 @@ export default class UserTwoFactorAuthAPI extends BaseAPI<
|
|
|
87
87
|
|
|
88
88
|
// update this 2fa code as verified
|
|
89
89
|
|
|
90
|
-
await
|
|
91
|
-
id:
|
|
90
|
+
await UserTotpAuthService.updateOneById({
|
|
91
|
+
id: userTotpAuth.id!,
|
|
92
92
|
data: {
|
|
93
93
|
isVerified: true,
|
|
94
94
|
},
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import ObjectID from "../../Types/ObjectID";
|
|
2
|
+
import UserMiddleware from "../Middleware/UserAuthorization";
|
|
3
|
+
import UserWebAuthnService, {
|
|
4
|
+
Service as UserWebAuthnServiceType,
|
|
5
|
+
} from "../Services/UserWebAuthnService";
|
|
6
|
+
import {
|
|
7
|
+
ExpressRequest,
|
|
8
|
+
ExpressResponse,
|
|
9
|
+
NextFunction,
|
|
10
|
+
OneUptimeRequest,
|
|
11
|
+
} from "../Utils/Express";
|
|
12
|
+
import BaseAPI from "./BaseAPI";
|
|
13
|
+
import UserWebAuthn from "../../Models/DatabaseModels/UserWebAuthn";
|
|
14
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
15
|
+
import Response from "../Utils/Response";
|
|
16
|
+
import { JSONObject } from "../../Types/JSON";
|
|
17
|
+
import CommonAPI from "./CommonAPI";
|
|
18
|
+
import DatabaseCommonInteractionProps from "../../Types/BaseDatabase/DatabaseCommonInteractionProps";
|
|
19
|
+
|
|
20
|
+
export default class UserWebAuthnAPI extends BaseAPI<
|
|
21
|
+
UserWebAuthn,
|
|
22
|
+
UserWebAuthnServiceType
|
|
23
|
+
> {
|
|
24
|
+
public constructor() {
|
|
25
|
+
super(UserWebAuthn, UserWebAuthnService);
|
|
26
|
+
|
|
27
|
+
this.router.post(
|
|
28
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/generate-registration-options`,
|
|
29
|
+
UserMiddleware.getUserMiddleware,
|
|
30
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
31
|
+
try {
|
|
32
|
+
const userId: ObjectID = (req as OneUptimeRequest).userAuthorization!
|
|
33
|
+
.userId;
|
|
34
|
+
|
|
35
|
+
const result: { options: any; challenge: string } =
|
|
36
|
+
await UserWebAuthnService.generateRegistrationOptions({
|
|
37
|
+
userId: userId,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return Response.sendJsonObjectResponse(req, res, result);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
next(err);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
this.router.post(
|
|
48
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/verify-registration`,
|
|
49
|
+
UserMiddleware.getUserMiddleware,
|
|
50
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
51
|
+
try {
|
|
52
|
+
const data: JSONObject = req.body;
|
|
53
|
+
|
|
54
|
+
const databaseProps: DatabaseCommonInteractionProps =
|
|
55
|
+
await CommonAPI.getDatabaseCommonInteractionProps(req);
|
|
56
|
+
|
|
57
|
+
const expectedChallenge: string = data["challenge"] as string;
|
|
58
|
+
const credential: any = data["credential"];
|
|
59
|
+
const name: string = data["name"] as string;
|
|
60
|
+
|
|
61
|
+
await UserWebAuthnService.verifyRegistration({
|
|
62
|
+
challenge: expectedChallenge,
|
|
63
|
+
credential: credential,
|
|
64
|
+
name: name,
|
|
65
|
+
props: databaseProps,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return Response.sendEmptySuccessResponse(req, res);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
next(err);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
this.router.post(
|
|
76
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/generate-authentication-options`,
|
|
77
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
78
|
+
try {
|
|
79
|
+
const data: JSONObject = req.body["data"] as JSONObject;
|
|
80
|
+
|
|
81
|
+
if (!data) {
|
|
82
|
+
throw new BadDataException("Data is required");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const email: string | undefined = data["email"] as string | undefined;
|
|
86
|
+
|
|
87
|
+
if (!email) {
|
|
88
|
+
throw new BadDataException("Email is required");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const result: { options: any; challenge: string; userId: string } =
|
|
92
|
+
await UserWebAuthnService.generateAuthenticationOptions({
|
|
93
|
+
email: email,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return Response.sendJsonObjectResponse(req, res, result);
|
|
97
|
+
} catch (err) {
|
|
98
|
+
next(err);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -340,6 +340,12 @@ export const SlackAppClientSecret: string | null =
|
|
|
340
340
|
export const SlackAppSigningSecret: string | null =
|
|
341
341
|
process.env["SLACK_APP_SIGNING_SECRET"] || null;
|
|
342
342
|
|
|
343
|
+
// Microsoft Teams Configuration
|
|
344
|
+
export const MicrosoftTeamsAppClientId: string | null =
|
|
345
|
+
process.env["MICROSOFT_TEAMS_APP_CLIENT_ID"] || null;
|
|
346
|
+
export const MicrosoftTeamsAppClientSecret: string | null =
|
|
347
|
+
process.env["MICROSOFT_TEAMS_APP_CLIENT_SECRET"] || null;
|
|
348
|
+
|
|
343
349
|
// VAPID Configuration for Web Push Notifications
|
|
344
350
|
export const VapidPublicKey: string | undefined =
|
|
345
351
|
process.env["VAPID_PUBLIC_KEY"] || undefined;
|
|
Binary file
|
|
Binary file
|
|
@@ -11,8 +11,10 @@ export class AddEnableCustomSubscriberEmailNotificationFooterText1753131488925
|
|
|
11
11
|
`ALTER TABLE "StatusPage" ADD "enableCustomSubscriberEmailNotificationFooterText" boolean NOT NULL DEFAULT false`,
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/*
|
|
15
|
+
* Data migration: Set existing status pages to have enableCustomSubscriberEmailNotificationFooterText = true
|
|
16
|
+
* This ensures backward compatibility for existing status pages that already have custom footer text
|
|
17
|
+
*/
|
|
16
18
|
await queryRunner.query(
|
|
17
19
|
`UPDATE "StatusPage" SET "enableCustomSubscriberEmailNotificationFooterText" = true WHERE "subscriberEmailNotificationFooterText" IS NOT NULL AND "subscriberEmailNotificationFooterText" != ''`,
|
|
18
20
|
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class MigrationName1759175457008 implements MigrationInterface {
|
|
4
|
+
public name = "MigrationName1759175457008";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE "UserWebAuthn" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "name" character varying(100) NOT NULL, "credentialId" text NOT NULL, "publicKey" text NOT NULL, "counter" text NOT NULL, "transports" text, "isVerified" boolean NOT NULL DEFAULT false, "deletedByUserId" uuid, "userId" uuid, CONSTRAINT "UQ_ed9d287cb27cc360b9c3a4542e9" UNIQUE ("credentialId"), CONSTRAINT "PK_76a58e093d632ac5a9036bfac57" PRIMARY KEY ("_id"))`,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`ALTER TABLE "UserWebAuthn" ADD CONSTRAINT "FK_e14966d27e4991f5f53ef54cad5" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`ALTER TABLE "UserWebAuthn" ADD CONSTRAINT "FK_e7a7d2869a90899c5f76ec997c0" FOREIGN KEY ("userId") REFERENCES "User"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`ALTER TABLE "UserWebAuthn" DROP CONSTRAINT "FK_e7a7d2869a90899c5f76ec997c0"`,
|
|
21
|
+
);
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`ALTER TABLE "UserWebAuthn" DROP CONSTRAINT "FK_e14966d27e4991f5f53ef54cad5"`,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(`DROP TABLE "UserWebAuthn"`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class MigrationName1759232954703 implements MigrationInterface {
|
|
4
|
+
public name = "MigrationName1759232954703";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`ALTER TABLE "User" DROP COLUMN "twoFactorSecretCode"`,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`ALTER TABLE "User" DROP COLUMN "twoFactorAuthUrl"`,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "User" DROP COLUMN "backupCodes"`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "User" ADD "backupCodes" text`);
|
|
18
|
+
await queryRunner.query(
|
|
19
|
+
`ALTER TABLE "User" ADD "twoFactorAuthUrl" character varying(100)`,
|
|
20
|
+
);
|
|
21
|
+
await queryRunner.query(
|
|
22
|
+
`ALTER TABLE "User" ADD "twoFactorSecretCode" character varying(100)`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class RenameUserTwoFactorAuthToUserTotpAuth1759234532998
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
public name = "RenameUserTwoFactorAuthToUserTotpAuth1759234532998";
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
await queryRunner.renameTable("UserTwoFactorAuth", "UserTotpAuth");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.renameTable("UserTotpAuth", "UserTwoFactorAuth");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -171,6 +171,9 @@ import { MigrationName1758313975491 } from "./1758313975491-MigrationName";
|
|
|
171
171
|
import { MigrationName1758626094132 } from "./1758626094132-MigrationName";
|
|
172
172
|
import { MigrationName1758629540993 } from "./1758629540993-MigrationName";
|
|
173
173
|
import { MigrationName1758798730753 } from "./1758798730753-MigrationName";
|
|
174
|
+
import { MigrationName1759175457008 } from "./1759175457008-MigrationName";
|
|
175
|
+
import { MigrationName1759232954703 } from "./1759232954703-MigrationName";
|
|
176
|
+
import { RenameUserTwoFactorAuthToUserTotpAuth1759234532998 } from "./1759234532998-MigrationName";
|
|
174
177
|
|
|
175
178
|
export default [
|
|
176
179
|
InitialMigration,
|
|
@@ -346,4 +349,7 @@ export default [
|
|
|
346
349
|
MigrationName1758626094132,
|
|
347
350
|
MigrationName1758629540993,
|
|
348
351
|
MigrationName1758798730753,
|
|
352
|
+
MigrationName1759175457008,
|
|
353
|
+
MigrationName1759232954703,
|
|
354
|
+
RenameUserTwoFactorAuthToUserTotpAuth1759234532998,
|
|
349
355
|
];
|
|
@@ -93,8 +93,10 @@ export default class Queue {
|
|
|
93
93
|
removeOnComplete: { count: 500 }, // keep last 1000 completed jobs
|
|
94
94
|
removeOnFail: { count: 100 }, // keep last 500 failed jobs
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
/*
|
|
97
|
+
* Optionally cap the event stream length (supported in BullMQ >= v5)
|
|
98
|
+
* This helps prevent the :events stream from growing indefinitely
|
|
99
|
+
*/
|
|
98
100
|
streams: {
|
|
99
101
|
events: { maxLen: 1000 },
|
|
100
102
|
},
|
|
@@ -26,8 +26,10 @@ export default abstract class IO {
|
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/*
|
|
30
|
+
* const pubClient: ClientType = Redis.getClient()!.duplicate();
|
|
31
|
+
* const subClient: ClientType = Redis.getClient()!.duplicate();
|
|
32
|
+
*/
|
|
31
33
|
|
|
32
34
|
// this.socketServer.adapter(createAdapter(pubClient, subClient));
|
|
33
35
|
}
|
|
@@ -107,9 +107,11 @@ export default class ProjectMiddleware {
|
|
|
107
107
|
|
|
108
108
|
if (apiKeyModel) {
|
|
109
109
|
(req as OneUptimeRequest).userType = UserType.API;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
/*
|
|
111
|
+
* TODO: Add API key permissions.
|
|
112
|
+
* (req as OneUptimeRequest).permissions =
|
|
113
|
+
* apiKeyModel.permissions || [];
|
|
114
|
+
*/
|
|
113
115
|
(req as OneUptimeRequest).userGlobalAccessPermission =
|
|
114
116
|
await APIKeyAccessPermission.getDefaultApiGlobalPermission(
|
|
115
117
|
tenantId,
|
|
@@ -53,8 +53,8 @@ export default class SlackAuthorization {
|
|
|
53
53
|
// check if the signature is valid
|
|
54
54
|
if (
|
|
55
55
|
!crypto.timingSafeEqual(
|
|
56
|
-
Buffer.from(signature),
|
|
57
|
-
Buffer.from(slackSignature),
|
|
56
|
+
Buffer.from(signature) as Uint8Array,
|
|
57
|
+
Buffer.from(slackSignature) as Uint8Array,
|
|
58
58
|
)
|
|
59
59
|
) {
|
|
60
60
|
logger.error("Slack Signature Verification Failed.");
|
|
@@ -44,8 +44,10 @@ export default class TelemetryIngest {
|
|
|
44
44
|
logger.error("Missing header: x-oneuptime-token");
|
|
45
45
|
|
|
46
46
|
if (isOpenTelemetryAPI) {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
/*
|
|
48
|
+
* then accept the response and return success.
|
|
49
|
+
* do not return error because it causes Otel to retry the request.
|
|
50
|
+
*/
|
|
49
51
|
return Response.sendEmptySuccessResponse(req, res);
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -71,8 +73,10 @@ export default class TelemetryIngest {
|
|
|
71
73
|
logger.error("Invalid service token: " + oneuptimeToken);
|
|
72
74
|
|
|
73
75
|
if (isOpenTelemetryAPI) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
/*
|
|
77
|
+
* then accept the response and return success.
|
|
78
|
+
* do not return error because it causes Otel to retry the request.
|
|
79
|
+
*/
|
|
76
80
|
return Response.sendEmptySuccessResponse(req, res);
|
|
77
81
|
}
|
|
78
82
|
|
|
@@ -89,8 +93,10 @@ export default class TelemetryIngest {
|
|
|
89
93
|
);
|
|
90
94
|
|
|
91
95
|
if (isOpenTelemetryAPI) {
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
/*
|
|
97
|
+
* then accept the response and return success.
|
|
98
|
+
* do not return error because it causes Otel to retry the request.
|
|
99
|
+
*/
|
|
94
100
|
return Response.sendEmptySuccessResponse(req, res);
|
|
95
101
|
}
|
|
96
102
|
|