@pipedream/linear_app 0.7.0 → 0.7.2

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.
@@ -4,8 +4,8 @@ export default {
4
4
  type: "action",
5
5
  key: "linear_app-create-issue",
6
6
  name: "Create Issue",
7
- description: "Create an issue (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues)",
8
- version: "0.4.7",
7
+ description: "Creates a new issue in Linear. Requires team ID and title. Optional: description, assignee, project, state. Returns response object with success status and issue details. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).",
8
+ version: "0.4.9",
9
9
  props: {
10
10
  linearApp,
11
11
  teamId: {
@@ -3,8 +3,8 @@ import linearApp from "../../linear_app.app.mjs";
3
3
  export default {
4
4
  key: "linear_app-get-issue",
5
5
  name: "Get Issue",
6
- description: "Get an issue by ID (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api)",
7
- version: "0.1.7",
6
+ description: "Retrieves a Linear issue by its ID. Returns complete issue details including title, description, state, assignee, team, project, labels, and timestamps. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
7
+ version: "0.1.9",
8
8
  type: "action",
9
9
  props: {
10
10
  linearApp,
@@ -1,16 +1,31 @@
1
1
  import linearApp from "../../linear_app.app.mjs";
2
+ import constants from "../../common/constants.mjs";
2
3
 
3
4
  export default {
4
5
  key: "linear_app-get-teams",
5
6
  name: "Get Teams",
6
- description: "Get all the teams (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api)",
7
- version: "0.2.7",
7
+ description: "Retrieves all teams in your Linear workspace. Returns array of team objects with details like ID, name, and key. Supports pagination with configurable limit. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
8
+ version: "0.2.9",
8
9
  type: "action",
9
10
  props: {
10
11
  linearApp,
12
+ limit: {
13
+ propDefinition: [
14
+ linearApp,
15
+ "limit",
16
+ ],
17
+ description: "Maximum number of teams to return. Defaults to 20 if not specified.",
18
+ },
11
19
  },
12
20
  async run({ $ }) {
13
- const { nodes: teams } = await this.linearApp.listTeams();
21
+ // Use the specified limit or default to a reasonable number
22
+ const limit = this.limit || constants.DEFAULT_NO_QUERY_LIMIT;
23
+
24
+ const variables = {
25
+ first: limit,
26
+ };
27
+
28
+ const { nodes: teams } = await this.linearApp.listTeams(variables);
14
29
 
15
30
  $.export("$summary", `Found ${teams.length} teams(s)`);
16
31
 
@@ -1,32 +1,43 @@
1
1
  import linearApp from "../../linear_app.app.mjs";
2
2
  import utils from "../../common/utils.mjs";
3
+ import constants from "../../common/constants.mjs";
3
4
 
4
5
  export default {
5
6
  key: "linear_app-search-issues",
6
7
  name: "Search Issues",
7
- description: "Search issues (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api)",
8
+ description: "Searches Linear issues by team, project, assignee, labels, state, or text query. Supports pagination, ordering, and archived issues. Returns array of matching issues. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
8
9
  type: "action",
9
- version: "0.2.7",
10
+ version: "0.2.9",
10
11
  props: {
11
12
  linearApp,
12
- query: {
13
+ teamId: {
13
14
  propDefinition: [
14
15
  linearApp,
15
- "query",
16
+ "teamId",
16
17
  ],
17
18
  },
18
- teamId: {
19
+ projectId: {
19
20
  propDefinition: [
20
21
  linearApp,
21
- "teamId",
22
+ "projectId",
23
+ ],
24
+ },
25
+ query: {
26
+ propDefinition: [
27
+ linearApp,
28
+ "query",
22
29
  ],
23
30
  optional: true,
24
31
  },
25
- projectId: {
32
+ stateId: {
26
33
  propDefinition: [
27
34
  linearApp,
28
- "projectId",
35
+ "stateId",
36
+ ({ teamId }) => ({
37
+ teamId,
38
+ }),
29
39
  ],
40
+ description: "Filter issues by their workflow state (status). States are scoped to the selected team.",
30
41
  },
31
42
  assigneeId: {
32
43
  propDefinition: [
@@ -52,13 +63,36 @@ export default {
52
63
  "includeArchived",
53
64
  ],
54
65
  },
66
+ limit: {
67
+ propDefinition: [
68
+ linearApp,
69
+ "limit",
70
+ ],
71
+ },
55
72
  },
56
73
  async run({ $ }) {
57
74
  const issues = [];
58
75
  let hasNextPage;
59
76
  let after;
60
77
 
78
+ // Determine the overall max limit for all pages combined
79
+ const maxLimit = this.limit || (this.query
80
+ ? constants.DEFAULT_MAX_RECORDS
81
+ : constants.DEFAULT_NO_QUERY_LIMIT);
82
+
83
+ // For pagination, we'll use a smaller page size
84
+ const pageSize = Math.min(maxLimit, constants.DEFAULT_LIMIT);
85
+
61
86
  do {
87
+ // If we've already reached our limit, stop fetching more data
88
+ if (issues.length >= maxLimit) {
89
+ break;
90
+ }
91
+
92
+ // Calculate how many more items we need for this page
93
+ const remainingNeeded = maxLimit - issues.length;
94
+ const thisPageLimit = Math.min(pageSize, remainingNeeded);
95
+
62
96
  const variables = utils.buildVariables(after, {
63
97
  filter: {
64
98
  query: this.query,
@@ -66,10 +100,19 @@ export default {
66
100
  projectId: this.projectId,
67
101
  assigneeId: this.assigneeId,
68
102
  issueLabels: this.issueLabels,
103
+ state: this.stateId
104
+ ? {
105
+ id: {
106
+ eq: this.stateId,
107
+ },
108
+ }
109
+ : undefined,
69
110
  },
70
111
  orderBy: this.orderBy,
71
112
  includeArchived: this.includeArchived,
113
+ limit: thisPageLimit, // Use calculated limit for this page
72
114
  });
115
+
73
116
  const {
74
117
  nodes,
75
118
  pageInfo,
@@ -78,7 +121,7 @@ export default {
78
121
  issues.push(...nodes);
79
122
  after = pageInfo.endCursor;
80
123
  hasNextPage = pageInfo.hasNextPage;
81
- } while (hasNextPage);
124
+ } while (hasNextPage && issues.length < maxLimit);
82
125
 
83
126
  $.export("$summary", `Found ${issues.length} issues`);
84
127
 
@@ -3,9 +3,9 @@ import linearApp from "../../linear_app.app.mjs";
3
3
  export default {
4
4
  key: "linear_app-update-issue",
5
5
  name: "Update Issue",
6
- description: "Update an issue (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues)",
6
+ description: "Updates an existing Linear issue. Can modify title, description, assignee, state, project, team, labels, priority, and dates. Returns updated issue details. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).",
7
7
  type: "action",
8
- version: "0.1.7",
8
+ version: "0.1.9",
9
9
  props: {
10
10
  linearApp,
11
11
  teamId: {
@@ -2,6 +2,7 @@ const WEBHOOK_ID = "webhookId";
2
2
  const LINEAR_DELIVERY_HEADER = "linear-delivery";
3
3
  const DEFAULT_LIMIT = 100;
4
4
  const DEFAULT_MAX_RECORDS = 200;
5
+ const DEFAULT_NO_QUERY_LIMIT = 20;
5
6
 
6
7
  const ACTION = {
7
8
  CREATE: "create",
@@ -49,6 +50,7 @@ export default {
49
50
  LINEAR_DELIVERY_HEADER,
50
51
  DEFAULT_LIMIT,
51
52
  DEFAULT_MAX_RECORDS,
53
+ DEFAULT_NO_QUERY_LIMIT,
52
54
  ACTION,
53
55
  RESOURCE_TYPE,
54
56
  RESOURCE_TYPES,
package/common/utils.mjs CHANGED
@@ -59,7 +59,17 @@ function buildVariables(endCursor, args) {
59
59
  const after = endCursor
60
60
  ? `, after: "${endCursor}"`
61
61
  : "";
62
- return strToObj(`{ filter: { ${filter} }, first: ${constants.DEFAULT_LIMIT}${orderBy}${includeArchived}${after} }`);
62
+ // Determine the appropriate limit:
63
+ // 1. Use custom limit if provided
64
+ // 2. Use a smaller default limit when no query is provided to avoid returning too many results
65
+ // 3. Otherwise use the standard default limit
66
+ const limit = args.limit
67
+ ? args.limit
68
+ : (args.filter.query
69
+ ? constants.DEFAULT_LIMIT
70
+ : constants.DEFAULT_NO_QUERY_LIMIT);
71
+
72
+ return strToObj(`{ filter: { ${filter} }, first: ${limit}${orderBy}${includeArchived}${after} }`);
63
73
  }
64
74
 
65
75
  export default {
@@ -164,7 +164,8 @@ export default {
164
164
  query: {
165
165
  type: "string",
166
166
  label: "Query",
167
- description: "Search string to look for",
167
+ description: "Search string to look for in issue titles. The query is used to filter issues where the title contains the query text (case insensitive).",
168
+ optional: true,
168
169
  },
169
170
  orderBy: {
170
171
  type: "string",
@@ -179,6 +180,12 @@ export default {
179
180
  description: "Should archived resources be included? (default: `false`)",
180
181
  optional: true,
181
182
  },
183
+ limit: {
184
+ type: "integer",
185
+ label: "Limit",
186
+ description: "Maximum number of issues to return. If no query is provided, this defaults to 20 to avoid returning too many results.",
187
+ optional: true,
188
+ },
182
189
  },
183
190
  methods: {
184
191
  getAxiosHeaders() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/linear_app",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Pipedream Linear_app Components",
5
5
  "main": "linear_app.app.mjs",
6
6
  "keywords": [
@@ -4,10 +4,10 @@ import constants from "../../common/constants.mjs";
4
4
  export default {
5
5
  ...common,
6
6
  key: "linear_app-comment-created-instant",
7
- name: "New Created Comment (Instant)",
8
- description: "Emit new event when a new comment is created. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",
7
+ name: "New Comment Created (Instant)",
8
+ description: "Triggers instantly when a new comment is added to an issue in Linear. Returns comment details including content, author, issue reference, and timestamps. Supports filtering by team. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/webhooks).",
9
9
  type: "source",
10
- version: "0.1.9",
10
+ version: "0.1.11",
11
11
  dedupe: "unique",
12
12
  methods: {
13
13
  ...common.methods,
@@ -21,6 +21,13 @@ export default {
21
21
  "projectId",
22
22
  ],
23
23
  },
24
+ limit: {
25
+ propDefinition: [
26
+ linearApp,
27
+ "limit",
28
+ ],
29
+ description: "Maximum number of items to return when polling. Defaults to 20 if not specified.",
30
+ },
24
31
  db: "$.service.db",
25
32
  },
26
33
  async additionalProps() {
@@ -102,10 +109,14 @@ export default {
102
109
  return data?.user?.admin;
103
110
  },
104
111
  async emitPolledResources() {
112
+ // Use the specified limit or default to a reasonable number
113
+ const maxLimit = this.limit || constants.DEFAULT_NO_QUERY_LIMIT;
114
+
105
115
  const stream = this.linearApp.paginateResources({
106
116
  resourcesFn: this.getResourcesFn(),
107
117
  resourcesFnArgs: this.getResourcesFnArgs(),
108
118
  useGraphQl: this.useGraphQl(),
119
+ max: maxLimit, // Apply the limit to pagination
109
120
  });
110
121
  const resources = await utils.streamIterator(stream);
111
122
 
@@ -4,10 +4,10 @@ import constants from "../../common/constants.mjs";
4
4
  export default {
5
5
  ...common,
6
6
  key: "linear_app-issue-created-instant",
7
- name: "New Created Issue (Instant)",
8
- description: "Emit new event when a new issue is created. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",
7
+ name: "New Issue Created (Instant)",
8
+ description: "Triggers instantly when a new issue is created in Linear. Provides complete issue details including title, description, team, assignee, state, and timestamps. Supports filtering by team and project. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/webhooks).",
9
9
  type: "source",
10
- version: "0.3.9",
10
+ version: "0.3.11",
11
11
  dedupe: "unique",
12
12
  methods: {
13
13
  ...common.methods,
@@ -4,10 +4,10 @@ import constants from "../../common/constants.mjs";
4
4
  export default {
5
5
  ...common,
6
6
  key: "linear_app-issue-updated-instant",
7
- name: "New Updated Issue (Instant)",
8
- description: "Emit new event when an issue is updated. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",
7
+ name: "Issue Updated (Instant)",
8
+ description: "Triggers instantly when any issue is updated in Linear. Provides complete issue details with changes. Supports filtering by team and project. Includes all updates except status changes. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/webhooks).",
9
9
  type: "source",
10
- version: "0.3.9",
10
+ version: "0.3.11",
11
11
  dedupe: "unique",
12
12
  methods: {
13
13
  ...common.methods,
@@ -5,10 +5,10 @@ import utils from "../../common/utils.mjs";
5
5
  export default {
6
6
  ...common,
7
7
  key: "linear_app-new-issue-status-updated",
8
- name: "New Issue Status Updated (Instant)",
9
- description: "Emit new event when the status of an issue is updated. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",
8
+ name: "Issue Status Updated (Instant)",
9
+ description: "Triggers instantly when an issue's workflow state changes (e.g., Todo to In Progress). Returns issue with previous and current state info. Can filter by specific target state. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/webhooks).",
10
10
  type: "source",
11
- version: "0.1.9",
11
+ version: "0.1.11",
12
12
  dedupe: "unique",
13
13
  props: {
14
14
  linearApp: common.props.linearApp,
@@ -108,11 +108,14 @@ export default {
108
108
  const previousStatuses = this._getPreviousStatuses();
109
109
  const newStatuses = {};
110
110
 
111
+ // Use the specified limit or default to a reasonable number
112
+ const maxLimit = this.limit || constants.DEFAULT_NO_QUERY_LIMIT;
113
+
111
114
  const stream = this.linearApp.paginateResources({
112
115
  resourcesFn: this.getResourcesFn(),
113
116
  resourcesFnArgs: this.getResourcesFnArgs(),
114
117
  useGraphQl: this.useGraphQl(),
115
- max: 1000,
118
+ max: maxLimit, // Use the configured limit instead of hardcoded 1000
116
119
  });
117
120
  const resources = await utils.streamIterator(stream);
118
121
 
@@ -6,9 +6,9 @@ export default {
6
6
  ...common,
7
7
  key: "linear_app-new-projectupdate-created",
8
8
  name: "New Project Update Written (Instant)",
9
- description: "Project updates are short status reports on the health of your projects. Emit new event when a new Project Update is written. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",
9
+ description: "Triggers instantly when a project update (status report) is created in Linear. Returns update content, author, project details, and health status. Filters by team and optionally by project. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/webhooks).",
10
10
  type: "source",
11
- version: "0.0.1",
11
+ version: "0.0.3",
12
12
  dedupe: "unique",
13
13
  props: {
14
14
  linearApp,
@@ -5,10 +5,10 @@ import linearApp from "../../linear_app.app.mjs";
5
5
  export default {
6
6
  ...common,
7
7
  key: "linear_app-project-updated-instant",
8
- name: "New Updated Project (Instant)",
9
- description: "Emit new event when a project is updated. [See the documentation](https://developers.linear.app/docs/graphql/webhooks)",
8
+ name: "Project Updated (Instant)",
9
+ description: "Triggers instantly when a project is updated in Linear. Returns project details including name, description, status, dates, and team info. Supports filtering by specific teams. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/webhooks).",
10
10
  type: "source",
11
- version: "0.0.2",
11
+ version: "0.0.4",
12
12
  dedupe: "unique",
13
13
  props: {
14
14
  linearApp,