@pipedream/slack_v2 0.1.1 → 0.2.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.
@@ -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
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack_v2-list-channels",
5
5
  name: "List Channels",
6
6
  description: "Return a list of all channels in a workspace. [See the documentation](https://api.slack.com/methods/conversations.list)",
7
- version: "0.1.0",
7
+ version: "0.1.1",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -49,9 +49,12 @@ export default {
49
49
  },
50
50
  async run({ $ }) {
51
51
  const allChannels = [];
52
+ const types = Array.isArray(this.channelTypes)
53
+ ? this.channelTypes.join(",")
54
+ : this.channelTypes;
52
55
  const params = {
53
56
  limit: this.pageSize,
54
- types: this.channelTypes,
57
+ types,
55
58
  };
56
59
  let page = 0;
57
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack_v2",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Pipedream Slack_v2 Components",
5
5
  "main": "slack_v2.app.mjs",
6
6
  "keywords": [