@pipedream/slack_v2 0.1.2 → 0.2.1

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.
@@ -0,0 +1,51 @@
1
+ import slack from "../../slack_v2.app.mjs";
2
+
3
+ export default {
4
+ key: "slack_v2-find-user-by-id",
5
+ name: "Find User by ID",
6
+ description: "Find a user by their ID. Returns user profile information including name, email (requires `users:read.email` scope), timezone, and status. [See the documentation](https://api.slack.com/methods/users.info)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ slack,
16
+ user: {
17
+ propDefinition: [
18
+ slack,
19
+ "user",
20
+ ],
21
+ description: "Select a user or enter a user ID (e.g., `U1234567890`)",
22
+ },
23
+ includeLocale: {
24
+ type: "boolean",
25
+ label: "Include Locale",
26
+ description: "Set to `true` to receive the locale for this user",
27
+ default: false,
28
+ optional: true,
29
+ },
30
+ },
31
+ async run({ $ }) {
32
+ let response;
33
+ try {
34
+ response = await this.slack.usersInfo({
35
+ user: this.user,
36
+ include_locale: this.includeLocale,
37
+ });
38
+ } catch (err) {
39
+ $.export("$summary", `Failed to find user ${this.user}: ${err.message || err}`);
40
+ throw err;
41
+ }
42
+
43
+ const displayName = response.user.profile?.display_name
44
+ || response.user.profile?.real_name
45
+ || response.user.name
46
+ || this.user;
47
+ $.export("$summary", `Successfully found user ${displayName}`);
48
+
49
+ return response;
50
+ },
51
+ };
@@ -0,0 +1,50 @@
1
+ import slack from "../../slack_v2.app.mjs";
2
+
3
+ export default {
4
+ key: "slack_v2-get-channel-details",
5
+ name: "Get Channel Details",
6
+ description: "Retrieve details for a Slack channel by selecting it or providing an ID. [See the documentation](https://api.slack.com/methods/conversations.info)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ slack,
16
+ channel: {
17
+ propDefinition: [
18
+ slack,
19
+ "conversation",
20
+ ],
21
+ description: "Select a channel or provide a channel ID.",
22
+ },
23
+ includeLocale: {
24
+ type: "boolean",
25
+ label: "Include Locale",
26
+ description: "Set to `true` to receive the locale for this channel",
27
+ default: false,
28
+ optional: true,
29
+ },
30
+ includeNumberOfMembers: {
31
+ type: "boolean",
32
+ label: "Include Member Count",
33
+ description: "Set to `true` to receive the number of members of this channel",
34
+ default: false,
35
+ optional: true,
36
+ },
37
+ },
38
+ async run({ $ }) {
39
+ const response = await this.slack.conversationsInfo({
40
+ channel: this.channel,
41
+ include_locale: this.includeLocale,
42
+ include_num_members: this.includeNumberOfMembers,
43
+ });
44
+
45
+ const channelName = response.channel?.name || response.channel?.id || this.channel;
46
+ $.export("$summary", `Fetched details for channel ${channelName}`);
47
+
48
+ return response;
49
+ },
50
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack_v2",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Pipedream Slack_v2 Components",
5
5
  "main": "slack_v2.app.mjs",
6
6
  "keywords": [
@@ -17,6 +17,6 @@
17
17
  "@pipedream/platform": "^3.1.1",
18
18
  "@slack/web-api": "^7.9.0",
19
19
  "async-retry": "^1.3.3",
20
- "lodash": "^4.17.21"
20
+ "lodash": "^4.17.23"
21
21
  }
22
22
  }