@pipedream/linear 0.8.0 → 0.8.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,47 @@
|
|
|
1
|
+
import linearApp from "../../linear.app.mjs";
|
|
2
|
+
|
|
3
|
+
const DEFAULT_CONNECTION_LIMIT = 50;
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "linear-get-current-user",
|
|
7
|
+
name: "Get Current User",
|
|
8
|
+
description: "Retrieve rich context about the authenticated Linear user, including core profile fields, recent timestamps, direct team memberships, and high-level organization settings. Returns the user object, a paginated team list (with names, keys, cycle configs, etc.), associated team memberships, and organization metadata such as auth defaults and SCIM/SAML flags. Use this when your workflow or agent needs to understand who is currently authenticated, which teams they belong to, or what workspace policies might influence subsequent Linear actions. See Linear's GraphQL viewer docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
annotations: {
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
openWorldHint: true,
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
linearApp,
|
|
18
|
+
},
|
|
19
|
+
async run({ $ }) {
|
|
20
|
+
const client = this.linearApp.client();
|
|
21
|
+
const viewer = await client.viewer;
|
|
22
|
+
|
|
23
|
+
const [
|
|
24
|
+
organization,
|
|
25
|
+
teamsConnection,
|
|
26
|
+
teamMembershipsConnection,
|
|
27
|
+
] = await Promise.all([
|
|
28
|
+
viewer.organization,
|
|
29
|
+
viewer.teams({
|
|
30
|
+
first: DEFAULT_CONNECTION_LIMIT,
|
|
31
|
+
}),
|
|
32
|
+
viewer.teamMemberships({
|
|
33
|
+
first: DEFAULT_CONNECTION_LIMIT,
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
const summaryIdentifier = viewer.name || viewer.displayName || viewer.email || viewer.id;
|
|
38
|
+
$.export("$summary", `Retrieved Linear user ${summaryIdentifier}`);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
user: viewer,
|
|
42
|
+
organization,
|
|
43
|
+
teams: teamsConnection,
|
|
44
|
+
teamMemberships: teamMembershipsConnection,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
};
|