@pipedream/linear_app 0.5.5 → 0.5.6
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/README.md +8 -5
- package/package.json +2 -2
- package/sources/comment-created-instant/comment-created-instant.mjs +1 -1
- package/sources/common/webhook.mjs +30 -0
- package/sources/issue-created-instant/issue-created-instant.mjs +1 -1
- package/sources/issue-updated-instant/issue-updated-instant.mjs +1 -1
- package/sources/new-issue-status-updated/new-issue-status-updated.mjs +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
your development process. Here are some examples of what you can build:
|
|
3
|
+
Linear helps streamline software project management, bug tracking, and task coordination. By using the Linear (API key) API with Pipedream, you can automate routine tasks, sync issues across platforms, and trigger custom workflows. Think auto-assignment of tasks based on specific triggers or pushing updates to a Slack channel when an issue's status changes. These automations save time and ensure that your development team stays focused on coding rather than on administrative overhead.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
5
|
+
# Example Use Cases
|
|
6
|
+
|
|
7
|
+
- **Sync Issues with Google Sheets**: Use Pipedream to monitor new issues in Linear and automatically add them to a Google Sheets spreadsheet. This can help with reporting, auditing, and providing a high-level overview of tasks without needing to access Linear directly.
|
|
8
|
+
|
|
9
|
+
- **Automate Task Assignment Based on Labels**: When a new issue is created in Linear with a specific label (e.g., "urgent"), you can set up a Pipedream workflow to automatically assign it to a designated team member or escalate it by creating a high-priority notification in your team's messaging app, like Slack or Microsoft Teams.
|
|
10
|
+
|
|
11
|
+
- **Create GitHub Issues from Linear Tasks**: For development teams using both Linear and GitHub, a workflow can be set up to create a new GitHub issue whenever a Linear task reaches a certain stage or is tagged for development. This ensures that your code repository is always in sync with your project management tool.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/linear_app",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Pipedream Linear_app Components",
|
|
5
5
|
"main": "linear_app.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@linear/sdk": "^13.0.0",
|
|
18
|
-
"@pipedream/platform": "^
|
|
18
|
+
"@pipedream/platform": "^3.0.3"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Created Comment (Instant)",
|
|
8
8
|
description: "Emit new event when a new comment is created. See the docs [here](https://developers.linear.app/docs/graphql/webhooks)",
|
|
9
9
|
type: "source",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.6",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
methods: {
|
|
13
13
|
...common.methods,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import linearApp from "../../linear_app.app.mjs";
|
|
2
2
|
import constants from "../../common/constants.mjs";
|
|
3
3
|
import utils from "../../common/utils.mjs";
|
|
4
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
props: {
|
|
@@ -12,6 +13,7 @@ export default {
|
|
|
12
13
|
linearApp,
|
|
13
14
|
"teamId",
|
|
14
15
|
],
|
|
16
|
+
reloadProps: true,
|
|
15
17
|
},
|
|
16
18
|
projectId: {
|
|
17
19
|
propDefinition: [
|
|
@@ -22,6 +24,17 @@ export default {
|
|
|
22
24
|
http: "$.interface.http",
|
|
23
25
|
db: "$.service.db",
|
|
24
26
|
},
|
|
27
|
+
async additionalProps() {
|
|
28
|
+
const props = {};
|
|
29
|
+
if (!(await this.isAdmin())) {
|
|
30
|
+
props.alert = {
|
|
31
|
+
type: "alert",
|
|
32
|
+
alertType: "error",
|
|
33
|
+
content: "You must have an admin role to create or manage webhooks. See the Linear [documentation](https://linear.app/docs/api-and-webhooks#webhooks) for details.",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return props;
|
|
37
|
+
},
|
|
25
38
|
methods: {
|
|
26
39
|
setWebhookId(teamId, id) {
|
|
27
40
|
this.db.set(`webhook-${teamId}`, id);
|
|
@@ -59,9 +72,26 @@ export default {
|
|
|
59
72
|
getLoadedProjectId() {
|
|
60
73
|
throw new Error("Get loaded project ID not implemented");
|
|
61
74
|
},
|
|
75
|
+
async isAdmin() {
|
|
76
|
+
const { data } = await this.linearApp.makeAxiosRequest({
|
|
77
|
+
method: "POST",
|
|
78
|
+
data: {
|
|
79
|
+
"query": `{
|
|
80
|
+
user(id: "me") {
|
|
81
|
+
admin
|
|
82
|
+
}
|
|
83
|
+
}`,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
return data?.user?.admin;
|
|
87
|
+
},
|
|
62
88
|
},
|
|
63
89
|
hooks: {
|
|
64
90
|
async deploy() {
|
|
91
|
+
if (!(await this.isAdmin())) {
|
|
92
|
+
throw new ConfigurationError("You must have an admin role to create or manage webhooks. See the Linear [documentation](https://linear.app/docs/api-and-webhooks#webhooks) for details.");
|
|
93
|
+
}
|
|
94
|
+
|
|
65
95
|
// Retrieve historical events
|
|
66
96
|
console.log("Retrieving historical events...");
|
|
67
97
|
const stream = this.linearApp.paginateResources({
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Created Issue (Instant)",
|
|
8
8
|
description: "Emit new event when a new issue is created. See the docs [here](https://developers.linear.app/docs/graphql/webhooks)",
|
|
9
9
|
type: "source",
|
|
10
|
-
version: "0.3.
|
|
10
|
+
version: "0.3.6",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
methods: {
|
|
13
13
|
...common.methods,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Updated Issue (Instant)",
|
|
8
8
|
description: "Emit new event when an issue is updated. See the docs [here](https://developers.linear.app/docs/graphql/webhooks)",
|
|
9
9
|
type: "source",
|
|
10
|
-
version: "0.3.
|
|
10
|
+
version: "0.3.6",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
methods: {
|
|
13
13
|
...common.methods,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Issue Status Updated (Instant)",
|
|
8
8
|
description: "Emit new event when the status of an issue is updated. See the docs [here](https://developers.linear.app/docs/graphql/webhooks)",
|
|
9
9
|
type: "source",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.6",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
13
13
|
linearApp: common.props.linearApp,
|