@oneuptime/common 7.0.3786 → 7.0.3815
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/Server/API/SlackAPI.ts +68 -0
- package/Server/Services/AccessTokenService.ts +21 -0
- package/Server/Services/AlertFeedService.ts +98 -0
- package/Server/Services/AlertInternalNoteService.ts +49 -8
- package/Server/Services/AlertOwnerTeamService.ts +50 -2
- package/Server/Services/AlertOwnerUserService.ts +52 -2
- package/Server/Services/AlertService.ts +236 -37
- package/Server/Services/AlertStateService.ts +24 -0
- package/Server/Services/AlertStateTimelineService.ts +30 -2
- package/Server/Services/IncidentInternalNoteService.ts +6 -6
- package/Server/Services/IncidentPublicNoteService.ts +7 -4
- package/Server/Services/IncidentStateTimelineService.ts +2 -1
- package/Server/Services/ScheduledMaintenanceFeedService.ts +103 -0
- package/Server/Services/ScheduledMaintenanceInternalNoteService.ts +50 -6
- package/Server/Services/ScheduledMaintenanceOwnerTeamService.ts +37 -0
- package/Server/Services/ScheduledMaintenanceOwnerUserService.ts +34 -0
- package/Server/Services/ScheduledMaintenancePublicNoteService.ts +49 -7
- package/Server/Services/ScheduledMaintenanceService.ts +375 -12
- package/Server/Services/ScheduledMaintenanceStateService.ts +122 -34
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +33 -1
- package/Server/Services/WorkspaceNotificationRuleService.ts +12 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.ts +38 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts +116 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts +36 -115
- package/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts +108 -0
- package/Server/Utils/Workspace/Slack/Actions/ActionTypes.ts +20 -2
- package/Server/Utils/Workspace/Slack/Actions/Alert.ts +697 -0
- package/Server/Utils/Workspace/Slack/Actions/Auth.ts +9 -2
- package/Server/Utils/Workspace/Slack/Actions/Incident.ts +9 -3
- package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +956 -0
- package/Server/Utils/Workspace/Slack/Messages/Alert.ts +116 -0
- package/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts +108 -0
- package/Server/Utils/Workspace/Slack/Slack.ts +48 -2
- package/Server/Utils/Workspace/Slack/app-manifest.json +3 -3
- package/Server/Utils/Workspace/WorkspaceBase.ts +14 -0
- package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +69 -0
- package/Server/Utils/Workspace/WorkspaceMessages/ScheduledMaintenance.ts +73 -0
- package/Types/Date.ts +5 -0
- package/Types/Workspace/WorkspaceMessagePayload.ts +9 -0
- package/build/dist/Server/API/SlackAPI.js +54 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/Services/AccessTokenService.js +11 -0
- package/build/dist/Server/Services/AccessTokenService.js.map +1 -1
- package/build/dist/Server/Services/AlertFeedService.js +60 -0
- package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
- package/build/dist/Server/Services/AlertInternalNoteService.js +39 -8
- package/build/dist/Server/Services/AlertInternalNoteService.js.map +1 -1
- package/build/dist/Server/Services/AlertOwnerTeamService.js +40 -2
- package/build/dist/Server/Services/AlertOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/AlertOwnerUserService.js +41 -3
- package/build/dist/Server/Services/AlertOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +192 -35
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/AlertStateService.js +13 -0
- package/build/dist/Server/Services/AlertStateService.js.map +1 -1
- package/build/dist/Server/Services/AlertStateTimelineService.js +26 -2
- package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentInternalNoteService.js +6 -6
- package/build/dist/Server/Services/IncidentInternalNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentPublicNoteService.js +5 -4
- package/build/dist/Server/Services/IncidentPublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +60 -0
- package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceInternalNoteService.js +36 -6
- package/build/dist/Server/Services/ScheduledMaintenanceInternalNoteService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceOwnerTeamService.js +24 -0
- package/build/dist/Server/Services/ScheduledMaintenanceOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceOwnerUserService.js +22 -0
- package/build/dist/Server/Services/ScheduledMaintenanceOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js +36 -7
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +275 -13
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateService.js +52 -4
- package/build/dist/Server/Services/ScheduledMaintenanceStateService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +28 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +10 -0
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js +37 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.js +82 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.js +33 -99
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.js +74 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js +20 -2
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +425 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +2 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +5 -2
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +599 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Alert.js +82 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/Alert.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.js +74 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +34 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/app-manifest.json +3 -3
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +8 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +48 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/ScheduledMaintenance.js +47 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/ScheduledMaintenance.js.map +1 -0
- package/build/dist/Types/Date.js +4 -0
- package/build/dist/Types/Date.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import BadDataException from "../../../../../Types/Exception/BadDataException";
|
|
2
|
+
import ObjectID from "../../../../../Types/ObjectID";
|
|
3
|
+
import {
|
|
4
|
+
WorkspaceMessageBlock,
|
|
5
|
+
WorkspaceMessagePayloadButton,
|
|
6
|
+
WorkspacePayloadButtons,
|
|
7
|
+
WorkspacePayloadDivider,
|
|
8
|
+
} from "../../../../../Types/Workspace/WorkspaceMessagePayload";
|
|
9
|
+
import AlertService from "../../../../Services/AlertService";
|
|
10
|
+
import SlackActionType from "../../../../Utils/Workspace/Slack/Actions/ActionTypes";
|
|
11
|
+
|
|
12
|
+
export default class SlackAlertMessages {
|
|
13
|
+
public static async getAlertCreateMessageBlocks(data: {
|
|
14
|
+
alertId: ObjectID;
|
|
15
|
+
projectId: ObjectID;
|
|
16
|
+
}): Promise<Array<WorkspaceMessageBlock>> {
|
|
17
|
+
if (!data.alertId) {
|
|
18
|
+
throw new BadDataException("Alert ID is required");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Slack.
|
|
22
|
+
|
|
23
|
+
const blockSlack: Array<WorkspaceMessageBlock> = [];
|
|
24
|
+
|
|
25
|
+
// add divider.
|
|
26
|
+
|
|
27
|
+
const dividerBlock: WorkspacePayloadDivider = {
|
|
28
|
+
_type: "WorkspacePayloadDivider",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
blockSlack.push(dividerBlock);
|
|
32
|
+
|
|
33
|
+
// now add buttons.
|
|
34
|
+
// View data.
|
|
35
|
+
// Execute On Call
|
|
36
|
+
// Acknowledge alert
|
|
37
|
+
// Resolve data.
|
|
38
|
+
// Change Alert State.
|
|
39
|
+
// Add Note.
|
|
40
|
+
|
|
41
|
+
const buttons: Array<WorkspaceMessagePayloadButton> = [];
|
|
42
|
+
|
|
43
|
+
// view data.
|
|
44
|
+
const viewAlertButton: WorkspaceMessagePayloadButton = {
|
|
45
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
46
|
+
title: "🔗 View Alert",
|
|
47
|
+
url: await AlertService.getAlertLinkInDashboard(
|
|
48
|
+
data.projectId!,
|
|
49
|
+
data.alertId!,
|
|
50
|
+
),
|
|
51
|
+
value: data.alertId?.toString() || "",
|
|
52
|
+
actionId: SlackActionType.ViewAlert,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
buttons.push(viewAlertButton);
|
|
56
|
+
|
|
57
|
+
// execute on call.
|
|
58
|
+
const executeOnCallButton: WorkspaceMessagePayloadButton = {
|
|
59
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
60
|
+
title: "📞 Execute On Call",
|
|
61
|
+
value: data.alertId?.toString() || "",
|
|
62
|
+
actionId: SlackActionType.ViewExecuteAlertOnCallPolicy,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
buttons.push(executeOnCallButton);
|
|
66
|
+
|
|
67
|
+
// acknowledge data.
|
|
68
|
+
const acknowledgeAlertButton: WorkspaceMessagePayloadButton = {
|
|
69
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
70
|
+
title: "👀 Acknowledge Alert",
|
|
71
|
+
value: data.alertId?.toString() || "",
|
|
72
|
+
actionId: SlackActionType.AcknowledgeAlert,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
buttons.push(acknowledgeAlertButton);
|
|
76
|
+
|
|
77
|
+
// resolve data.
|
|
78
|
+
const resolveAlertButton: WorkspaceMessagePayloadButton = {
|
|
79
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
80
|
+
title: "✅ Resolve Alert",
|
|
81
|
+
value: data.alertId?.toString() || "",
|
|
82
|
+
actionId: SlackActionType.ResolveAlert,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
buttons.push(resolveAlertButton);
|
|
86
|
+
|
|
87
|
+
// change alert state.
|
|
88
|
+
const changeAlertStateButton: WorkspaceMessagePayloadButton = {
|
|
89
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
90
|
+
title: "➡️ Change Alert State",
|
|
91
|
+
value: data.alertId?.toString() || "",
|
|
92
|
+
actionId: SlackActionType.ViewChangeAlertState,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
buttons.push(changeAlertStateButton);
|
|
96
|
+
|
|
97
|
+
// add note.
|
|
98
|
+
const addNoteButton: WorkspaceMessagePayloadButton = {
|
|
99
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
100
|
+
title: "📄 Add Note",
|
|
101
|
+
value: data.alertId?.toString() || "",
|
|
102
|
+
actionId: SlackActionType.ViewAddAlertNote,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
buttons.push(addNoteButton);
|
|
106
|
+
|
|
107
|
+
const workspacePayloadButtons: WorkspacePayloadButtons = {
|
|
108
|
+
buttons: buttons,
|
|
109
|
+
_type: "WorkspacePayloadButtons",
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
blockSlack.push(workspacePayloadButtons);
|
|
113
|
+
|
|
114
|
+
return blockSlack;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import BadDataException from "../../../../../Types/Exception/BadDataException";
|
|
2
|
+
import ObjectID from "../../../../../Types/ObjectID";
|
|
3
|
+
import {
|
|
4
|
+
WorkspaceMessageBlock,
|
|
5
|
+
WorkspaceMessagePayloadButton,
|
|
6
|
+
WorkspacePayloadButtons,
|
|
7
|
+
WorkspacePayloadDivider,
|
|
8
|
+
} from "../../../../../Types/Workspace/WorkspaceMessagePayload";
|
|
9
|
+
import ScheduledMaintenanceService from "../../../../Services/ScheduledMaintenanceService";
|
|
10
|
+
import SlackActionType from "../../../../Utils/Workspace/Slack/Actions/ActionTypes";
|
|
11
|
+
|
|
12
|
+
export default class SlackScheduledMaintenanceMessages {
|
|
13
|
+
public static async getScheduledMaintenanceCreateMessageBlocks(data: {
|
|
14
|
+
scheduledMaintenanceId: ObjectID;
|
|
15
|
+
projectId: ObjectID;
|
|
16
|
+
}): Promise<Array<WorkspaceMessageBlock>> {
|
|
17
|
+
if (!data.scheduledMaintenanceId) {
|
|
18
|
+
throw new BadDataException("ScheduledMaintenance ID is required");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Slack.
|
|
22
|
+
|
|
23
|
+
const blockSlack: Array<WorkspaceMessageBlock> = [];
|
|
24
|
+
|
|
25
|
+
// add divider.
|
|
26
|
+
|
|
27
|
+
const dividerBlock: WorkspacePayloadDivider = {
|
|
28
|
+
_type: "WorkspacePayloadDivider",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
blockSlack.push(dividerBlock);
|
|
32
|
+
|
|
33
|
+
// now add buttons.
|
|
34
|
+
// View data.
|
|
35
|
+
// Execute On Call
|
|
36
|
+
// Acknowledge scheduledMaintenance
|
|
37
|
+
// Resolve data.
|
|
38
|
+
// Change ScheduledMaintenance State.
|
|
39
|
+
// Add Note.
|
|
40
|
+
|
|
41
|
+
const buttons: Array<WorkspaceMessagePayloadButton> = [];
|
|
42
|
+
|
|
43
|
+
// view data.
|
|
44
|
+
const viewScheduledMaintenanceButton: WorkspaceMessagePayloadButton = {
|
|
45
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
46
|
+
title: "🔗 View Event",
|
|
47
|
+
url: await ScheduledMaintenanceService.getScheduledMaintenanceLinkInDashboard(
|
|
48
|
+
data.projectId!,
|
|
49
|
+
data.scheduledMaintenanceId!,
|
|
50
|
+
),
|
|
51
|
+
value: data.scheduledMaintenanceId?.toString() || "",
|
|
52
|
+
actionId: SlackActionType.ViewScheduledMaintenance,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
buttons.push(viewScheduledMaintenanceButton);
|
|
56
|
+
|
|
57
|
+
// acknowledge data.
|
|
58
|
+
const acknowledgeScheduledMaintenanceButton: WorkspaceMessagePayloadButton =
|
|
59
|
+
{
|
|
60
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
61
|
+
title: "⌛ Mark as Ongoing",
|
|
62
|
+
value: data.scheduledMaintenanceId?.toString() || "",
|
|
63
|
+
actionId: SlackActionType.MarkScheduledMaintenanceAsOngoing,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
buttons.push(acknowledgeScheduledMaintenanceButton);
|
|
67
|
+
|
|
68
|
+
// resolve data.
|
|
69
|
+
const resolveScheduledMaintenanceButton: WorkspaceMessagePayloadButton = {
|
|
70
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
71
|
+
title: "✅ Mark as Completed",
|
|
72
|
+
value: data.scheduledMaintenanceId?.toString() || "",
|
|
73
|
+
actionId: SlackActionType.MarkScheduledMaintenanceAsComplete,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
buttons.push(resolveScheduledMaintenanceButton);
|
|
77
|
+
|
|
78
|
+
// change scheduledMaintenance state.
|
|
79
|
+
const changeScheduledMaintenanceStateButton: WorkspaceMessagePayloadButton =
|
|
80
|
+
{
|
|
81
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
82
|
+
title: "➡️ Change State",
|
|
83
|
+
value: data.scheduledMaintenanceId?.toString() || "",
|
|
84
|
+
actionId: SlackActionType.ViewChangeScheduledMaintenanceState,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
buttons.push(changeScheduledMaintenanceStateButton);
|
|
88
|
+
|
|
89
|
+
// add note.
|
|
90
|
+
const addNoteButton: WorkspaceMessagePayloadButton = {
|
|
91
|
+
_type: "WorkspaceMessagePayloadButton",
|
|
92
|
+
title: "📄 Add Note",
|
|
93
|
+
value: data.scheduledMaintenanceId?.toString() || "",
|
|
94
|
+
actionId: SlackActionType.ViewAddScheduledMaintenanceNote,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
buttons.push(addNoteButton);
|
|
98
|
+
|
|
99
|
+
const workspacePayloadButtons: WorkspacePayloadButtons = {
|
|
100
|
+
buttons: buttons,
|
|
101
|
+
_type: "WorkspacePayloadButtons",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
blockSlack.push(workspacePayloadButtons);
|
|
105
|
+
|
|
106
|
+
return blockSlack;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -5,6 +5,7 @@ import { JSONObject } from "Common/Types/JSON";
|
|
|
5
5
|
import API from "Common/Utils/API";
|
|
6
6
|
import WorkspaceMessagePayload, {
|
|
7
7
|
WorkspaceCheckboxBlock,
|
|
8
|
+
WorkspaceDateTimePickerBlock,
|
|
8
9
|
WorkspaceDropdownBlock,
|
|
9
10
|
WorkspaceMessageBlock,
|
|
10
11
|
WorkspaceMessagePayloadButton,
|
|
@@ -27,6 +28,7 @@ import WorkspaceBase, {
|
|
|
27
28
|
import WorkspaceType from "../../../../Types/Workspace/WorkspaceType";
|
|
28
29
|
import SlackifyMarkdown from "slackify-markdown";
|
|
29
30
|
import { DropdownOption } from "../../../../UI/Components/Dropdown/Dropdown";
|
|
31
|
+
import OneUptimeDate from "../../../../Types/Date";
|
|
30
32
|
|
|
31
33
|
export default class SlackUtil extends WorkspaceBase {
|
|
32
34
|
public static override async getUsernameFromUserId(data: {
|
|
@@ -192,6 +194,18 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
192
194
|
channelId: string;
|
|
193
195
|
workspaceUserId: string;
|
|
194
196
|
}): Promise<void> {
|
|
197
|
+
// check if already in channel.
|
|
198
|
+
const isUserInChannel: boolean = await this.isUserInChannel({
|
|
199
|
+
authToken: data.authToken,
|
|
200
|
+
channelId: data.channelId,
|
|
201
|
+
userId: data.workspaceUserId,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
if (isUserInChannel) {
|
|
205
|
+
logger.debug("User already in channel.");
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
195
209
|
logger.debug("Inviting user to channel with data:");
|
|
196
210
|
logger.debug(data);
|
|
197
211
|
|
|
@@ -441,12 +455,13 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
441
455
|
|
|
442
456
|
public static getValuesFromView(data: {
|
|
443
457
|
view: JSONObject;
|
|
444
|
-
}): Dictionary<string | number | Array<string | number
|
|
458
|
+
}): Dictionary<string | number | Array<string | number> | Date> {
|
|
445
459
|
logger.debug("Getting values from view with data:");
|
|
446
460
|
logger.debug(JSON.stringify(data, null, 2));
|
|
447
461
|
|
|
448
462
|
const slackView: JSONObject = data.view;
|
|
449
|
-
const values: Dictionary<string | number | Array<string | number
|
|
463
|
+
const values: Dictionary<string | number | Array<string | number> | Date> =
|
|
464
|
+
{};
|
|
450
465
|
|
|
451
466
|
if (!slackView["state"] || !(slackView["state"] as JSONObject)["values"]) {
|
|
452
467
|
return {};
|
|
@@ -477,6 +492,13 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
477
492
|
return option["value"] as string | number;
|
|
478
493
|
});
|
|
479
494
|
}
|
|
495
|
+
|
|
496
|
+
// if date picker
|
|
497
|
+
if (value["selected_date_time"]) {
|
|
498
|
+
values[blockId] = OneUptimeDate.fromUnixTimestamp(
|
|
499
|
+
value["selected_date_time"] as number,
|
|
500
|
+
);
|
|
501
|
+
}
|
|
480
502
|
}
|
|
481
503
|
}
|
|
482
504
|
|
|
@@ -789,6 +811,30 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
789
811
|
return checkboxBlock;
|
|
790
812
|
}
|
|
791
813
|
|
|
814
|
+
public static override getDateTimePickerBlock(data: {
|
|
815
|
+
payloadDateTimePickerBlock: WorkspaceDateTimePickerBlock;
|
|
816
|
+
}): JSONObject {
|
|
817
|
+
logger.debug("Getting date time picker block with data:");
|
|
818
|
+
logger.debug(data);
|
|
819
|
+
|
|
820
|
+
const dateTimePickerBlock: JSONObject = {
|
|
821
|
+
type: "input",
|
|
822
|
+
element: {
|
|
823
|
+
type: "datetimepicker",
|
|
824
|
+
action_id: data.payloadDateTimePickerBlock.blockId,
|
|
825
|
+
initial_date: data.payloadDateTimePickerBlock.initialValue,
|
|
826
|
+
},
|
|
827
|
+
label: {
|
|
828
|
+
type: "plain_text",
|
|
829
|
+
text: data.payloadDateTimePickerBlock.label,
|
|
830
|
+
},
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
logger.debug("Date time picker block generated:");
|
|
834
|
+
logger.debug(dateTimePickerBlock);
|
|
835
|
+
return dateTimePickerBlock;
|
|
836
|
+
}
|
|
837
|
+
|
|
792
838
|
public static override getTextAreaBlock(data: {
|
|
793
839
|
payloadTextAreaBlock: WorkspaceTextAreaBlock;
|
|
794
840
|
}): JSONObject {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"features": {
|
|
9
9
|
"app_home": {
|
|
10
|
-
"home_tab_enabled":
|
|
10
|
+
"home_tab_enabled": false,
|
|
11
11
|
"messages_tab_enabled": false,
|
|
12
12
|
"messages_tab_read_only_enabled": false
|
|
13
13
|
},
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"command": "/incident",
|
|
35
35
|
"url": "{{SERVER_URL}}/api/slack/interactive",
|
|
36
36
|
"description": "Create a new Incident in OneUptime",
|
|
37
|
-
"usage_hint": "
|
|
37
|
+
"usage_hint": "[incident title]",
|
|
38
38
|
"should_escape": false
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"command": "/maintenance",
|
|
42
42
|
"url": "{{SERVER_URL}}/api/slack/interactive",
|
|
43
43
|
"description": "Create a new Scheduled Maintenance in OneUptime",
|
|
44
|
-
"usage_hint": "
|
|
44
|
+
"usage_hint": "[maintenance title]",
|
|
45
45
|
"should_escape": false
|
|
46
46
|
}
|
|
47
47
|
]
|
|
@@ -6,6 +6,7 @@ import { JSONObject } from "../../../Types/JSON";
|
|
|
6
6
|
import WorkspaceChannelInvitationPayload from "../../../Types/Workspace/WorkspaceChannelInvitationPayload";
|
|
7
7
|
import WorkspaceMessagePayload, {
|
|
8
8
|
WorkspaceCheckboxBlock,
|
|
9
|
+
WorkspaceDateTimePickerBlock,
|
|
9
10
|
WorkspaceDropdownBlock,
|
|
10
11
|
WorkspaceMessageBlock,
|
|
11
12
|
WorkspaceMessagePayloadButton,
|
|
@@ -126,6 +127,12 @@ export default class WorkspaceBase {
|
|
|
126
127
|
throw new NotImplementedException();
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
public static getDateTimePickerBlock(_data: {
|
|
131
|
+
payloadDateTimePickerBlock: WorkspaceDateTimePickerBlock;
|
|
132
|
+
}): JSONObject {
|
|
133
|
+
throw new NotImplementedException();
|
|
134
|
+
}
|
|
135
|
+
|
|
129
136
|
public static async inviteUserToChannelByChannelId(_data: {
|
|
130
137
|
authToken: string;
|
|
131
138
|
channelId: string;
|
|
@@ -263,6 +270,13 @@ export default class WorkspaceBase {
|
|
|
263
270
|
}),
|
|
264
271
|
);
|
|
265
272
|
break;
|
|
273
|
+
case "WorkspaceDateTimePickerBlock":
|
|
274
|
+
blocks.push(
|
|
275
|
+
this.getDateTimePickerBlock({
|
|
276
|
+
payloadDateTimePickerBlock: block as WorkspaceDateTimePickerBlock,
|
|
277
|
+
}),
|
|
278
|
+
);
|
|
279
|
+
break;
|
|
266
280
|
default:
|
|
267
281
|
logger.error("Unknown block type: " + block._type);
|
|
268
282
|
break;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import ObjectID from "../../../../Types/ObjectID";
|
|
2
|
+
import NotificationRuleEventType from "../../../../Types/Workspace/NotificationRules/EventType";
|
|
3
|
+
import NotificationRuleWorkspaceChannel from "../../../../Types/Workspace/NotificationRules/NotificationRuleWorkspaceChannel";
|
|
4
|
+
import { WorkspaceMessageBlock } from "../../../../Types/Workspace/WorkspaceMessagePayload";
|
|
5
|
+
import WorkspaceType from "../../../../Types/Workspace/WorkspaceType";
|
|
6
|
+
import WorkspaceNotificationRuleService, {
|
|
7
|
+
MessageBlocksByWorkspaceType,
|
|
8
|
+
} from "../../../Services/WorkspaceNotificationRuleService";
|
|
9
|
+
import logger from "../../Logger";
|
|
10
|
+
import SlackAlertMessages from "../Slack/Messages/Alert";
|
|
11
|
+
|
|
12
|
+
export default class AlertWorkspaceMessages {
|
|
13
|
+
public static async createChannelsAndInviteUsersToChannels(data: {
|
|
14
|
+
projectId: ObjectID;
|
|
15
|
+
alertId: ObjectID;
|
|
16
|
+
alertNumber: number;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
channelsCreated: NotificationRuleWorkspaceChannel[];
|
|
19
|
+
} | null> {
|
|
20
|
+
try {
|
|
21
|
+
// we will notify the workspace about the alert creation with the bot tokken which is in WorkspaceProjectAuth Table.
|
|
22
|
+
return await WorkspaceNotificationRuleService.createChannelsAndInviteUsersToChannelsBasedOnRules(
|
|
23
|
+
{
|
|
24
|
+
projectId: data.projectId,
|
|
25
|
+
notificationFor: {
|
|
26
|
+
alertId: data.alertId,
|
|
27
|
+
},
|
|
28
|
+
notificationRuleEventType: NotificationRuleEventType.Alert,
|
|
29
|
+
channelNameSiffix: data.alertNumber.toString(),
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
// log the error and continue.
|
|
34
|
+
logger.error("Error in createChannelsAndInviteUsersToChannels");
|
|
35
|
+
logger.error(err);
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static async getAlertCreateMessageBlocks(data: {
|
|
41
|
+
alertId: ObjectID;
|
|
42
|
+
projectId: ObjectID;
|
|
43
|
+
}): Promise<Array<MessageBlocksByWorkspaceType>> {
|
|
44
|
+
const { alertId, projectId } = data;
|
|
45
|
+
|
|
46
|
+
const slackBlocks: WorkspaceMessageBlock[] =
|
|
47
|
+
await SlackAlertMessages.getAlertCreateMessageBlocks({
|
|
48
|
+
alertId: alertId,
|
|
49
|
+
projectId: projectId!,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const microsoftTeamsBlocks: WorkspaceMessageBlock[] =
|
|
53
|
+
await SlackAlertMessages.getAlertCreateMessageBlocks({
|
|
54
|
+
alertId: alertId,
|
|
55
|
+
projectId: projectId!,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return [
|
|
59
|
+
{
|
|
60
|
+
workspaceType: WorkspaceType.Slack,
|
|
61
|
+
messageBlocks: slackBlocks,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
workspaceType: WorkspaceType.MicrosoftTeams,
|
|
65
|
+
messageBlocks: microsoftTeamsBlocks,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import ObjectID from "../../../../Types/ObjectID";
|
|
2
|
+
import NotificationRuleEventType from "../../../../Types/Workspace/NotificationRules/EventType";
|
|
3
|
+
import NotificationRuleWorkspaceChannel from "../../../../Types/Workspace/NotificationRules/NotificationRuleWorkspaceChannel";
|
|
4
|
+
import { WorkspaceMessageBlock } from "../../../../Types/Workspace/WorkspaceMessagePayload";
|
|
5
|
+
import WorkspaceType from "../../../../Types/Workspace/WorkspaceType";
|
|
6
|
+
import WorkspaceNotificationRuleService, {
|
|
7
|
+
MessageBlocksByWorkspaceType,
|
|
8
|
+
} from "../../../Services/WorkspaceNotificationRuleService";
|
|
9
|
+
import logger from "../../Logger";
|
|
10
|
+
import SlackScheduledMaintenanceMessages from "../Slack/Messages/ScheduledMaintenance";
|
|
11
|
+
|
|
12
|
+
export default class ScheduledMaintenanceWorkspaceMessages {
|
|
13
|
+
public static async createChannelsAndInviteUsersToChannels(data: {
|
|
14
|
+
projectId: ObjectID;
|
|
15
|
+
scheduledMaintenanceId: ObjectID;
|
|
16
|
+
scheduledMaintenanceNumber: number;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
channelsCreated: NotificationRuleWorkspaceChannel[];
|
|
19
|
+
} | null> {
|
|
20
|
+
try {
|
|
21
|
+
// we will notify the workspace about the scheduledMaintenance creation with the bot tokken which is in WorkspaceProjectAuth Table.
|
|
22
|
+
return await WorkspaceNotificationRuleService.createChannelsAndInviteUsersToChannelsBasedOnRules(
|
|
23
|
+
{
|
|
24
|
+
projectId: data.projectId,
|
|
25
|
+
notificationFor: {
|
|
26
|
+
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
|
27
|
+
},
|
|
28
|
+
notificationRuleEventType:
|
|
29
|
+
NotificationRuleEventType.ScheduledMaintenance,
|
|
30
|
+
channelNameSiffix: data.scheduledMaintenanceNumber.toString(),
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
} catch (err) {
|
|
34
|
+
// log the error and continue.
|
|
35
|
+
logger.error(err);
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static async getScheduledMaintenanceCreateMessageBlocks(data: {
|
|
41
|
+
scheduledMaintenanceId: ObjectID;
|
|
42
|
+
projectId: ObjectID;
|
|
43
|
+
}): Promise<Array<MessageBlocksByWorkspaceType>> {
|
|
44
|
+
const { scheduledMaintenanceId, projectId } = data;
|
|
45
|
+
|
|
46
|
+
const slackBlocks: WorkspaceMessageBlock[] =
|
|
47
|
+
await SlackScheduledMaintenanceMessages.getScheduledMaintenanceCreateMessageBlocks(
|
|
48
|
+
{
|
|
49
|
+
scheduledMaintenanceId: scheduledMaintenanceId,
|
|
50
|
+
projectId: projectId!,
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const microsoftTeamsBlocks: WorkspaceMessageBlock[] =
|
|
55
|
+
await SlackScheduledMaintenanceMessages.getScheduledMaintenanceCreateMessageBlocks(
|
|
56
|
+
{
|
|
57
|
+
scheduledMaintenanceId: scheduledMaintenanceId,
|
|
58
|
+
projectId: projectId!,
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
workspaceType: WorkspaceType.Slack,
|
|
65
|
+
messageBlocks: slackBlocks,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
workspaceType: WorkspaceType.MicrosoftTeams,
|
|
69
|
+
messageBlocks: microsoftTeamsBlocks,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
}
|
package/Types/Date.ts
CHANGED
|
@@ -9,6 +9,11 @@ import Timezone from "./Timezone";
|
|
|
9
9
|
export const Moment: typeof moment = moment;
|
|
10
10
|
|
|
11
11
|
export default class OneUptimeDate {
|
|
12
|
+
// get date time from unix timestamp
|
|
13
|
+
public static fromUnixTimestamp(timestamp: number): Date {
|
|
14
|
+
return new Date(timestamp * 1000);
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
public static getInBetweenDatesAsFormattedString(
|
|
13
18
|
inBetween: InBetween<Date>,
|
|
14
19
|
): string {
|
|
@@ -39,6 +39,15 @@ export interface WorkspaceTextBoxBlock extends WorkspaceMessageBlock {
|
|
|
39
39
|
optional?: boolean | undefined;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export interface WorkspaceDateTimePickerBlock extends WorkspaceMessageBlock {
|
|
43
|
+
_type: "WorkspaceDateTimePickerBlock";
|
|
44
|
+
label: string;
|
|
45
|
+
blockId: string;
|
|
46
|
+
initialValue?: string | undefined;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
optional?: boolean | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
42
51
|
export interface WorkspacePayloadImage extends WorkspaceMessageBlock {
|
|
43
52
|
_type: "WorkspacePayloadImage";
|
|
44
53
|
imageUrl: URL;
|
|
@@ -15,6 +15,9 @@ import WorkspaceUserAuthTokenService from "../Services/WorkspaceUserAuthTokenSer
|
|
|
15
15
|
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
|
|
16
16
|
import SlackAuthAction from "../Utils/Workspace/Slack/Actions/Auth";
|
|
17
17
|
import SlackIncidentActions from "../Utils/Workspace/Slack/Actions/Incident";
|
|
18
|
+
import SlackAlertActions from "../Utils/Workspace/Slack/Actions/Alert";
|
|
19
|
+
import SlackScheduledMaintenanceActions from "../Utils/Workspace/Slack/Actions/ScheduledMaintenance";
|
|
20
|
+
import LIMIT_MAX from "../../Types/Database/LimitMax";
|
|
18
21
|
export default class SlackAPI {
|
|
19
22
|
getRouter() {
|
|
20
23
|
const router = Express.getRouter();
|
|
@@ -164,6 +167,37 @@ export default class SlackAPI {
|
|
|
164
167
|
});
|
|
165
168
|
logger.debug("Slack Interactive Auth Result: ");
|
|
166
169
|
logger.debug(authResult);
|
|
170
|
+
// if slack uninstall app then,
|
|
171
|
+
if (authResult.payloadType === "app_uninstall") {
|
|
172
|
+
logger.debug("Slack App Uninstall Request: ");
|
|
173
|
+
// remove the project auth and user auth.
|
|
174
|
+
// delete all user auth tokens for this project.
|
|
175
|
+
await WorkspaceUserAuthTokenService.deleteBy({
|
|
176
|
+
query: {
|
|
177
|
+
projectId: authResult.projectId,
|
|
178
|
+
workspaceType: WorkspaceType.Slack,
|
|
179
|
+
},
|
|
180
|
+
limit: LIMIT_MAX,
|
|
181
|
+
skip: 0,
|
|
182
|
+
props: {
|
|
183
|
+
isRoot: true,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
await WorkspaceProjectAuthTokenService.deleteBy({
|
|
187
|
+
query: {
|
|
188
|
+
projectId: authResult.projectId,
|
|
189
|
+
workspaceType: WorkspaceType.Slack,
|
|
190
|
+
},
|
|
191
|
+
limit: 1,
|
|
192
|
+
skip: 0,
|
|
193
|
+
props: {
|
|
194
|
+
isRoot: true,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
logger.debug("Slack App Uninstall Request: Deleted all auth tokens.");
|
|
198
|
+
// return empty response.
|
|
199
|
+
return Response.sendTextResponse(req, res, "");
|
|
200
|
+
}
|
|
167
201
|
if (authResult.isAuthorized === false) {
|
|
168
202
|
// return empty response if not authorized. Do nothing in this case.
|
|
169
203
|
return Response.sendTextResponse(req, res, "");
|
|
@@ -182,6 +216,26 @@ export default class SlackAPI {
|
|
|
182
216
|
res: res,
|
|
183
217
|
});
|
|
184
218
|
}
|
|
219
|
+
if (SlackAlertActions.isAlertAction({
|
|
220
|
+
actionType: action.actionType,
|
|
221
|
+
})) {
|
|
222
|
+
return SlackAlertActions.handleAlertAction({
|
|
223
|
+
slackRequest: authResult,
|
|
224
|
+
action: action,
|
|
225
|
+
req: req,
|
|
226
|
+
res: res,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (SlackScheduledMaintenanceActions.isScheduledMaintenanceAction({
|
|
230
|
+
actionType: action.actionType,
|
|
231
|
+
})) {
|
|
232
|
+
return SlackScheduledMaintenanceActions.handleScheduledMaintenanceAction({
|
|
233
|
+
slackRequest: authResult,
|
|
234
|
+
action: action,
|
|
235
|
+
req: req,
|
|
236
|
+
res: res,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
185
239
|
}
|
|
186
240
|
return Response.sendErrorResponse(req, res, new BadRequestException("Invalid request"));
|
|
187
241
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlackAPI.js","sourceRoot":"","sources":["../../../../Server/API/SlackAPI.ts"],"names":[],"mappings":"AAAA,OAAO,OAIN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,mBAAmB,MAAM,2CAA2C,CAAC;AAC5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,IAAI,EACJ,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,MAAM,4CAA4C,CAAC;AAC1E,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,gC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