@oneuptime/common 9.4.7 → 9.4.9
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/Alert.ts +76 -0
- package/Models/DatabaseModels/AlertEpisode.ts +1201 -0
- package/Models/DatabaseModels/AlertEpisodeFeed.ts +529 -0
- package/Models/DatabaseModels/AlertEpisodeInternalNote.ts +455 -0
- package/Models/DatabaseModels/AlertEpisodeMember.ts +586 -0
- package/Models/DatabaseModels/AlertEpisodeOwnerTeam.ts +421 -0
- package/Models/DatabaseModels/AlertEpisodeOwnerUser.ts +419 -0
- package/Models/DatabaseModels/AlertEpisodeStateTimeline.ts +523 -0
- package/Models/DatabaseModels/AlertFeed.ts +1 -0
- package/Models/DatabaseModels/AlertGroupingRule.ts +1432 -0
- package/Models/DatabaseModels/Index.ts +18 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +70 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.ts +59 -0
- package/Models/DatabaseModels/StatusPageDomain.ts +2 -0
- package/Models/DatabaseModels/UserOnCallLog.ts +48 -0
- package/Models/DatabaseModels/UserOnCallLogTimeline.ts +49 -0
- package/Models/DatabaseModels/WorkspaceNotificationLog.ts +57 -0
- package/Server/API/SlackAPI.ts +21 -0
- package/Server/API/UserOnCallLogTimelineAPI.ts +65 -25
- package/Server/Infrastructure/Postgres/SchemaMigrations/1768938069147-MigrationName.ts +751 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769125561322-MigrationName.ts +41 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769170578688-MigrationName.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769172358833-MigrationName.ts +177 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769176450526-MigrationName.ts +71 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769190495840-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769199303656-MigrationName.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769202898645-MigrationName.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769428619414-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769428821686-MigrationName.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769469813786-MigrationName.ts +71 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1769517677937-RenameNotificationRuleTypes.ts +67 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +24 -0
- package/Server/Services/AlertEpisodeFeedService.ts +94 -0
- package/Server/Services/AlertEpisodeInternalNoteService.ts +71 -0
- package/Server/Services/AlertEpisodeMemberService.ts +267 -0
- package/Server/Services/AlertEpisodeOwnerTeamService.ts +10 -0
- package/Server/Services/AlertEpisodeOwnerUserService.ts +10 -0
- package/Server/Services/AlertEpisodeService.ts +1096 -0
- package/Server/Services/AlertEpisodeStateTimelineService.ts +557 -0
- package/Server/Services/AlertGroupingEngineService.ts +1120 -0
- package/Server/Services/AlertGroupingRuleService.ts +14 -0
- package/Server/Services/AlertService.ts +12 -0
- package/Server/Services/CallService.ts +2 -0
- package/Server/Services/Index.ts +21 -0
- package/Server/Services/MailService.ts +5 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +18 -1
- package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +64 -2
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +27 -1
- package/Server/Services/OnCallDutyPolicyService.ts +16 -1
- package/Server/Services/PushNotificationService.ts +1 -0
- package/Server/Services/SmsService.ts +2 -0
- package/Server/Services/UserNotificationRuleService.ts +641 -10
- package/Server/Services/UserNotificationSettingService.ts +23 -0
- package/Server/Services/UserOnCallLogService.ts +58 -14
- package/Server/Services/WhatsAppService.ts +5 -0
- package/Server/Services/WorkspaceNotificationRuleService.ts +26 -0
- package/Server/Utils/AnalyticsDatabase/Statement.ts +6 -2
- package/Server/Utils/PushNotificationUtil.ts +75 -16
- package/Server/Utils/WhatsAppTemplateUtil.ts +13 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.ts +18 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +689 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +16 -0
- package/Server/Utils/Workspace/Slack/Actions/ActionTypes.ts +11 -0
- package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +915 -0
- package/Server/Utils/Workspace/Slack/Messages/AlertEpisode.ts +120 -0
- package/Server/Utils/Workspace/WorkspaceMessages/AlertEpisode.ts +74 -0
- package/Tests/Server/Services/AlertEpisodeMemberService.test.ts +200 -0
- package/Tests/Server/Services/AlertEpisodeService.test.ts +240 -0
- package/Tests/Server/Services/AlertGroupingEngineService.test.ts +542 -0
- package/Tests/Server/Services/AlertGroupingRuleService.test.ts +383 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +1 -1
- package/Tests/UI/Components/Input.test.tsx +1 -1
- package/Tests/UI/Components/TextArea.test.tsx +2 -2
- package/Types/BaseDatabase/SortOrder.ts +9 -0
- package/Types/Email/EmailTemplateType.ts +6 -0
- package/Types/NotificationRule/NotificationRuleType.ts +3 -1
- package/Types/NotificationSetting/NotificationSettingEventType.ts +7 -0
- package/Types/Permission.ts +309 -0
- package/Types/UserNotification/UserNotificationEventType.ts +1 -0
- package/Types/WhatsApp/WhatsAppTemplates.ts +24 -0
- package/Types/Workspace/NotificationRules/EventType.ts +1 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.ts +32 -3
- package/UI/Components/Accordion/Accordion.tsx +20 -2
- package/UI/Components/Alerts/Alert.tsx +1 -0
- package/UI/Components/Button/Button.tsx +29 -0
- package/UI/Components/CardSelect/CardSelect.tsx +5 -1
- package/UI/Components/Checkbox/Checkbox.tsx +7 -3
- package/UI/Components/ColorCircle/ColorCircle.tsx +2 -0
- package/UI/Components/ColorViewer/ColorViewer.tsx +19 -3
- package/UI/Components/CopyableButton/CopyableButton.tsx +22 -5
- package/UI/Components/Detail/Detail.tsx +1 -1
- package/UI/Components/Dropdown/Dropdown.tsx +14 -1
- package/UI/Components/Forms/Fields/FormField.tsx +28 -0
- package/UI/Components/FullPageModal/FullPageModal.tsx +35 -4
- package/UI/Components/Input/Input.tsx +14 -2
- package/UI/Components/Link/Link.tsx +1 -0
- package/UI/Components/Loader/Loader.tsx +8 -2
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +76 -1
- package/UI/Components/Modal/Modal.tsx +47 -3
- package/UI/Components/ModelTable/BaseModelTable.tsx +42 -1
- package/UI/Components/MoreMenu/MoreMenu.tsx +84 -2
- package/UI/Components/OrderedStatesList/OrderedStatesList.tsx +30 -8
- package/UI/Components/Pagination/Pagination.tsx +113 -8
- package/UI/Components/ProgressBar/ProgressBar.tsx +12 -2
- package/UI/Components/Radio/Radio.tsx +21 -3
- package/UI/Components/SideMenu/CountModelSideMenuItem.tsx +54 -27
- package/UI/Components/StatusBubble/StatusBubble.tsx +7 -2
- package/UI/Components/Table/TableHeader.tsx +20 -3
- package/UI/Components/Tabs/Tab.tsx +16 -1
- package/UI/Components/Tabs/Tabs.tsx +12 -1
- package/UI/Components/TextArea/TextArea.tsx +12 -2
- package/UI/Components/Toggle/Toggle.tsx +14 -3
- package/UI/Components/Tooltip/Tooltip.tsx +11 -1
- package/UI/Components/TopAlert/TopAlert.tsx +2 -0
- package/build/dist/Models/DatabaseModels/Alert.js +77 -0
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertEpisode.js +1225 -0
- package/build/dist/Models/DatabaseModels/AlertEpisode.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeFeed.js +553 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeInternalNote.js +467 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeInternalNote.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js +607 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeOwnerTeam.js +437 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeOwnerUser.js +436 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js +546 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertFeed.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertGroupingRule.js +1437 -0
- package/build/dist/Models/DatabaseModels/AlertGroupingRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +16 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +69 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +58 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js +2 -0
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLog.js +47 -0
- package/build/dist/Models/DatabaseModels/UserOnCallLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +48 -0
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkspaceNotificationLog.js +58 -0
- package/build/dist/Models/DatabaseModels/WorkspaceNotificationLog.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +18 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +55 -15
- package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768938069147-MigrationName.js +266 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768938069147-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769125561322-MigrationName.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769125561322-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769170578688-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769170578688-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769172358833-MigrationName.js +68 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769172358833-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769176450526-MigrationName.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769176450526-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769190495840-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769190495840-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769199303656-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769199303656-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769202898645-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769202898645-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769428619414-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769428619414-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769428821686-MigrationName.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769428821686-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769469813786-MigrationName.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769469813786-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769517677937-RenameNotificationRuleTypes.js +67 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1769517677937-RenameNotificationRuleTypes.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeFeedService.js +83 -0
- package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -0
- package/build/dist/Server/Services/AlertEpisodeInternalNoteService.js +70 -0
- package/build/dist/Server/Services/AlertEpisodeInternalNoteService.js.map +1 -0
- package/build/dist/Server/Services/AlertEpisodeMemberService.js +256 -0
- package/build/dist/Server/Services/AlertEpisodeMemberService.js.map +1 -0
- package/build/dist/Server/Services/AlertEpisodeOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/AlertEpisodeOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/AlertEpisodeOwnerUserService.js +9 -0
- package/build/dist/Server/Services/AlertEpisodeOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/AlertEpisodeService.js +973 -0
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -0
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +494 -0
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -0
- package/build/dist/Server/Services/AlertGroupingEngineService.js +893 -0
- package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -0
- package/build/dist/Server/Services/AlertGroupingRuleService.js +13 -0
- package/build/dist/Server/Services/AlertGroupingRuleService.js.map +1 -0
- package/build/dist/Server/Services/AlertService.js +11 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/CallService.js +11 -10
- package/build/dist/Server/Services/CallService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +18 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MailService.js +3 -0
- package/build/dist/Server/Services/MailService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +10 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +49 -2
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +21 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +9 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/PushNotificationService.js.map +1 -1
- package/build/dist/Server/Services/SmsService.js +11 -10
- package/build/dist/Server/Services/SmsService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +521 -43
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js +9 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallLogService.js +48 -12
- package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
- package/build/dist/Server/Services/WhatsAppService.js +3 -0
- package/build/dist/Server/Services/WhatsAppService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +25 -0
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.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/PushNotificationUtil.js +51 -16
- package/build/dist/Server/Utils/PushNotificationUtil.js.map +1 -1
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +8 -0
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js +17 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +545 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +13 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js +10 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +651 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/AlertEpisode.js +100 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/AlertEpisode.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/AlertEpisode.js +70 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/AlertEpisode.js.map +1 -0
- package/build/dist/Tests/Server/Services/AlertEpisodeMemberService.test.js +165 -0
- package/build/dist/Tests/Server/Services/AlertEpisodeMemberService.test.js.map +1 -0
- package/build/dist/Tests/Server/Services/AlertEpisodeService.test.js +193 -0
- package/build/dist/Tests/Server/Services/AlertEpisodeService.test.js.map +1 -0
- package/build/dist/Tests/Server/Services/AlertGroupingEngineService.test.js +412 -0
- package/build/dist/Tests/Server/Services/AlertGroupingEngineService.test.js.map +1 -0
- package/build/dist/Tests/Server/Services/AlertGroupingRuleService.test.js +308 -0
- package/build/dist/Tests/Server/Services/AlertGroupingRuleService.test.js.map +1 -0
- package/build/dist/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.js +1 -1
- package/build/dist/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/Input.test.js +1 -1
- package/build/dist/Tests/UI/Components/Input.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/TextArea.test.js +2 -2
- package/build/dist/Tests/UI/Components/TextArea.test.js.map +1 -1
- package/build/dist/Types/BaseDatabase/SortOrder.js +5 -0
- package/build/dist/Types/BaseDatabase/SortOrder.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +5 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/NotificationRule/NotificationRuleType.js +3 -1
- package/build/dist/Types/NotificationRule/NotificationRuleType.js.map +1 -1
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +5 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/Permission.js +264 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/UserNotification/UserNotificationEventType.js +1 -0
- package/build/dist/Types/UserNotification/UserNotificationEventType.js.map +1 -1
- package/build/dist/Types/WhatsApp/WhatsAppTemplates.js +15 -0
- package/build/dist/Types/WhatsApp/WhatsAppTemplates.js.map +1 -1
- package/build/dist/Types/Workspace/NotificationRules/EventType.js +1 -0
- package/build/dist/Types/Workspace/NotificationRules/EventType.js.map +1 -1
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js +28 -3
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js.map +1 -1
- package/build/dist/UI/Components/Accordion/Accordion.js +10 -3
- package/build/dist/UI/Components/Accordion/Accordion.js.map +1 -1
- package/build/dist/UI/Components/Alerts/Alert.js +1 -1
- package/build/dist/UI/Components/Alerts/Alert.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +8 -2
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/CardSelect/CardSelect.js +1 -1
- package/build/dist/UI/Components/CardSelect/CardSelect.js.map +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js +2 -2
- package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
- package/build/dist/UI/Components/ColorCircle/ColorCircle.js +1 -1
- package/build/dist/UI/Components/ColorCircle/ColorCircle.js.map +1 -1
- package/build/dist/UI/Components/ColorViewer/ColorViewer.js +12 -3
- package/build/dist/UI/Components/ColorViewer/ColorViewer.js.map +1 -1
- package/build/dist/UI/Components/CopyableButton/CopyableButton.js +12 -5
- package/build/dist/UI/Components/CopyableButton/CopyableButton.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +1 -1
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/Dropdown/Dropdown.js +5 -3
- package/build/dist/UI/Components/Dropdown/Dropdown.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js +19 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/FullPageModal/FullPageModal.js +24 -5
- package/build/dist/UI/Components/FullPageModal/FullPageModal.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +3 -3
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/Link/Link.js +1 -1
- package/build/dist/UI/Components/Link/Link.js.map +1 -1
- package/build/dist/UI/Components/Loader/Loader.js +6 -4
- package/build/dist/UI/Components/Loader/Loader.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +56 -3
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +28 -3
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +23 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +67 -6
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
- package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js +14 -3
- package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js.map +1 -1
- package/build/dist/UI/Components/Pagination/Pagination.js +69 -13
- package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
- package/build/dist/UI/Components/ProgressBar/ProgressBar.js +2 -2
- package/build/dist/UI/Components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/dist/UI/Components/Radio/Radio.js +8 -5
- package/build/dist/UI/Components/Radio/Radio.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js +23 -4
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/StatusBubble/StatusBubble.js +2 -2
- package/build/dist/UI/Components/StatusBubble/StatusBubble.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +12 -4
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/Tabs/Tab.js +8 -1
- package/build/dist/UI/Components/Tabs/Tab.js.map +1 -1
- package/build/dist/UI/Components/Tabs/Tabs.js +4 -3
- package/build/dist/UI/Components/Tabs/Tabs.js.map +1 -1
- package/build/dist/UI/Components/TextArea/TextArea.js +3 -3
- package/build/dist/UI/Components/TextArea/TextArea.js.map +1 -1
- package/build/dist/UI/Components/Toggle/Toggle.js +7 -4
- package/build/dist/UI/Components/Toggle/Toggle.js.map +1 -1
- package/build/dist/UI/Components/Tooltip/Tooltip.js +4 -1
- package/build/dist/UI/Components/Tooltip/Tooltip.js.map +1 -1
- package/build/dist/UI/Components/TopAlert/TopAlert.js +1 -1
- package/build/dist/UI/Components/TopAlert/TopAlert.js.map +1 -1
- package/package.json +2 -1
|
@@ -49,6 +49,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
49
49
|
whatsAppMessage: WhatsAppMessagePayload;
|
|
50
50
|
incidentId?: ObjectID | undefined;
|
|
51
51
|
alertId?: ObjectID | undefined;
|
|
52
|
+
alertEpisodeId?: ObjectID | undefined;
|
|
52
53
|
scheduledMaintenanceId?: ObjectID | undefined;
|
|
53
54
|
statusPageId?: ObjectID | undefined;
|
|
54
55
|
statusPageAnnouncementId?: ObjectID | undefined;
|
|
@@ -113,6 +114,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
113
114
|
projectId: data.projectId,
|
|
114
115
|
incidentId: data.incidentId,
|
|
115
116
|
alertId: data.alertId,
|
|
117
|
+
alertEpisodeId: data.alertEpisodeId,
|
|
116
118
|
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
|
117
119
|
statusPageId: data.statusPageId,
|
|
118
120
|
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
|
@@ -158,6 +160,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
158
160
|
projectId: data.projectId,
|
|
159
161
|
incidentId: data.incidentId,
|
|
160
162
|
alertId: data.alertId,
|
|
163
|
+
alertEpisodeId: data.alertEpisodeId,
|
|
161
164
|
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
|
162
165
|
statusPageId: data.statusPageId,
|
|
163
166
|
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
|
@@ -210,6 +213,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
210
213
|
projectId: data.projectId,
|
|
211
214
|
incidentId: data.incidentId,
|
|
212
215
|
alertId: data.alertId,
|
|
216
|
+
alertEpisodeId: data.alertEpisodeId,
|
|
213
217
|
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
|
214
218
|
statusPageId: data.statusPageId,
|
|
215
219
|
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
|
@@ -254,6 +258,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
254
258
|
projectId: data.projectId,
|
|
255
259
|
incidentId: data.incidentId,
|
|
256
260
|
alertId: data.alertId,
|
|
261
|
+
alertEpisodeId: data.alertEpisodeId,
|
|
257
262
|
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
|
258
263
|
statusPageId: data.statusPageId,
|
|
259
264
|
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
|
@@ -340,6 +345,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
340
345
|
await this.addMonitorNotificationSettings(userId, projectId);
|
|
341
346
|
await this.addOnCallNotificationSettings(userId, projectId);
|
|
342
347
|
await this.addAlertNotificationSettings(userId, projectId);
|
|
348
|
+
await this.addAlertEpisodeNotificationSettings(userId, projectId);
|
|
343
349
|
}
|
|
344
350
|
|
|
345
351
|
private async addProbeOwnerNotificationSettings(
|
|
@@ -451,6 +457,23 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
|
|
451
457
|
);
|
|
452
458
|
}
|
|
453
459
|
|
|
460
|
+
private async addAlertEpisodeNotificationSettings(
|
|
461
|
+
userId: ObjectID,
|
|
462
|
+
projectId: ObjectID,
|
|
463
|
+
): Promise<void> {
|
|
464
|
+
await this.addNotificationSettingIfNotExists(
|
|
465
|
+
userId,
|
|
466
|
+
projectId,
|
|
467
|
+
NotificationSettingEventType.SEND_ALERT_EPISODE_CREATED_OWNER_NOTIFICATION,
|
|
468
|
+
);
|
|
469
|
+
|
|
470
|
+
await this.addNotificationSettingIfNotExists(
|
|
471
|
+
userId,
|
|
472
|
+
projectId,
|
|
473
|
+
NotificationSettingEventType.SEND_ALERT_EPISODE_STATE_CHANGED_OWNER_NOTIFICATION,
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
|
|
454
477
|
private async addNotificationSettingIfNotExists(
|
|
455
478
|
userId: ObjectID,
|
|
456
479
|
projectId: ObjectID,
|
|
@@ -19,6 +19,8 @@ import Model from "../../Models/DatabaseModels/UserOnCallLog";
|
|
|
19
19
|
import { IsBillingEnabled } from "../EnvironmentConfig";
|
|
20
20
|
import Alert from "../../Models/DatabaseModels/Alert";
|
|
21
21
|
import AlertService from "./AlertService";
|
|
22
|
+
import AlertEpisode from "../../Models/DatabaseModels/AlertEpisode";
|
|
23
|
+
import AlertEpisodeService from "./AlertEpisodeService";
|
|
22
24
|
|
|
23
25
|
export class Service extends DatabaseService<Model> {
|
|
24
26
|
public constructor() {
|
|
@@ -121,6 +123,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
121
123
|
|
|
122
124
|
let incident: Incident | null = null;
|
|
123
125
|
let alert: Alert | null = null;
|
|
126
|
+
let alertEpisode: AlertEpisode | null = null;
|
|
124
127
|
|
|
125
128
|
if (createdItem.triggeredByIncidentId) {
|
|
126
129
|
incident = await IncidentService.findOneById({
|
|
@@ -176,6 +179,33 @@ export class Service extends DatabaseService<Model> {
|
|
|
176
179
|
});
|
|
177
180
|
}
|
|
178
181
|
|
|
182
|
+
// get rule count for alert episodes.
|
|
183
|
+
if (createdItem.triggeredByAlertEpisodeId) {
|
|
184
|
+
alertEpisode = await AlertEpisodeService.findOneById({
|
|
185
|
+
id: createdItem.triggeredByAlertEpisodeId,
|
|
186
|
+
props: {
|
|
187
|
+
isRoot: true,
|
|
188
|
+
},
|
|
189
|
+
select: {
|
|
190
|
+
alertSeverityId: true,
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
ruleCount = await UserNotificationRuleService.countBy({
|
|
195
|
+
query: {
|
|
196
|
+
userId: createdItem.userId!,
|
|
197
|
+
projectId: createdItem.projectId!,
|
|
198
|
+
ruleType: notificationRuleType,
|
|
199
|
+
alertSeverityId: alertEpisode?.alertSeverityId as ObjectID,
|
|
200
|
+
},
|
|
201
|
+
skip: 0,
|
|
202
|
+
limit: LIMIT_PER_PROJECT,
|
|
203
|
+
props: {
|
|
204
|
+
isRoot: true,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
179
209
|
if (ruleCount.toNumber() === 0) {
|
|
180
210
|
// update this item to be processed.
|
|
181
211
|
await this.updateOneById({
|
|
@@ -206,7 +236,17 @@ export class Service extends DatabaseService<Model> {
|
|
|
206
236
|
return createdItem;
|
|
207
237
|
}
|
|
208
238
|
|
|
209
|
-
|
|
239
|
+
/*
|
|
240
|
+
* find immediate notification rule and alert the user.
|
|
241
|
+
* Determine the alertSeverityId - can come from alert or alertEpisode
|
|
242
|
+
*/
|
|
243
|
+
const alertSeverityIdForQuery: ObjectID | undefined =
|
|
244
|
+
alert && alert.alertSeverityId
|
|
245
|
+
? (alert.alertSeverityId as ObjectID)
|
|
246
|
+
: alertEpisode && alertEpisode.alertSeverityId
|
|
247
|
+
? (alertEpisode.alertSeverityId as ObjectID)
|
|
248
|
+
: undefined;
|
|
249
|
+
|
|
210
250
|
const immediateNotificationRule: Array<UserNotificationRule> =
|
|
211
251
|
await UserNotificationRuleService.findBy({
|
|
212
252
|
query: {
|
|
@@ -218,10 +258,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
218
258
|
incident && incident.incidentSeverityId
|
|
219
259
|
? (incident?.incidentSeverityId as ObjectID)
|
|
220
260
|
: undefined,
|
|
221
|
-
alertSeverityId:
|
|
222
|
-
alert && alert.alertSeverityId
|
|
223
|
-
? (alert?.alertSeverityId as ObjectID)
|
|
224
|
-
: undefined,
|
|
261
|
+
alertSeverityId: alertSeverityIdForQuery,
|
|
225
262
|
},
|
|
226
263
|
select: {
|
|
227
264
|
_id: true,
|
|
@@ -241,6 +278,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
241
278
|
projectId: createdItem.projectId!,
|
|
242
279
|
triggeredByIncidentId: createdItem.triggeredByIncidentId,
|
|
243
280
|
triggeredByAlertId: createdItem.triggeredByAlertId,
|
|
281
|
+
triggeredByAlertEpisodeId: createdItem.triggeredByAlertEpisodeId,
|
|
244
282
|
userNotificationEventType: createdItem.userNotificationEventType!,
|
|
245
283
|
onCallPolicyExecutionLogId:
|
|
246
284
|
createdItem.onCallDutyPolicyExecutionLogId,
|
|
@@ -284,19 +322,25 @@ export class Service extends DatabaseService<Model> {
|
|
|
284
322
|
public getNotificationRuleType(
|
|
285
323
|
userNotificationEventType: UserNotificationEventType,
|
|
286
324
|
): NotificationRuleType {
|
|
287
|
-
|
|
288
|
-
|
|
325
|
+
if (
|
|
326
|
+
userNotificationEventType === UserNotificationEventType.IncidentCreated
|
|
327
|
+
) {
|
|
328
|
+
return NotificationRuleType.ON_CALL_EXECUTED_INCIDENT;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (userNotificationEventType === UserNotificationEventType.AlertCreated) {
|
|
332
|
+
return NotificationRuleType.ON_CALL_EXECUTED_ALERT;
|
|
333
|
+
}
|
|
289
334
|
|
|
290
335
|
if (
|
|
291
|
-
userNotificationEventType ===
|
|
292
|
-
|
|
336
|
+
userNotificationEventType ===
|
|
337
|
+
UserNotificationEventType.AlertEpisodeCreated
|
|
293
338
|
) {
|
|
294
|
-
|
|
295
|
-
} else {
|
|
296
|
-
// Invalid user notification event type.
|
|
297
|
-
throw new BadDataException("Invalid user notification event type.");
|
|
339
|
+
return NotificationRuleType.ON_CALL_EXECUTED_ALERT_EPISODE;
|
|
298
340
|
}
|
|
299
|
-
|
|
341
|
+
|
|
342
|
+
// Invalid user notification event type.
|
|
343
|
+
throw new BadDataException("Invalid user notification event type.");
|
|
300
344
|
}
|
|
301
345
|
}
|
|
302
346
|
export default new Service();
|
|
@@ -26,6 +26,7 @@ export class WhatsAppService extends BaseService {
|
|
|
26
26
|
userOnCallLogTimelineId?: ObjectID | undefined;
|
|
27
27
|
incidentId?: ObjectID | undefined;
|
|
28
28
|
alertId?: ObjectID | undefined;
|
|
29
|
+
alertEpisodeId?: ObjectID | undefined;
|
|
29
30
|
scheduledMaintenanceId?: ObjectID | undefined;
|
|
30
31
|
statusPageId?: ObjectID | undefined;
|
|
31
32
|
statusPageAnnouncementId?: ObjectID | undefined;
|
|
@@ -84,6 +85,10 @@ export class WhatsAppService extends BaseService {
|
|
|
84
85
|
body["alertId"] = options.alertId.toString();
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
if (options.alertEpisodeId) {
|
|
89
|
+
body["alertEpisodeId"] = options.alertEpisodeId.toString();
|
|
90
|
+
}
|
|
91
|
+
|
|
87
92
|
if (options.scheduledMaintenanceId) {
|
|
88
93
|
body["scheduledMaintenanceId"] =
|
|
89
94
|
options.scheduledMaintenanceId.toString();
|
|
@@ -59,6 +59,7 @@ export interface MessageBlocksByWorkspaceType {
|
|
|
59
59
|
export interface NotificationFor {
|
|
60
60
|
incidentId?: ObjectID | undefined;
|
|
61
61
|
alertId?: ObjectID | undefined;
|
|
62
|
+
alertEpisodeId?: ObjectID | undefined;
|
|
62
63
|
scheduledMaintenanceId?: ObjectID | undefined;
|
|
63
64
|
monitorId?: ObjectID | undefined;
|
|
64
65
|
onCallDutyPolicyId?: ObjectID | undefined;
|
|
@@ -1943,6 +1944,11 @@ export class Service extends DatabaseService<WorkspaceNotificationRule> {
|
|
|
1943
1944
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyDescription]:
|
|
1944
1945
|
undefined,
|
|
1945
1946
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyLabels]: undefined,
|
|
1947
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeTitle]: undefined,
|
|
1948
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeDescription]: undefined,
|
|
1949
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeSeverity]: undefined,
|
|
1950
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeState]: undefined,
|
|
1951
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeLabels]: undefined,
|
|
1946
1952
|
};
|
|
1947
1953
|
}
|
|
1948
1954
|
|
|
@@ -2020,6 +2026,11 @@ export class Service extends DatabaseService<WorkspaceNotificationRule> {
|
|
|
2020
2026
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyDescription]:
|
|
2021
2027
|
undefined,
|
|
2022
2028
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyLabels]: undefined,
|
|
2029
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeTitle]: undefined,
|
|
2030
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeDescription]: undefined,
|
|
2031
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeSeverity]: undefined,
|
|
2032
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeState]: undefined,
|
|
2033
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeLabels]: undefined,
|
|
2023
2034
|
};
|
|
2024
2035
|
}
|
|
2025
2036
|
|
|
@@ -2103,6 +2114,11 @@ export class Service extends DatabaseService<WorkspaceNotificationRule> {
|
|
|
2103
2114
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyDescription]:
|
|
2104
2115
|
undefined,
|
|
2105
2116
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyLabels]: undefined,
|
|
2117
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeTitle]: undefined,
|
|
2118
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeDescription]: undefined,
|
|
2119
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeSeverity]: undefined,
|
|
2120
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeState]: undefined,
|
|
2121
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeLabels]: undefined,
|
|
2106
2122
|
};
|
|
2107
2123
|
}
|
|
2108
2124
|
|
|
@@ -2164,6 +2180,11 @@ export class Service extends DatabaseService<WorkspaceNotificationRule> {
|
|
|
2164
2180
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyDescription]:
|
|
2165
2181
|
undefined,
|
|
2166
2182
|
[NotificationRuleConditionCheckOn.OnCallDutyPolicyLabels]: undefined,
|
|
2183
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeTitle]: undefined,
|
|
2184
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeDescription]: undefined,
|
|
2185
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeSeverity]: undefined,
|
|
2186
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeState]: undefined,
|
|
2187
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeLabels]: undefined,
|
|
2167
2188
|
};
|
|
2168
2189
|
}
|
|
2169
2190
|
|
|
@@ -2224,6 +2245,11 @@ export class Service extends DatabaseService<WorkspaceNotificationRule> {
|
|
|
2224
2245
|
[NotificationRuleConditionCheckOn.ScheduledMaintenanceLabels]:
|
|
2225
2246
|
undefined,
|
|
2226
2247
|
[NotificationRuleConditionCheckOn.Monitors]: undefined,
|
|
2248
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeTitle]: undefined,
|
|
2249
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeDescription]: undefined,
|
|
2250
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeSeverity]: undefined,
|
|
2251
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeState]: undefined,
|
|
2252
|
+
[NotificationRuleConditionCheckOn.AlertEpisodeLabels]: undefined,
|
|
2227
2253
|
};
|
|
2228
2254
|
}
|
|
2229
2255
|
|
|
@@ -123,9 +123,13 @@ export class Statement implements BaseQueryParams {
|
|
|
123
123
|
finalValue = v.value;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// serialize to date
|
|
126
|
+
// serialize to date (only for string values that need parsing, not already processed Date objects)
|
|
127
127
|
|
|
128
|
-
if (
|
|
128
|
+
if (
|
|
129
|
+
typeof v !== "string" &&
|
|
130
|
+
v.type === TableColumnType.Date &&
|
|
131
|
+
!(v.value instanceof Date)
|
|
132
|
+
) {
|
|
129
133
|
finalValue = OneUptimeDate.fromString(finalValue as string);
|
|
130
134
|
finalValue = OneUptimeDate.toClickhouseDateTime(finalValue);
|
|
131
135
|
}
|
|
@@ -19,11 +19,16 @@ export default class PushNotificationUtil {
|
|
|
19
19
|
incidentTitle: string;
|
|
20
20
|
projectName: string;
|
|
21
21
|
incidentViewLink: string;
|
|
22
|
+
incidentNumber?: number;
|
|
22
23
|
}): PushNotificationMessage {
|
|
23
|
-
const { incidentTitle, projectName, incidentViewLink } =
|
|
24
|
+
const { incidentTitle, projectName, incidentViewLink, incidentNumber } =
|
|
25
|
+
params;
|
|
26
|
+
const incidentIdentifier: string = incidentNumber
|
|
27
|
+
? `#${incidentNumber} (${incidentTitle})`
|
|
28
|
+
: incidentTitle;
|
|
24
29
|
return PushNotificationUtil.applyDefaults({
|
|
25
|
-
title: `New Incident: ${incidentTitle}`,
|
|
26
|
-
body: `A new incident has been created in ${projectName}. Click to view details.`,
|
|
30
|
+
title: `New Incident${incidentNumber ? ` #${incidentNumber}` : ""}: ${incidentTitle}`,
|
|
31
|
+
body: `A new incident has been created: ${incidentIdentifier} in ${projectName}. Click to view details.`,
|
|
27
32
|
clickAction: incidentViewLink,
|
|
28
33
|
url: incidentViewLink,
|
|
29
34
|
tag: "incident-created",
|
|
@@ -43,6 +48,7 @@ export default class PushNotificationUtil {
|
|
|
43
48
|
newState: string;
|
|
44
49
|
previousState?: string;
|
|
45
50
|
incidentViewLink: string;
|
|
51
|
+
incidentNumber?: number;
|
|
46
52
|
}): PushNotificationMessage {
|
|
47
53
|
const {
|
|
48
54
|
incidentTitle,
|
|
@@ -50,12 +56,16 @@ export default class PushNotificationUtil {
|
|
|
50
56
|
newState,
|
|
51
57
|
previousState,
|
|
52
58
|
incidentViewLink,
|
|
59
|
+
incidentNumber,
|
|
53
60
|
} = params;
|
|
61
|
+
const incidentIdentifier: string = incidentNumber
|
|
62
|
+
? `#${incidentNumber} (${incidentTitle})`
|
|
63
|
+
: incidentTitle;
|
|
54
64
|
const stateChangeText: string = previousState
|
|
55
|
-
? `Incident state changed from ${previousState} to ${newState}`
|
|
56
|
-
: `Incident state changed to ${newState}`;
|
|
65
|
+
? `Incident ${incidentIdentifier} state changed from ${previousState} to ${newState}`
|
|
66
|
+
: `Incident ${incidentIdentifier} state changed to ${newState}`;
|
|
57
67
|
return PushNotificationUtil.applyDefaults({
|
|
58
|
-
title: `Incident Updated: ${incidentTitle}`,
|
|
68
|
+
title: `Incident${incidentNumber ? ` #${incidentNumber}` : ""} Updated: ${incidentTitle}`,
|
|
59
69
|
body: `${stateChangeText} in ${projectName}. Click to view details.`,
|
|
60
70
|
clickAction: incidentViewLink,
|
|
61
71
|
url: incidentViewLink,
|
|
@@ -77,13 +87,22 @@ export default class PushNotificationUtil {
|
|
|
77
87
|
projectName: string;
|
|
78
88
|
isPrivateNote: boolean;
|
|
79
89
|
incidentViewLink: string;
|
|
90
|
+
incidentNumber?: number;
|
|
80
91
|
}): PushNotificationMessage {
|
|
81
|
-
const {
|
|
82
|
-
|
|
92
|
+
const {
|
|
93
|
+
incidentTitle,
|
|
94
|
+
projectName,
|
|
95
|
+
isPrivateNote,
|
|
96
|
+
incidentViewLink,
|
|
97
|
+
incidentNumber,
|
|
98
|
+
} = params;
|
|
83
99
|
const noteType: string = isPrivateNote ? "Private" : "Public";
|
|
100
|
+
const incidentIdentifier: string = incidentNumber
|
|
101
|
+
? `#${incidentNumber} (${incidentTitle})`
|
|
102
|
+
: incidentTitle;
|
|
84
103
|
return PushNotificationUtil.applyDefaults({
|
|
85
|
-
title: `${noteType} Note Added: ${incidentTitle}`,
|
|
86
|
-
body: `A ${noteType.toLowerCase()} note has been posted on incident in ${projectName}. Click to view details.`,
|
|
104
|
+
title: `${noteType} Note Added: Incident${incidentNumber ? ` #${incidentNumber}` : ""} - ${incidentTitle}`,
|
|
105
|
+
body: `A ${noteType.toLowerCase()} note has been posted on incident ${incidentIdentifier} in ${projectName}. Click to view details.`,
|
|
87
106
|
clickAction: incidentViewLink,
|
|
88
107
|
url: incidentViewLink,
|
|
89
108
|
tag: "incident-note-posted",
|
|
@@ -102,11 +121,15 @@ export default class PushNotificationUtil {
|
|
|
102
121
|
alertTitle: string;
|
|
103
122
|
projectName: string;
|
|
104
123
|
alertViewLink: string;
|
|
124
|
+
alertNumber?: number;
|
|
105
125
|
}): PushNotificationMessage {
|
|
106
|
-
const { alertTitle, projectName, alertViewLink } = params;
|
|
126
|
+
const { alertTitle, projectName, alertViewLink, alertNumber } = params;
|
|
127
|
+
const alertIdentifier: string = alertNumber
|
|
128
|
+
? `#${alertNumber} (${alertTitle})`
|
|
129
|
+
: alertTitle;
|
|
107
130
|
return PushNotificationUtil.applyDefaults({
|
|
108
|
-
title: `New Alert: ${alertTitle}`,
|
|
109
|
-
body: `A new alert has been created in ${projectName}. Click to view details.`,
|
|
131
|
+
title: `New Alert${alertNumber ? ` #${alertNumber}` : ""}: ${alertTitle}`,
|
|
132
|
+
body: `A new alert has been created: ${alertIdentifier} in ${projectName}. Click to view details.`,
|
|
110
133
|
clickAction: alertViewLink,
|
|
111
134
|
url: alertViewLink,
|
|
112
135
|
tag: "alert-created",
|
|
@@ -120,6 +143,37 @@ export default class PushNotificationUtil {
|
|
|
120
143
|
});
|
|
121
144
|
}
|
|
122
145
|
|
|
146
|
+
public static createAlertEpisodeCreatedNotification(params: {
|
|
147
|
+
alertEpisodeTitle: string;
|
|
148
|
+
projectName: string;
|
|
149
|
+
alertEpisodeViewLink: string;
|
|
150
|
+
episodeNumber?: number;
|
|
151
|
+
}): PushNotificationMessage {
|
|
152
|
+
const {
|
|
153
|
+
alertEpisodeTitle,
|
|
154
|
+
projectName,
|
|
155
|
+
alertEpisodeViewLink,
|
|
156
|
+
episodeNumber,
|
|
157
|
+
} = params;
|
|
158
|
+
const episodeIdentifier: string = episodeNumber
|
|
159
|
+
? `#${episodeNumber} (${alertEpisodeTitle})`
|
|
160
|
+
: alertEpisodeTitle;
|
|
161
|
+
return PushNotificationUtil.applyDefaults({
|
|
162
|
+
title: `New Alert Episode${episodeNumber ? ` #${episodeNumber}` : ""}: ${alertEpisodeTitle}`,
|
|
163
|
+
body: `A new alert episode has been created: ${episodeIdentifier} in ${projectName}. Click to view details.`,
|
|
164
|
+
clickAction: alertEpisodeViewLink,
|
|
165
|
+
url: alertEpisodeViewLink,
|
|
166
|
+
tag: "alert-episode-created",
|
|
167
|
+
requireInteraction: true,
|
|
168
|
+
data: {
|
|
169
|
+
type: "alert-episode-created",
|
|
170
|
+
alertEpisodeTitle: alertEpisodeTitle,
|
|
171
|
+
projectName: projectName,
|
|
172
|
+
url: alertEpisodeViewLink,
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
123
177
|
public static createMonitorStatusChangedNotification(params: {
|
|
124
178
|
monitorName: string;
|
|
125
179
|
projectName: string;
|
|
@@ -160,11 +214,16 @@ export default class PushNotificationUtil {
|
|
|
160
214
|
projectName: string;
|
|
161
215
|
state: string;
|
|
162
216
|
viewLink: string;
|
|
217
|
+
scheduledMaintenanceNumber?: number;
|
|
163
218
|
}): PushNotificationMessage {
|
|
164
|
-
const { title, projectName, state, viewLink } =
|
|
219
|
+
const { title, projectName, state, viewLink, scheduledMaintenanceNumber } =
|
|
220
|
+
params;
|
|
221
|
+
const maintenanceIdentifier: string = scheduledMaintenanceNumber
|
|
222
|
+
? `#${scheduledMaintenanceNumber} (${title})`
|
|
223
|
+
: title;
|
|
165
224
|
return PushNotificationUtil.applyDefaults({
|
|
166
|
-
title: `Scheduled Maintenance ${state}: ${title}`,
|
|
167
|
-
body: `Scheduled maintenance ${state.toLowerCase()} in ${projectName}. Click to view details.`,
|
|
225
|
+
title: `Scheduled Maintenance${scheduledMaintenanceNumber ? ` #${scheduledMaintenanceNumber}` : ""} ${state}: ${title}`,
|
|
226
|
+
body: `Scheduled maintenance ${maintenanceIdentifier} ${state.toLowerCase()} in ${projectName}. Click to view details.`,
|
|
168
227
|
clickAction: viewLink,
|
|
169
228
|
url: viewLink,
|
|
170
229
|
tag: "scheduled-maintenance",
|
|
@@ -18,6 +18,11 @@ const templateDashboardLinkVariableMap: Partial<
|
|
|
18
18
|
[WhatsAppTemplateIds.AlertNotePostedOwnerNotification]: "alert_link",
|
|
19
19
|
[WhatsAppTemplateIds.AlertStateChangedOwnerNotification]: "alert_link",
|
|
20
20
|
[WhatsAppTemplateIds.AlertOwnerAddedNotification]: "alert_link",
|
|
21
|
+
[WhatsAppTemplateIds.AlertEpisodeCreatedOwnerNotification]: "episode_link",
|
|
22
|
+
[WhatsAppTemplateIds.AlertEpisodeNotePostedOwnerNotification]: "episode_link",
|
|
23
|
+
[WhatsAppTemplateIds.AlertEpisodeStateChangedOwnerNotification]:
|
|
24
|
+
"episode_link",
|
|
25
|
+
[WhatsAppTemplateIds.AlertEpisodeOwnerAddedNotification]: "episode_link",
|
|
21
26
|
[WhatsAppTemplateIds.IncidentCreated]: "incident_link",
|
|
22
27
|
[WhatsAppTemplateIds.IncidentCreatedOwnerNotification]: "incident_link",
|
|
23
28
|
[WhatsAppTemplateIds.IncidentNotePostedOwnerNotification]: "incident_link",
|
|
@@ -72,6 +77,14 @@ const templateIdByEventType: Record<
|
|
|
72
77
|
WhatsAppTemplateIds.AlertStateChangedOwnerNotification,
|
|
73
78
|
[NotificationSettingEventType.SEND_ALERT_OWNER_ADDED_NOTIFICATION]:
|
|
74
79
|
WhatsAppTemplateIds.AlertOwnerAddedNotification,
|
|
80
|
+
[NotificationSettingEventType.SEND_ALERT_EPISODE_CREATED_OWNER_NOTIFICATION]:
|
|
81
|
+
WhatsAppTemplateIds.AlertEpisodeCreatedOwnerNotification,
|
|
82
|
+
[NotificationSettingEventType.SEND_ALERT_EPISODE_NOTE_POSTED_OWNER_NOTIFICATION]:
|
|
83
|
+
WhatsAppTemplateIds.AlertEpisodeNotePostedOwnerNotification,
|
|
84
|
+
[NotificationSettingEventType.SEND_ALERT_EPISODE_STATE_CHANGED_OWNER_NOTIFICATION]:
|
|
85
|
+
WhatsAppTemplateIds.AlertEpisodeStateChangedOwnerNotification,
|
|
86
|
+
[NotificationSettingEventType.SEND_ALERT_EPISODE_OWNER_ADDED_NOTIFICATION]:
|
|
87
|
+
WhatsAppTemplateIds.AlertEpisodeOwnerAddedNotification,
|
|
75
88
|
[NotificationSettingEventType.SEND_MONITOR_OWNER_ADDED_NOTIFICATION]:
|
|
76
89
|
WhatsAppTemplateIds.MonitorOwnerAddedNotification,
|
|
77
90
|
[NotificationSettingEventType.SEND_MONITOR_CREATED_OWNER_NOTIFICATION]:
|
|
@@ -37,6 +37,23 @@ export enum MicrosoftTeamsAlertActionType {
|
|
|
37
37
|
SubmitChangeAlertState = "SubmitChangeAlertState",
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// Alert Episode Actions
|
|
41
|
+
export enum MicrosoftTeamsAlertEpisodeActionType {
|
|
42
|
+
AckAlertEpisode = "AckAlertEpisode",
|
|
43
|
+
ResolveAlertEpisode = "ResolveAlertEpisode",
|
|
44
|
+
ViewAlertEpisode = "ViewAlertEpisode",
|
|
45
|
+
AlertEpisodeCreated = "AlertEpisodeCreated",
|
|
46
|
+
AlertEpisodeStateChanged = "AlertEpisodeStateChanged",
|
|
47
|
+
AddAlertEpisodeNote = "AddAlertEpisodeNote",
|
|
48
|
+
ExecuteAlertEpisodeOnCallPolicy = "ExecuteAlertEpisodeOnCallPolicy",
|
|
49
|
+
ViewAddAlertEpisodeNote = "ViewAddAlertEpisodeNote",
|
|
50
|
+
SubmitAlertEpisodeNote = "SubmitAlertEpisodeNote",
|
|
51
|
+
ViewExecuteAlertEpisodeOnCallPolicy = "ViewExecuteAlertEpisodeOnCallPolicy",
|
|
52
|
+
SubmitExecuteAlertEpisodeOnCallPolicy = "SubmitExecuteAlertEpisodeOnCallPolicy",
|
|
53
|
+
ViewChangeAlertEpisodeState = "ViewChangeAlertEpisodeState",
|
|
54
|
+
SubmitChangeAlertEpisodeState = "SubmitChangeAlertEpisodeState",
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
// Monitor Actions
|
|
41
58
|
export enum MicrosoftTeamsMonitorActionType {
|
|
42
59
|
ViewMonitor = "ViewMonitor",
|
|
@@ -89,6 +106,7 @@ export enum TeamsActivityType {
|
|
|
89
106
|
export type MicrosoftTeamsActionType =
|
|
90
107
|
| MicrosoftTeamsIncidentActionType
|
|
91
108
|
| MicrosoftTeamsAlertActionType
|
|
109
|
+
| MicrosoftTeamsAlertEpisodeActionType
|
|
92
110
|
| MicrosoftTeamsMonitorActionType
|
|
93
111
|
| MicrosoftTeamsScheduledMaintenanceActionType
|
|
94
112
|
| MicrosoftTeamsOnCallDutyActionType
|