@pipedream/slack 0.5.2 → 0.6.0
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/actions/add-emoji-reaction/add-emoji-reaction.mjs +11 -8
- package/actions/archive-channel/archive-channel.mjs +14 -4
- package/actions/common/build-blocks.mjs +5 -4
- package/actions/common/send-message.mjs +1 -23
- package/actions/create-channel/create-channel.mjs +10 -5
- package/actions/create-reminder/create-reminder.mjs +8 -8
- package/actions/delete-file/delete-file.mjs +6 -4
- package/actions/delete-message/delete-message.mjs +10 -5
- package/actions/find-message/find-message.mjs +21 -13
- package/actions/find-user-by-email/find-user-by-email.mjs +8 -4
- package/actions/get-file/get-file.mjs +6 -11
- package/actions/invite-user-to-channel/invite-user-to-channel.mjs +6 -4
- package/actions/kick-user/kick-user.mjs +17 -4
- package/actions/list-channels/list-channels.mjs +8 -4
- package/actions/list-files/list-files.mjs +21 -13
- package/actions/{list-user-groups-users/list-user-groups-users.mjs → list-group-members/list-group-members.mjs} +12 -6
- package/actions/list-members-in-channel/list-members-in-channel.mjs +22 -4
- package/actions/list-replies/list-replies.mjs +12 -5
- package/actions/list-users/list-users.mjs +8 -4
- package/actions/reply-to-a-message/reply-to-a-message.mjs +10 -10
- package/actions/send-custom-message/send-custom-message.mjs +27 -8
- package/actions/send-large-message/send-large-message.mjs +8 -4
- package/actions/{send-message-private-channel/send-message-private-channel.mjs → send-message/send-message.mjs} +13 -7
- package/actions/set-channel-description/set-channel-description.mjs +32 -0
- package/actions/set-channel-topic/set-channel-topic.mjs +6 -4
- package/actions/set-status/set-status.mjs +44 -0
- package/actions/update-group-members/update-group-members.mjs +67 -0
- package/actions/update-message/update-message.mjs +10 -5
- package/actions/update-profile/update-profile.mjs +70 -13
- package/actions/upload-file/upload-file.mjs +6 -4
- package/actions/verify-slack-signature/verify-slack-signature.mjs +2 -2
- package/package.json +3 -2
- package/slack.app.mjs +72 -71
- package/sources/common/base.mjs +9 -0
- package/sources/new-channel-created/new-channel-created.mjs +1 -1
- package/sources/new-direct-message/new-direct-message.mjs +3 -1
- package/sources/new-direct-message/test-event.mjs +28 -0
- package/sources/new-interaction-event-received/README.md +13 -13
- package/sources/new-interaction-event-received/new-interaction-event-received.mjs +7 -8
- package/sources/new-interaction-event-received/test-event.mjs +86 -0
- package/sources/{new-mention/new-mention.mjs → new-keyword-mention/new-keyword-mention.mjs} +8 -30
- package/sources/new-keyword-mention/test-event.mjs +28 -0
- package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -1
- package/sources/new-reaction-added/new-reaction-added.mjs +4 -1
- package/sources/new-reaction-added/test-event.mjs +193 -0
- package/sources/new-user-mention/new-user-mention.mjs +117 -0
- package/sources/new-user-mention/test-event.mjs +28 -0
- package/actions/add-star/add-star.mjs +0 -43
- package/actions/complete-reminder/complete-reminder.mjs +0 -23
- package/actions/delete-reminder/delete-reminder.mjs +0 -23
- package/actions/get-channel/get-channel.mjs +0 -23
- package/actions/get-reminder/get-reminder.mjs +0 -23
- package/actions/join-channel/join-channel.mjs +0 -23
- package/actions/leave-channel/leave-channel.mjs +0 -23
- package/actions/list-reminders/list-reminders.mjs +0 -24
- package/actions/remove-star/remove-star.mjs +0 -40
- package/actions/send-block-kit-message/send-block-kit-message.mjs +0 -43
- package/actions/send-direct-message/send-direct-message.mjs +0 -32
- package/actions/send-group-message/send-group-message.mjs +0 -32
- package/actions/send-message-public-channel/send-message-public-channel.mjs +0 -38
- package/actions/set-channel-purpose/set-channel-purpose.mjs +0 -30
- package/actions/unarchive-channel/unarchive-channel.mjs +0 -23
- package/actions/update-user-groups-users/update-user-groups-users.mjs +0 -45
- package/sources/new-star-added/new-star-added.mjs +0 -45
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"type": "reaction_added",
|
|
3
|
+
"user": "US676PZLY",
|
|
4
|
+
"reaction": "squirrel",
|
|
5
|
+
"item": {
|
|
6
|
+
"type": "message",
|
|
7
|
+
"channel": "CS8319KD5",
|
|
8
|
+
"ts": "1716405857.659549"
|
|
9
|
+
},
|
|
10
|
+
"item_user": "US676PZLY",
|
|
11
|
+
"event_ts": "1716406183.000100",
|
|
12
|
+
"userInfo": {
|
|
13
|
+
"id": "US676PZLY",
|
|
14
|
+
"team_id": "TS8319547",
|
|
15
|
+
"name": "test.user",
|
|
16
|
+
"deleted": false,
|
|
17
|
+
"color": "9f69e7",
|
|
18
|
+
"real_name": "Test User",
|
|
19
|
+
"tz": "America/New_York",
|
|
20
|
+
"tz_label": "Eastern Daylight Time",
|
|
21
|
+
"tz_offset": -14400,
|
|
22
|
+
"profile": {
|
|
23
|
+
"title": "",
|
|
24
|
+
"phone": "",
|
|
25
|
+
"skype": "",
|
|
26
|
+
"real_name": "Test User",
|
|
27
|
+
"real_name_normalized": "Test User",
|
|
28
|
+
"display_name": "",
|
|
29
|
+
"display_name_normalized": "",
|
|
30
|
+
"fields": null,
|
|
31
|
+
"status_text": "",
|
|
32
|
+
"status_emoji": "",
|
|
33
|
+
"status_emoji_display_info": [],
|
|
34
|
+
"status_expiration": 0,
|
|
35
|
+
"avatar_hash": "g010b11df3bb",
|
|
36
|
+
"email": "test@sample.com",
|
|
37
|
+
"first_name": "Test",
|
|
38
|
+
"last_name": "User",
|
|
39
|
+
"status_text_canonical": "",
|
|
40
|
+
"team": "TS8319547"
|
|
41
|
+
},
|
|
42
|
+
"is_admin": true,
|
|
43
|
+
"is_owner": true,
|
|
44
|
+
"is_primary_owner": true,
|
|
45
|
+
"is_restricted": false,
|
|
46
|
+
"is_ultra_restricted": false,
|
|
47
|
+
"is_bot": false,
|
|
48
|
+
"is_app_user": false,
|
|
49
|
+
"updated": 1703787612,
|
|
50
|
+
"is_email_confirmed": true,
|
|
51
|
+
"has_2fa": false,
|
|
52
|
+
"who_can_share_contact_card": "EVERYONE"
|
|
53
|
+
},
|
|
54
|
+
"itemUserInfo": {
|
|
55
|
+
"id": "US676PZLY",
|
|
56
|
+
"team_id": "TS8319547",
|
|
57
|
+
"name": "test.user",
|
|
58
|
+
"deleted": false,
|
|
59
|
+
"color": "9f69e7",
|
|
60
|
+
"real_name": "Test User",
|
|
61
|
+
"tz": "America/New_York",
|
|
62
|
+
"tz_label": "Eastern Daylight Time",
|
|
63
|
+
"tz_offset": -14400,
|
|
64
|
+
"profile": {
|
|
65
|
+
"title": "",
|
|
66
|
+
"phone": "",
|
|
67
|
+
"skype": "",
|
|
68
|
+
"real_name": "Test User",
|
|
69
|
+
"real_name_normalized": "Test User",
|
|
70
|
+
"display_name": "",
|
|
71
|
+
"display_name_normalized": "",
|
|
72
|
+
"fields": null,
|
|
73
|
+
"status_text": "",
|
|
74
|
+
"status_emoji": "",
|
|
75
|
+
"status_emoji_display_info": [],
|
|
76
|
+
"status_expiration": 0,
|
|
77
|
+
"avatar_hash": "g010b11df3bb",
|
|
78
|
+
"email": "test@sample.com",
|
|
79
|
+
"first_name": "Test",
|
|
80
|
+
"last_name": "User",
|
|
81
|
+
"status_text_canonical": "",
|
|
82
|
+
"team": "TS8319547"
|
|
83
|
+
},
|
|
84
|
+
"is_admin": true,
|
|
85
|
+
"is_owner": true,
|
|
86
|
+
"is_primary_owner": true,
|
|
87
|
+
"is_restricted": false,
|
|
88
|
+
"is_ultra_restricted": false,
|
|
89
|
+
"is_bot": false,
|
|
90
|
+
"is_app_user": false,
|
|
91
|
+
"updated": 1703787612,
|
|
92
|
+
"is_email_confirmed": true,
|
|
93
|
+
"has_2fa": false,
|
|
94
|
+
"who_can_share_contact_card": "EVERYONE"
|
|
95
|
+
},
|
|
96
|
+
"message": {
|
|
97
|
+
"ok": true,
|
|
98
|
+
"messages": [
|
|
99
|
+
{
|
|
100
|
+
"user": "US676PZLY",
|
|
101
|
+
"type": "message",
|
|
102
|
+
"ts": "1716405857.659549",
|
|
103
|
+
"client_msg_id": "fd68d844-687e-41bf-8475-4215bef572c7",
|
|
104
|
+
"text": "hello",
|
|
105
|
+
"team": "TS8319547",
|
|
106
|
+
"blocks": [
|
|
107
|
+
{
|
|
108
|
+
"type": "rich_text",
|
|
109
|
+
"block_id": "ZL1yL",
|
|
110
|
+
"elements": [
|
|
111
|
+
{
|
|
112
|
+
"type": "rich_text_section",
|
|
113
|
+
"elements": [
|
|
114
|
+
{
|
|
115
|
+
"type": "text",
|
|
116
|
+
"text": "hello"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"reactions": [
|
|
124
|
+
{
|
|
125
|
+
"name": "squirrel",
|
|
126
|
+
"users": [
|
|
127
|
+
"US676PZLY"
|
|
128
|
+
],
|
|
129
|
+
"count": 1
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"has_more": false,
|
|
135
|
+
"response_metadata": {
|
|
136
|
+
"scopes": [
|
|
137
|
+
"identify",
|
|
138
|
+
"commands",
|
|
139
|
+
"channels:history",
|
|
140
|
+
"groups:history",
|
|
141
|
+
"im:history",
|
|
142
|
+
"mpim:history",
|
|
143
|
+
"channels:read",
|
|
144
|
+
"emoji:read",
|
|
145
|
+
"files:read",
|
|
146
|
+
"groups:read",
|
|
147
|
+
"im:read",
|
|
148
|
+
"mpim:read",
|
|
149
|
+
"reactions:read",
|
|
150
|
+
"reminders:read",
|
|
151
|
+
"search:read",
|
|
152
|
+
"stars:read",
|
|
153
|
+
"team:read",
|
|
154
|
+
"users:read",
|
|
155
|
+
"users:read.email",
|
|
156
|
+
"pins:read",
|
|
157
|
+
"usergroups:read",
|
|
158
|
+
"dnd:read",
|
|
159
|
+
"users.profile:read",
|
|
160
|
+
"channels:write",
|
|
161
|
+
"chat:write:user",
|
|
162
|
+
"chat:write:bot",
|
|
163
|
+
"files:write:user",
|
|
164
|
+
"groups:write",
|
|
165
|
+
"im:write",
|
|
166
|
+
"mpim:write",
|
|
167
|
+
"reactions:write",
|
|
168
|
+
"reminders:write",
|
|
169
|
+
"stars:write",
|
|
170
|
+
"users:write",
|
|
171
|
+
"pins:write",
|
|
172
|
+
"usergroups:write",
|
|
173
|
+
"dnd:write",
|
|
174
|
+
"users.profile:write",
|
|
175
|
+
"links:read",
|
|
176
|
+
"links:write",
|
|
177
|
+
"remote_files:share",
|
|
178
|
+
"remote_files:read",
|
|
179
|
+
"bookmarks:write",
|
|
180
|
+
"calls:write",
|
|
181
|
+
"calls:read"
|
|
182
|
+
],
|
|
183
|
+
"acceptedScopes": [
|
|
184
|
+
"channels:history",
|
|
185
|
+
"groups:history",
|
|
186
|
+
"mpim:history",
|
|
187
|
+
"im:history",
|
|
188
|
+
"read"
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"pipedream_msg_id": "pd_1716406186371_xezly8lgzn"
|
|
193
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
import constants from "../common/constants.mjs";
|
|
3
|
+
import sampleEmit from "./test-event.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...common,
|
|
7
|
+
key: "slack-new-user-mention",
|
|
8
|
+
name: "New User Mention (Instant)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
description: "Emit new event when a username or specific keyword is mentioned in a channel",
|
|
11
|
+
type: "source",
|
|
12
|
+
dedupe: "unique",
|
|
13
|
+
props: {
|
|
14
|
+
...common.props,
|
|
15
|
+
conversations: {
|
|
16
|
+
propDefinition: [
|
|
17
|
+
common.props.slack,
|
|
18
|
+
"conversation",
|
|
19
|
+
],
|
|
20
|
+
type: "string[]",
|
|
21
|
+
label: "Channels",
|
|
22
|
+
description: "Select one or more channels to monitor for new messages.",
|
|
23
|
+
optional: true,
|
|
24
|
+
},
|
|
25
|
+
// eslint-disable-next-line pipedream/props-description,pipedream/props-label
|
|
26
|
+
slackApphook: {
|
|
27
|
+
type: "$.interface.apphook",
|
|
28
|
+
appProp: "slack",
|
|
29
|
+
async eventNames() {
|
|
30
|
+
return this.conversations || [
|
|
31
|
+
"message",
|
|
32
|
+
];
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
user: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
common.props.slack,
|
|
38
|
+
"user",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
keyword: {
|
|
42
|
+
propDefinition: [
|
|
43
|
+
common.props.slack,
|
|
44
|
+
"keyword",
|
|
45
|
+
],
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
ignoreBot: {
|
|
49
|
+
propDefinition: [
|
|
50
|
+
common.props.slack,
|
|
51
|
+
"ignoreBot",
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
...common.methods,
|
|
57
|
+
getSummary() {
|
|
58
|
+
return "New mention received";
|
|
59
|
+
},
|
|
60
|
+
async processEvent(event) {
|
|
61
|
+
const {
|
|
62
|
+
type: msgType,
|
|
63
|
+
subtype,
|
|
64
|
+
bot_id: botId,
|
|
65
|
+
text,
|
|
66
|
+
blocks = [],
|
|
67
|
+
} = event;
|
|
68
|
+
const [
|
|
69
|
+
{
|
|
70
|
+
elements: [
|
|
71
|
+
{ elements = [] } = {},
|
|
72
|
+
] = [],
|
|
73
|
+
} = {},
|
|
74
|
+
] = blocks;
|
|
75
|
+
|
|
76
|
+
if (msgType !== "message") {
|
|
77
|
+
console.log(`Ignoring event with unexpected type "${msgType}"`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// This source is designed to just emit an event for each new message received.
|
|
82
|
+
// Due to inconsistencies with the shape of message_changed and message_deleted
|
|
83
|
+
// events, we are ignoring them for now. If you want to handle these types of
|
|
84
|
+
// events, feel free to change this code!!
|
|
85
|
+
if (subtype && !constants.ALLOWED_SUBTYPES.includes(subtype)) {
|
|
86
|
+
console.log(`Ignoring message with subtype. "${subtype}"`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if ((this.ignoreBot) && (subtype === constants.SUBTYPE.BOT_MESSAGE || botId)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let emitEvent = false;
|
|
95
|
+
if (elements) {
|
|
96
|
+
let userMatch = false;
|
|
97
|
+
for (const item of elements) {
|
|
98
|
+
if (item.user_id && item.user_id === this.user) {
|
|
99
|
+
userMatch = true;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (userMatch && (!this.keyword || text.indexOf(this.keyword) !== -1)) {
|
|
104
|
+
emitEvent = true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (subtype === constants.SUBTYPE.PD_HISTORY_MESSAGE) {
|
|
108
|
+
emitEvent = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (emitEvent) {
|
|
112
|
+
return event;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
sampleEmit,
|
|
117
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"user": "US676PZLY",
|
|
3
|
+
"type": "message",
|
|
4
|
+
"ts": "1716404766.096289",
|
|
5
|
+
"client_msg_id": "b26387fd-5afe-46a9-bf63-a7aabd6fb40f",
|
|
6
|
+
"text": "hello",
|
|
7
|
+
"team": "TS8319547",
|
|
8
|
+
"blocks": [
|
|
9
|
+
{
|
|
10
|
+
"type": "rich_text",
|
|
11
|
+
"block_id": "aY6KK",
|
|
12
|
+
"elements": [
|
|
13
|
+
{
|
|
14
|
+
"type": "rich_text_section",
|
|
15
|
+
"elements": [
|
|
16
|
+
{
|
|
17
|
+
"type": "text",
|
|
18
|
+
"text": "hello"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"channel": "CS8319KD5",
|
|
26
|
+
"event_ts": "1716404766.096289",
|
|
27
|
+
"channel_type": "channel"
|
|
28
|
+
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-add-star",
|
|
5
|
-
name: "Add Star",
|
|
6
|
-
description: "Add a star to an item on behalf of the authenticated user. [See docs here](https://api.slack.com/methods/stars.add)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
conversation: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"conversation",
|
|
15
|
-
],
|
|
16
|
-
optional: true,
|
|
17
|
-
description: "Channel to add star to, or channel where the message to add star to was posted (used with timestamp).",
|
|
18
|
-
},
|
|
19
|
-
timestamp: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
slack,
|
|
22
|
-
"timestamp",
|
|
23
|
-
],
|
|
24
|
-
optional: true,
|
|
25
|
-
description: "Timestamp of the message to add star to.",
|
|
26
|
-
},
|
|
27
|
-
file: {
|
|
28
|
-
propDefinition: [
|
|
29
|
-
slack,
|
|
30
|
-
"file",
|
|
31
|
-
],
|
|
32
|
-
optional: true,
|
|
33
|
-
description: "File to add star to.",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
async run() {
|
|
37
|
-
return await this.slack.sdk().stars.add({
|
|
38
|
-
channel: this.conversation,
|
|
39
|
-
timestamp: this.timestamp,
|
|
40
|
-
file: this.file,
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-complete-reminder",
|
|
5
|
-
name: "Complete Reminder",
|
|
6
|
-
description: "Complete a reminder. [See docs here](https://api.slack.com/methods/reminders.complete)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
reminder: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"reminder",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run() {
|
|
19
|
-
return await this.slack.sdk().reminders.complete({
|
|
20
|
-
reminder: this.reminder,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-delete-reminder",
|
|
5
|
-
name: "Delete Reminder",
|
|
6
|
-
description: "Delete a reminder. [See docs here](https://api.slack.com/methods/reminders.delete)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
reminder: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"reminder",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run() {
|
|
19
|
-
return await this.slack.sdk().reminders.delete({
|
|
20
|
-
reminder: this.reminder,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-get-channel",
|
|
5
|
-
name: "Get Channel",
|
|
6
|
-
description: "Return information about a workspace channel. [See docs here](https://api.slack.com/methods/conversations.info)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
conversation: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"conversation",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run() {
|
|
19
|
-
return await this.slack.sdk().conversations.info({
|
|
20
|
-
channel: this.conversation,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-get-reminder",
|
|
5
|
-
name: "Get Reminder",
|
|
6
|
-
description: "Return information about a reminder. [See docs here](https://api.slack.com/methods/reminders.info)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
reminder: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"reminder",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run() {
|
|
19
|
-
return await this.slack.sdk().reminders.info({
|
|
20
|
-
reminder: this.reminder,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-join-channel",
|
|
5
|
-
name: "Join Channel",
|
|
6
|
-
description: "Join an existing channel. [See docs here](https://api.slack.com/methods/conversations.join)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
conversation: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"conversation",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run() {
|
|
19
|
-
return await this.slack.sdk().conversations.join({
|
|
20
|
-
channel: this.conversation,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-leave-channel",
|
|
5
|
-
name: "Leave Channel",
|
|
6
|
-
description: "Leave an existing channel. [See docs here](https://api.slack.com/methods/conversations.leave)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
conversation: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"conversation",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run() {
|
|
19
|
-
return await this.slack.sdk().conversations.leave({
|
|
20
|
-
channel: this.conversation,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-list-reminders",
|
|
5
|
-
name: "List Reminders",
|
|
6
|
-
description: "List all reminders for a given user. [See docs here](https://api.slack.com/methods/reminders.list)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
team_id: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"team",
|
|
15
|
-
],
|
|
16
|
-
optional: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
async run() {
|
|
20
|
-
return await this.slack.sdk().reminders.list({
|
|
21
|
-
team_id: this.team_id,
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import slack from "../../slack.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "slack-remove-star",
|
|
5
|
-
name: "Remove Star",
|
|
6
|
-
description: "Remove a star from an item on behalf of the authenticated user. [See docs here](https://api.slack.com/methods/stars.remove)",
|
|
7
|
-
version: "0.0.15",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
slack,
|
|
11
|
-
conversation: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
slack,
|
|
14
|
-
"conversation",
|
|
15
|
-
],
|
|
16
|
-
optional: true,
|
|
17
|
-
},
|
|
18
|
-
timestamp: {
|
|
19
|
-
propDefinition: [
|
|
20
|
-
slack,
|
|
21
|
-
"timestamp",
|
|
22
|
-
],
|
|
23
|
-
optional: true,
|
|
24
|
-
},
|
|
25
|
-
file: {
|
|
26
|
-
propDefinition: [
|
|
27
|
-
slack,
|
|
28
|
-
"file",
|
|
29
|
-
],
|
|
30
|
-
optional: true,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
async run() {
|
|
34
|
-
return await this.slack.sdk().stars.remove({
|
|
35
|
-
channel: this.conversation,
|
|
36
|
-
timestamp: this.timestamp,
|
|
37
|
-
file: this.file,
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import buildBlocks from "../common/build-blocks.mjs";
|
|
2
|
-
import common from "../common/send-message.mjs";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
...common,
|
|
6
|
-
...buildBlocks,
|
|
7
|
-
name: "Build and Send a Block Kit Message (Beta)",
|
|
8
|
-
description: "Configure custom blocks and send to a channel, group, or user. [See Slack's docs for more info](https://api.slack.com/tools/block-kit-builder).",
|
|
9
|
-
version: "0.3.3",
|
|
10
|
-
type: "action",
|
|
11
|
-
key: "slack-send-block-kit-message",
|
|
12
|
-
props: {
|
|
13
|
-
slack: common.props.slack,
|
|
14
|
-
conversation: {
|
|
15
|
-
propDefinition: [
|
|
16
|
-
common.props.slack,
|
|
17
|
-
"conversation",
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
text: {
|
|
21
|
-
propDefinition: [
|
|
22
|
-
common.props.slack,
|
|
23
|
-
"notificationText",
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
...common.props,
|
|
27
|
-
...buildBlocks.props,
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
...common.methods,
|
|
31
|
-
...buildBlocks.methods,
|
|
32
|
-
async getGeneratedBlocks() {
|
|
33
|
-
return await buildBlocks.run.call(this); // call buildBlocks.run with the current context
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
async run({ $ }) {
|
|
37
|
-
this.blocks = await this.getGeneratedBlocks(); // set the blocks prop for common.run to use
|
|
38
|
-
const resp = await common.run.call(this, {
|
|
39
|
-
$,
|
|
40
|
-
}); // call common.run with the current context
|
|
41
|
-
return resp;
|
|
42
|
-
},
|
|
43
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import common from "../common/send-message.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "slack-send-direct-message",
|
|
6
|
-
name: "Send a Direct Message",
|
|
7
|
-
description: "Send a direct message to a single user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.2.20",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
slack: common.props.slack,
|
|
12
|
-
conversation: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.slack,
|
|
15
|
-
"user",
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
text: {
|
|
19
|
-
propDefinition: [
|
|
20
|
-
common.props.slack,
|
|
21
|
-
"text",
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
mrkdwn: {
|
|
25
|
-
propDefinition: [
|
|
26
|
-
common.props.slack,
|
|
27
|
-
"mrkdwn",
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
...common.props,
|
|
31
|
-
},
|
|
32
|
-
};
|