@pipedream/slack_v2 0.1.2 → 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
+ };
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.0",
4
4
  "description": "Pipedream Slack_v2 Components",
5
5
  "main": "slack_v2.app.mjs",
6
6
  "keywords": [