diff --git a/components/linear_app/actions/create-issue/create-issue.mjs b/components/linear_app/actions/create-issue/create-issue.mjs index dcaafddbb294d..6aeb9a2515f44 100644 --- a/components/linear_app/actions/create-issue/create-issue.mjs +++ b/components/linear_app/actions/create-issue/create-issue.mjs @@ -4,8 +4,8 @@ export default { type: "action", key: "linear_app-create-issue", name: "Create Issue", - 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).", - version: "0.4.13", + 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 the documentation](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).", + version: "0.4.14", annotations: { destructiveHint: true, openWorldHint: true, @@ -55,6 +55,21 @@ export default { }), ], }, + labelIds: { + propDefinition: [ + linearApp, + "issueLabels", + () => ({ + byId: true, + }), + ], + }, + priority: { + propDefinition: [ + linearApp, + "issuePriority", + ], + }, }, async run({ $ }) { const { @@ -65,6 +80,8 @@ export default { teamId, assigneeId, stateId, + labelIds, + priority, } = this; const response = @@ -75,6 +92,8 @@ export default { description, assigneeId, stateId, + labelIds, + priority, }); const summary = response.success diff --git a/components/linear_app/actions/create-project/create-project.mjs b/components/linear_app/actions/create-project/create-project.mjs new file mode 100644 index 0000000000000..5bfdd6fe5f83b --- /dev/null +++ b/components/linear_app/actions/create-project/create-project.mjs @@ -0,0 +1,93 @@ +import linearApp from "../../linear_app.app.mjs"; + +export default { + key: "linear_app-create-project", + name: "Create Project", + description: "Create a project in Linear. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/inputs/ProjectCreateInput).", + type: "action", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + props: { + linearApp, + teamId: { + propDefinition: [ + linearApp, + "teamId", + ], + }, + name: { + type: "string", + label: "Name", + description: "The name of the project", + }, + description: { + type: "string", + label: "Description", + description: "The description of the project", + optional: true, + }, + statusId: { + propDefinition: [ + linearApp, + "projectStatusId", + ], + }, + priority: { + propDefinition: [ + linearApp, + "projectPriority", + ], + }, + memberIds: { + propDefinition: [ + linearApp, + "assigneeId", + ], + type: "string[]", + label: "Member IDs", + description: "The IDs of the members of the project", + optional: true, + }, + startDate: { + type: "string", + label: "Start Date", + description: "The start date of the project in ISO 8601 format", + optional: true, + }, + targetDate: { + type: "string", + label: "Target Date", + description: "The target date of the project in ISO 8601 format", + optional: true, + }, + labelIds: { + propDefinition: [ + linearApp, + "projectLabelIds", + ], + }, + }, + async run({ $ }) { + const response = await this.linearApp.client().createProject({ + teamIds: [ + this.teamId, + ], + name: this.name, + description: this.description, + statusId: this.statusId, + priority: this.priority, + memberIds: this.memberIds, + startDate: this.startDate, + targetDate: this.targetDate, + labelIds: this.labelIds, + }); + + $.export("$summary", `Successfully created project with ID ${response._project.id}`); + + return response; + }, +}; diff --git a/components/linear_app/actions/get-issue/get-issue.mjs b/components/linear_app/actions/get-issue/get-issue.mjs index 56b4c8a3d6b61..1830e8ef8a913 100644 --- a/components/linear_app/actions/get-issue/get-issue.mjs +++ b/components/linear_app/actions/get-issue/get-issue.mjs @@ -4,7 +4,7 @@ export default { key: "linear_app-get-issue", name: "Get Issue", 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).", - version: "0.1.13", + version: "0.1.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linear_app/actions/get-teams/get-teams.mjs b/components/linear_app/actions/get-teams/get-teams.mjs index 24da0fe899531..f6e12ba0e3d83 100644 --- a/components/linear_app/actions/get-teams/get-teams.mjs +++ b/components/linear_app/actions/get-teams/get-teams.mjs @@ -5,7 +5,7 @@ export default { key: "linear_app-get-teams", name: "Get Teams", 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).", - version: "0.2.13", + version: "0.2.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linear_app/actions/list-projects/list-projects.mjs b/components/linear_app/actions/list-projects/list-projects.mjs new file mode 100644 index 0000000000000..7ac18ce67bf66 --- /dev/null +++ b/components/linear_app/actions/list-projects/list-projects.mjs @@ -0,0 +1,66 @@ +import linearApp from "../../linear_app.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "linear_app-list-projects", + name: "List Projects", + description: "List projects in Linear. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/objects/ProjectConnection?query=projects).", + type: "action", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + linearApp, + teamId: { + propDefinition: [ + linearApp, + "teamId", + ], + }, + orderBy: { + propDefinition: [ + linearApp, + "orderBy", + ], + }, + first: { + type: "integer", + label: "First", + description: "The number of projects to return", + optional: true, + }, + after: { + type: "string", + label: "After", + description: "The cursor to return the next page of projects", + optional: true, + }, + }, + async run({ $ }) { + const variables = utils.buildVariables(this.after, { + filter: { + accessibleTeams: { + id: { + eq: this.teamId, + }, + }, + }, + orderBy: this.orderBy, + limit: this.first, + }); + + const { + nodes, pageInfo, + } = await this.linearApp.listProjects(variables); + + $.export("$summary", `Found ${nodes.length} projects`); + + return { + nodes, + pageInfo, + }; + }, +}; diff --git a/components/linear_app/actions/search-issues/search-issues.mjs b/components/linear_app/actions/search-issues/search-issues.mjs index 05f61637e34f3..7b37e41f31ffa 100644 --- a/components/linear_app/actions/search-issues/search-issues.mjs +++ b/components/linear_app/actions/search-issues/search-issues.mjs @@ -7,7 +7,7 @@ export default { name: "Search Issues", 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).", type: "action", - version: "0.2.13", + version: "0.2.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linear_app/actions/update-issue/update-issue.mjs b/components/linear_app/actions/update-issue/update-issue.mjs index 382faeffbc582..157ee7570885e 100644 --- a/components/linear_app/actions/update-issue/update-issue.mjs +++ b/components/linear_app/actions/update-issue/update-issue.mjs @@ -3,9 +3,9 @@ import linearApp from "../../linear_app.app.mjs"; export default { key: "linear_app-update-issue", name: "Update Issue", - 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).", + 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 the documentation](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).", type: "action", - version: "0.1.13", + version: "0.1.14", annotations: { destructiveHint: true, openWorldHint: true, @@ -68,6 +68,30 @@ export default { "assigneeId", ], }, + labelIds: { + propDefinition: [ + linearApp, + "issueLabels", + () => ({ + byId: true, + }), + ], + }, + projectId: { + propDefinition: [ + linearApp, + "projectId", + ({ teamId }) => ({ + teamId, + }), + ], + }, + priority: { + propDefinition: [ + linearApp, + "issuePriority", + ], + }, }, async run({ $ }) { const { @@ -77,6 +101,9 @@ export default { teamIdToUpdate, stateId, assigneeId, + labelIds, + projectId, + priority, } = this; const response = @@ -88,6 +115,9 @@ export default { description, assigneeId, stateId, + labelIds, + projectId, + priority, }, }); diff --git a/components/linear_app/common/constants.mjs b/components/linear_app/common/constants.mjs index c62e5c784347e..bcda30844cce5 100644 --- a/components/linear_app/common/constants.mjs +++ b/components/linear_app/common/constants.mjs @@ -45,6 +45,29 @@ const ORDER_BY_OPTIONS = [ }, ]; +const PRIORITY_OPTIONS = [ + { + value: 0, + label: "No priority", + }, + { + value: 1, + label: "Urgent", + }, + { + value: 2, + label: "High", + }, + { + value: 3, + label: "Normal", + }, + { + value: 4, + label: "Low", + }, +]; + export default { WEBHOOK_ID, LINEAR_DELIVERY_HEADER, @@ -57,4 +80,5 @@ export default { CLIENT_IPS, ORDER_BY_OPTIONS, FIELD, + PRIORITY_OPTIONS, }; diff --git a/components/linear_app/linear_app.app.mjs b/components/linear_app/linear_app.app.mjs index 951e8ec173343..c1214f418e7b1 100644 --- a/components/linear_app/linear_app.app.mjs +++ b/components/linear_app/linear_app.app.mjs @@ -151,14 +151,73 @@ export default { label: "Issue Labels", description: "The labels in the issue", optional: true, - async options({ prevContext }) { + async options({ + prevContext, byId = false, + }) { return this.listResourcesOptions({ prevContext, resourcesFn: this.listIssueLabels, - resouceMapper: ({ name }) => name, + resouceMapper: ({ + id, name, + }) => byId + ? ({ + label: name, + value: id, + }) + : name, }); }, }, + projectStatusId: { + type: "string", + label: "Status ID", + description: "The ID of the status of the project", + optional: true, + async options({ prevContext }) { + return this.listResourcesOptions({ + prevContext, + resourcesFn: this.listProjectStatuses, + resouceMapper: ({ + id, name, + }) => ({ + label: name, + value: id, + }), + }); + }, + }, + projectLabelIds: { + type: "string[]", + label: "Label IDs", + description: "The IDs of the labels for the project", + optional: true, + async options({ prevContext }) { + return this.listResourcesOptions({ + prevContext, + resourcesFn: this.listProjectLabels, + resouceMapper: ({ + id, name, + }) => ({ + label: name, + value: id, + }), + }); + }, + }, + projectPriority: { + type: "integer", + label: "Priority", + description: "The priority of the project", + optional: true, + options: constants.PRIORITY_OPTIONS, + }, + issuePriority: { + type: "integer", + label: "Priority", + description: "The priority of the issue", + optional: true, + options: constants.PRIORITY_OPTIONS, + }, query: { type: "string", label: "Query", @@ -167,7 +226,7 @@ export default { }, orderBy: { type: "string", - label: "Order by", + label: "Order By", description: "By which field should the pagination order by. Available options are `createdAt` (default) and `updatedAt`.", optional: true, options: constants.ORDER_BY_OPTIONS, @@ -315,6 +374,12 @@ export default { }); return comment; }, + async listProjectStatuses(variables = {}) { + return this.client().projectStatuses(variables); + }, + async listProjectLabels(variables = {}) { + return this.client().projectLabels(variables); + }, async listResourcesOptions({ prevContext, resourcesFn, resourcesArgs, resouceMapper, } = {}) { diff --git a/components/linear_app/package.json b/components/linear_app/package.json index 01ccbec47dfce..9b7f593401a93 100644 --- a/components/linear_app/package.json +++ b/components/linear_app/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/linear_app", - "version": "0.7.5", + "version": "0.8.0", "description": "Pipedream Linear_app Components", "main": "linear_app.app.mjs", "keywords": [ @@ -15,6 +15,6 @@ }, "dependencies": { "@linear/sdk": "^55.1.0", - "@pipedream/platform": "^3.0.3" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/linear_app/sources/comment-created-instant/comment-created-instant.mjs b/components/linear_app/sources/comment-created-instant/comment-created-instant.mjs index 2ec4f776708d2..ea15ba39ce0cf 100644 --- a/components/linear_app/sources/comment-created-instant/comment-created-instant.mjs +++ b/components/linear_app/sources/comment-created-instant/comment-created-instant.mjs @@ -7,7 +7,7 @@ export default { name: "New Comment Created (Instant)", 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).", type: "source", - version: "0.1.14", + version: "0.1.15", dedupe: "unique", methods: { ...common.methods, diff --git a/components/linear_app/sources/issue-created-instant/issue-created-instant.mjs b/components/linear_app/sources/issue-created-instant/issue-created-instant.mjs index 7d9522f68e684..fec41e4826ba8 100644 --- a/components/linear_app/sources/issue-created-instant/issue-created-instant.mjs +++ b/components/linear_app/sources/issue-created-instant/issue-created-instant.mjs @@ -7,7 +7,7 @@ export default { name: "New Issue Created (Instant)", 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).", type: "source", - version: "0.3.14", + version: "0.3.15", dedupe: "unique", methods: { ...common.methods, diff --git a/components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs b/components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs index 885fe8068e7cb..e22dca64e43df 100644 --- a/components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs +++ b/components/linear_app/sources/issue-updated-instant/issue-updated-instant.mjs @@ -7,7 +7,7 @@ export default { name: "Issue Updated (Instant)", 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).", type: "source", - version: "0.3.14", + version: "0.3.15", dedupe: "unique", methods: { ...common.methods, diff --git a/components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs b/components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs index 7f9d992d593fa..4d0a4f9bd96c7 100644 --- a/components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs +++ b/components/linear_app/sources/new-issue-status-updated/new-issue-status-updated.mjs @@ -8,7 +8,7 @@ export default { name: "Issue Status Updated (Instant)", 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).", type: "source", - version: "0.1.14", + version: "0.1.15", dedupe: "unique", props: { linearApp: common.props.linearApp, diff --git a/components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs b/components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs index cb1fa34b257bf..27cc9692cbb47 100644 --- a/components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs +++ b/components/linear_app/sources/new-projectupdate-created/new-projectupdate-created.mjs @@ -8,7 +8,7 @@ export default { name: "New Project Update Written (Instant)", 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).", type: "source", - version: "0.0.6", + version: "0.0.7", dedupe: "unique", props: { linearApp, diff --git a/components/linear_app/sources/project-updated-instant/project-updated-instant.mjs b/components/linear_app/sources/project-updated-instant/project-updated-instant.mjs index 57fb6822d6e40..6750a2d7cdf71 100644 --- a/components/linear_app/sources/project-updated-instant/project-updated-instant.mjs +++ b/components/linear_app/sources/project-updated-instant/project-updated-instant.mjs @@ -8,7 +8,7 @@ export default { name: "Project Updated (Instant)", 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).", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { linearApp, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b8003ab0438c..fb97b76eee0da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8040,8 +8040,8 @@ importers: specifier: ^55.1.0 version: 55.1.0 '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 components/linearb: dependencies: @@ -12354,8 +12354,7 @@ importers: specifier: ^10.0.0 version: 10.0.0 - components/runway: - specifiers: {} + components/runway: {} components/rytr: {} @@ -31003,22 +31002,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net supports-color@10.0.0: resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==}