diff --git a/components/taiga/actions/create-issue/create-issue.mjs b/components/taiga/actions/create-issue/create-issue.mjs new file mode 100644 index 0000000000000..99e29d4ce0805 --- /dev/null +++ b/components/taiga/actions/create-issue/create-issue.mjs @@ -0,0 +1,151 @@ +import { parseObject } from "../../common/utils.mjs"; +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-create-issue", + name: "Create Issue", + description: "Create a new issue in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#issues-create)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + subject: { + propDefinition: [ + taiga, + "issueSubject", + ], + }, + description: { + propDefinition: [ + taiga, + "issueDescription", + ], + optional: true, + }, + priority: { + propDefinition: [ + taiga, + "issuePriority", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + severity: { + propDefinition: [ + taiga, + "issueSeverity", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + status: { + propDefinition: [ + taiga, + "issueStatus", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + type: { + propDefinition: [ + taiga, + "issueType", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + assignedTo: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "Assigned To", + description: "User to assign the issue to", + optional: true, + }, + milestone: { + propDefinition: [ + taiga, + "milestone", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + tags: { + propDefinition: [ + taiga, + "tags", + ], + optional: true, + }, + blockedNote: { + propDefinition: [ + taiga, + "issueBlockedNote", + ], + optional: true, + }, + isBlocked: { + propDefinition: [ + taiga, + "isBlocked", + ], + optional: true, + }, + watchers: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + type: "string[]", + label: "Watchers", + description: "Users to watch the issue", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.taiga.createIssue({ + $, + data: { + subject: this.subject, + description: this.description, + project: this.projectId, + priority: this.priority, + severity: this.severity, + status: this.status, + type: this.type, + assigned_to: this.assignedTo, + tags: parseObject(this.tags), + blocked_note: this.blockedNote, + is_blocked: this.isBlocked, + milestone: this.milestone, + watchers: parseObject(this.watchers), + }, + }); + + $.export("$summary", `Created issue: ${response.id}`); + return response; + }, +}; diff --git a/components/taiga/actions/create-task/create-task.mjs b/components/taiga/actions/create-task/create-task.mjs new file mode 100644 index 0000000000000..05aadb354c8d3 --- /dev/null +++ b/components/taiga/actions/create-task/create-task.mjs @@ -0,0 +1,141 @@ +import { parseObject } from "../../common/utils.mjs"; +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-create-task", + name: "Create Task", + description: "Create a new task in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#tasks-create)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + subject: { + propDefinition: [ + taiga, + "taskSubject", + ], + }, + description: { + propDefinition: [ + taiga, + "taskDescription", + ], + optional: true, + }, + isBlocked: { + propDefinition: [ + taiga, + "isBlocked", + ], + description: "Whether the task is blocked", + optional: true, + }, + milestone: { + propDefinition: [ + taiga, + "milestone", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + status: { + propDefinition: [ + taiga, + "taskStatus", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + assignedTo: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "Assigned To", + description: "User to assign the task to", + optional: true, + }, + userStoryId: { + propDefinition: [ + taiga, + "userStoryId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "User Story", + description: "User story to associate the task with", + optional: true, + }, + usOrder: { + propDefinition: [ + taiga, + "usOrder", + ], + optional: true, + }, + taskboardOrder: { + propDefinition: [ + taiga, + "taskboardOrder", + ], + optional: true, + }, + tags: { + propDefinition: [ + taiga, + "tags", + ], + description: "Tags to associate with the task", + optional: true, + }, + watchers: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + type: "string[]", + label: "Watchers", + description: "Users to watch the task", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.taiga.createTask({ + $, + data: { + subject: this.subject, + description: this.description, + project: this.projectId, + status: this.status, + assigned_to: this.assignedTo, + user_story: this.userStoryId, + tags: parseObject(this.tags), + is_blocked: this.isBlocked, + milestone: this.milestone, + user_story_order: this.usOrder, + taskboard_order: this.taskboardOrder, + watchers: parseObject(this.watchers), + }, + }); + + $.export("$summary", `Created task: ${response.id}`); + return response; + }, +}; diff --git a/components/taiga/actions/create-userstory/create-userstory.mjs b/components/taiga/actions/create-userstory/create-userstory.mjs new file mode 100644 index 0000000000000..ba2265cd10eba --- /dev/null +++ b/components/taiga/actions/create-userstory/create-userstory.mjs @@ -0,0 +1,161 @@ +import { parseObject } from "../../common/utils.mjs"; +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-create-userstory", + name: "Create User Story", + description: "Create a new user story in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#user-stories-create)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + subject: { + propDefinition: [ + taiga, + "userStorySubject", + ], + }, + description: { + propDefinition: [ + taiga, + "userStoryDescription", + ], + optional: true, + }, + status: { + propDefinition: [ + taiga, + "userStoryStatus", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + assignedTo: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "Assigned To", + description: "User to assign the user story to", + optional: true, + }, + tags: { + propDefinition: [ + taiga, + "tags", + ], + description: "Tags to associate with the user story", + optional: true, + }, + backlogOrder: { + propDefinition: [ + taiga, + "backlogOrder", + ], + optional: true, + }, + kanbanOrder: { + propDefinition: [ + taiga, + "kanbanOrder", + ], + optional: true, + }, + sprintOrder: { + propDefinition: [ + taiga, + "sprintOrder", + ], + optional: true, + }, + clientRequirement: { + propDefinition: [ + taiga, + "clientRequirement", + ], + optional: true, + }, + isBlocked: { + propDefinition: [ + taiga, + "isBlocked", + ], + description: "Whether the user story is blocked", + optional: true, + }, + milestone: { + propDefinition: [ + taiga, + "milestone", + ({ projectId }) => ({ + projectId, + }), + ], + description: "Milestone to associate the user story with", + optional: true, + }, + points: { + propDefinition: [ + taiga, + "points", + ], + optional: true, + }, + teamRequirement: { + propDefinition: [ + taiga, + "teamRequirement", + ], + optional: true, + }, + watchers: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + type: "string[]", + label: "Watchers", + description: "Users to watch the user story", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.taiga.createUserStory({ + $, + data: { + subject: this.subject, + description: this.description, + project: this.projectId, + status: this.status, + assigned_to: this.assignedTo, + tags: parseObject(this.tags), + backlog_order: this.backlogOrder, + client_requirement: this.clientRequirement, + is_blocked: this.isBlocked, + milestone: this.milestone, + points: parseObject(this.points), + kanban_order: this.kanbanOrder, + sprint_order: this.sprintOrder, + team_requirement: this.teamRequirement, + watchers: parseObject(this.watchers), + }, + }); + + $.export("$summary", `Created user story: ${response.subject}`); + return response; + }, +}; diff --git a/components/taiga/actions/delete-issue/delete-issue.mjs b/components/taiga/actions/delete-issue/delete-issue.mjs new file mode 100644 index 0000000000000..1272f33544425 --- /dev/null +++ b/components/taiga/actions/delete-issue/delete-issue.mjs @@ -0,0 +1,36 @@ +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-delete-issue", + name: "Delete Issue", + description: "Delete an existing issue from a Taiga project. [See the documentation](https://docs.taiga.io/api.html#issues-delete)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + issueId: { + propDefinition: [ + taiga, + "issueId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.taiga.deleteIssue({ + $, + issueId: this.issueId, + }); + + $.export("$summary", `Deleted issue: ${this.issueId}`); + return response; + }, +}; diff --git a/components/taiga/actions/delete-task/delete-task.mjs b/components/taiga/actions/delete-task/delete-task.mjs new file mode 100644 index 0000000000000..6be7783428255 --- /dev/null +++ b/components/taiga/actions/delete-task/delete-task.mjs @@ -0,0 +1,36 @@ +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-delete-task", + name: "Delete Task", + description: "Delete an existing task from a Taiga project. [See the documentation](https://docs.taiga.io/api.html#tasks-delete)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + taskId: { + propDefinition: [ + taiga, + "taskId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.taiga.deleteTask({ + $, + taskId: this.taskId, + }); + + $.export("$summary", `Deleted task: ${this.taskId}`); + return response; + }, +}; diff --git a/components/taiga/actions/delete-userstory/delete-userstory.mjs b/components/taiga/actions/delete-userstory/delete-userstory.mjs new file mode 100644 index 0000000000000..a4dfc07254b5a --- /dev/null +++ b/components/taiga/actions/delete-userstory/delete-userstory.mjs @@ -0,0 +1,36 @@ +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-delete-userstory", + name: "Delete User Story", + description: "Delete an existing user story from a Taiga project. [See the documentation](https://docs.taiga.io/api.html#user-stories-delete)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + userStoryId: { + propDefinition: [ + taiga, + "userStoryId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.taiga.deleteUserStory({ + $, + userStoryId: this.userStoryId, + }); + + $.export("$summary", `Deleted user story: ${this.userStoryId}`); + return response; + }, +}; diff --git a/components/taiga/actions/get-issue/get-issue.mjs b/components/taiga/actions/get-issue/get-issue.mjs new file mode 100644 index 0000000000000..ff3d7a5d39373 --- /dev/null +++ b/components/taiga/actions/get-issue/get-issue.mjs @@ -0,0 +1,36 @@ +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-get-issue", + name: "Get Issue", + description: "Get an existing issue from a Taiga project. [See the documentation](https://docs.taiga.io/api.html#issues-get)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + issueId: { + propDefinition: [ + taiga, + "issueId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.taiga.getIssue({ + $, + issueId: this.issueId, + }); + + $.export("$summary", `Retrieved issue: ${response.id}`); + return response; + }, +}; diff --git a/components/taiga/actions/get-userstory/get-userstory.mjs b/components/taiga/actions/get-userstory/get-userstory.mjs new file mode 100644 index 0000000000000..d44f03f6811b7 --- /dev/null +++ b/components/taiga/actions/get-userstory/get-userstory.mjs @@ -0,0 +1,36 @@ +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-get-userstory", + name: "Get User Story", + description: "Get an existing user story from a Taiga project. [See the documentation](https://docs.taiga.io/api.html#user-stories-get)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + userStoryId: { + propDefinition: [ + taiga, + "userStoryId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.taiga.getUserStory({ + $, + userStoryId: this.userStoryId, + }); + + $.export("$summary", `Retrieved user story: ${this.userStoryId}`); + return response; + }, +}; diff --git a/components/taiga/actions/update-issue/update-issue.mjs b/components/taiga/actions/update-issue/update-issue.mjs new file mode 100644 index 0000000000000..5d6726245fd29 --- /dev/null +++ b/components/taiga/actions/update-issue/update-issue.mjs @@ -0,0 +1,168 @@ +import { + cleanObj, parseObject, +} from "../../common/utils.mjs"; +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-update-issue", + name: "Update Issue", + description: "Update an existing issue in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#issues-edit)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + issueId: { + propDefinition: [ + taiga, + "issueId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + subject: { + propDefinition: [ + taiga, + "issueSubject", + ], + optional: true, + }, + description: { + propDefinition: [ + taiga, + "issueDescription", + ], + optional: true, + }, + priority: { + propDefinition: [ + taiga, + "issuePriority", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + severity: { + propDefinition: [ + taiga, + "issueSeverity", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + status: { + propDefinition: [ + taiga, + "issueStatus", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + type: { + propDefinition: [ + taiga, + "issueType", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + assignedTo: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "Assigned To", + description: "User to assign the issue to", + optional: true, + }, + milestone: { + propDefinition: [ + taiga, + "milestone", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + tags: { + propDefinition: [ + taiga, + "tags", + ], + optional: true, + }, + blockedNote: { + propDefinition: [ + taiga, + "issueBlockedNote", + ], + optional: true, + }, + isBlocked: { + propDefinition: [ + taiga, + "isBlocked", + ], + optional: true, + }, + watchers: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + type: "string[]", + label: "Watchers", + description: "Users to watch the issue", + optional: true, + }, + }, + async run({ $ }) { + const issue = await this.taiga.getIssue({ + issueId: this.issueId, + }); + const response = await this.taiga.updateIssue({ + $, + issueId: this.issueId, + data: cleanObj({ + version: issue.version, + subject: this.subject, + description: this.description, + priority: this.priority, + severity: this.severity, + status: this.status, + type: this.type, + assigned_to: this.assignedTo, + tags: parseObject(this.tags), + blocked_note: this.blockedNote, + is_blocked: this.isBlocked, + milestone: this.milestone, + watchers: parseObject(this.watchers), + project: this.projectId, + }), + }); + + $.export("$summary", `Updated issue: ${response.id}`); + return response; + }, +}; diff --git a/components/taiga/actions/update-task/update-task.mjs b/components/taiga/actions/update-task/update-task.mjs new file mode 100644 index 0000000000000..d1f85b49929c9 --- /dev/null +++ b/components/taiga/actions/update-task/update-task.mjs @@ -0,0 +1,157 @@ +import { + cleanObj, parseObject, +} from "../../common/utils.mjs"; +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-update-task", + name: "Update Task", + description: "Update an existing task in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#tasks-edit)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + taskId: { + propDefinition: [ + taiga, + "taskId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + subject: { + propDefinition: [ + taiga, + "taskSubject", + ], + optional: true, + }, + description: { + propDefinition: [ + taiga, + "taskDescription", + ], + optional: true, + }, + isBlocked: { + propDefinition: [ + taiga, + "isBlocked", + ], + description: "Whether the task is blocked", + optional: true, + }, + milestone: { + propDefinition: [ + taiga, + "milestone", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + status: { + propDefinition: [ + taiga, + "taskStatus", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + assignedTo: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "Assigned To", + description: "User to assign the task to", + optional: true, + }, + userStoryId: { + propDefinition: [ + taiga, + "userStoryId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "User Story", + description: "User story to associate the task with", + optional: true, + }, + usOrder: { + propDefinition: [ + taiga, + "usOrder", + ], + optional: true, + }, + taskboardOrder: { + propDefinition: [ + taiga, + "taskboardOrder", + ], + optional: true, + }, + tags: { + propDefinition: [ + taiga, + "tags", + ], + description: "Tags to associate with the task", + optional: true, + }, + watchers: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + type: "string[]", + label: "Watchers", + description: "Users to watch the task", + optional: true, + }, + }, + async run({ $ }) { + const task = await this.taiga.getTask({ + taskId: this.taskId, + }); + const response = await this.taiga.updateTask({ + $, + taskId: this.taskId, + data: cleanObj({ + version: task.version, + subject: this.subject, + description: this.description, + status: this.status, + assigned_to: this.assignedTo, + user_story: this.userStoryId, + tags: parseObject(this.tags), + watchers: parseObject(this.watchers), + is_blocked: this.isBlocked, + milestone: this.milestone, + us_order: this.usOrder, + taskboard_order: this.taskboardOrder, + }), + }); + + $.export("$summary", `Updated task: ${response.id}`); + return response; + }, +}; diff --git a/components/taiga/actions/update-userstory/update-userstory.mjs b/components/taiga/actions/update-userstory/update-userstory.mjs new file mode 100644 index 0000000000000..6061e85716f17 --- /dev/null +++ b/components/taiga/actions/update-userstory/update-userstory.mjs @@ -0,0 +1,175 @@ +import { + cleanObj, parseObject, +} from "../../common/utils.mjs"; +import taiga from "../../taiga.app.mjs"; + +export default { + key: "taiga-update-userstory", + name: "Update User Story", + description: "Update an existing user story in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#_user_stories)", + version: "0.0.1", + type: "action", + props: { + taiga, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + userStoryId: { + propDefinition: [ + taiga, + "userStoryId", + ({ projectId }) => ({ + projectId, + }), + ], + }, + subject: { + propDefinition: [ + taiga, + "userStorySubject", + ], + optional: true, + }, + description: { + propDefinition: [ + taiga, + "userStoryDescription", + ], + optional: true, + }, + status: { + propDefinition: [ + taiga, + "userStoryStatus", + ({ projectId }) => ({ + projectId, + }), + ], + optional: true, + }, + assignedTo: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + label: "Assigned To", + description: "User to assign the user story to", + optional: true, + }, + tags: { + propDefinition: [ + taiga, + "tags", + ], + description: "Tags to associate with the user story", + optional: true, + }, + backlogOrder: { + propDefinition: [ + taiga, + "backlogOrder", + ], + optional: true, + }, + kanbanOrder: { + propDefinition: [ + taiga, + "kanbanOrder", + ], + optional: true, + }, + sprintOrder: { + propDefinition: [ + taiga, + "sprintOrder", + ], + optional: true, + }, + clientRequirement: { + propDefinition: [ + taiga, + "clientRequirement", + ], + optional: true, + }, + isBlocked: { + propDefinition: [ + taiga, + "isBlocked", + ], + description: "Whether the user story is blocked", + optional: true, + }, + milestone: { + propDefinition: [ + taiga, + "milestone", + ({ projectId }) => ({ + projectId, + }), + ], + description: "Milestone to associate the user story with", + optional: true, + }, + points: { + propDefinition: [ + taiga, + "points", + ], + optional: true, + }, + teamRequirement: { + propDefinition: [ + taiga, + "teamRequirement", + ], + optional: true, + }, + watchers: { + propDefinition: [ + taiga, + "userId", + ({ projectId }) => ({ + projectId, + }), + ], + type: "string[]", + label: "Watchers", + description: "Users to watch the user story", + optional: true, + }, + }, + async run({ $ }) { + const userStory = await this.taiga.getUserStory({ + userStoryId: this.userStoryId, + }); + const response = await this.taiga.updateUserStory({ + $, + userStoryId: this.userStoryId, + data: cleanObj({ + version: userStory.version, + subject: this.subject, + description: this.description, + status: this.status, + assigned_to: this.assignedTo, + tags: parseObject(this.tags), + backlog_order: this.backlogOrder, + client_requirement: this.clientRequirement, + is_blocked: this.isBlocked, + milestone: this.milestone, + points: parseObject(this.points), + team_requirement: this.teamRequirement, + watchers: parseObject(this.watchers), + }), + }); + + $.export("$summary", `Updated user story: ${response.id}`); + return response; + }, +}; diff --git a/components/taiga/common/utils.mjs b/components/taiga/common/utils.mjs new file mode 100644 index 0000000000000..4d412a63ac1b5 --- /dev/null +++ b/components/taiga/common/utils.mjs @@ -0,0 +1,41 @@ +export const parseObject = (obj) => { + if (!obj) return undefined; + + if (Array.isArray(obj)) { + return obj.map((item) => { + if (typeof item === "string") { + try { + return JSON.parse(item); + } catch (e) { + return item; + } + } + return item; + }); + } + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + return obj; +}; + +export const cleanObj = (obj) => { + return Object.entries(obj) + .filter(([ + , + v, + ]) => ((v != null && v != "" && JSON.stringify(v) != "{}") || typeof v === "boolean")) + .reduce((acc, [ + k, + v, + ]) => ({ + ...acc, + [k]: (!Array.isArray(v) && v === Object(v)) + ? cleanObj(v) + : v, + }), {}); +}; diff --git a/components/taiga/package.json b/components/taiga/package.json index ad12132baf535..f09f59607bb7b 100644 --- a/components/taiga/package.json +++ b/components/taiga/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/taiga", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Taiga Components", "main": "taiga.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} diff --git a/components/taiga/sources/changed-issue-instant/changed-issue-instant.mjs b/components/taiga/sources/changed-issue-instant/changed-issue-instant.mjs new file mode 100644 index 0000000000000..e0eb8fa3975eb --- /dev/null +++ b/components/taiga/sources/changed-issue-instant/changed-issue-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-changed-issue-instant", + name: "Changed Issue (Instant)", + description: "Emit new event when an issue is updated in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `Changed Issue: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "issue" && body.action === "change" && !body.change.diff.status; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/changed-issue-instant/test-event.mjs b/components/taiga/sources/changed-issue-instant/test-event.mjs new file mode 100644 index 0000000000000..650f248c5acd7 --- /dev/null +++ b/components/taiga/sources/changed-issue-instant/test-event.mjs @@ -0,0 +1,81 @@ +export default { + "action": "change", + "type": "issue", + "by": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "date": "2025-09-16T14:00:23.279Z", + "data": { + "custom_attributes_values": {}, + "id": 123, + "ref": 123, + "created_date": "2025-09-16T13:45:14.508Z", + "modified_date": "2025-09-16T14:00:23.239Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "external_reference": null, + "watchers": [], + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/issue/123", + "project": { + "id": 123, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "milestone": null, + "owner": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false + }, + "type": { + "id": 123, + "name": "Bug", + "color": "#E44057" + }, + "priority": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "severity": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "promoted_to": [] + }, + "change": { + "comment": "", + "comment_html": "", + "delete_comment_date": null, + "comment_versions": null, + "edit_comment_date": null, + "diff": { + "subject": { + "from": "subject", + "to": "changed subject" + } + } + } +} \ No newline at end of file diff --git a/components/taiga/sources/changed-issue-status-instant/changed-issue-status-instant.mjs b/components/taiga/sources/changed-issue-status-instant/changed-issue-status-instant.mjs new file mode 100644 index 0000000000000..36362baf0d6e7 --- /dev/null +++ b/components/taiga/sources/changed-issue-status-instant/changed-issue-status-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-changed-issue-status-instant", + name: "Changed Issue Status (Instant)", + description: "Emit new event when an issue status is changed in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `Changed Issue Status: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "issue" && body.action === "change" && body.change.diff.status; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/changed-issue-status-instant/test-event.mjs b/components/taiga/sources/changed-issue-status-instant/test-event.mjs new file mode 100644 index 0000000000000..8ee3c4deb0151 --- /dev/null +++ b/components/taiga/sources/changed-issue-status-instant/test-event.mjs @@ -0,0 +1,81 @@ +export default { + "action": "change", + "type": "issue", + "by": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "date": "2025-09-16T14:00:23.279Z", + "data": { + "custom_attributes_values": {}, + "id": 123, + "ref": 123, + "created_date": "2025-09-16T13:45:14.508Z", + "modified_date": "2025-09-16T14:00:23.239Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "external_reference": null, + "watchers": [], + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/issue/123", + "project": { + "id": 123, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "milestone": null, + "owner": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false + }, + "type": { + "id": 123, + "name": "Bug", + "color": "#E44057" + }, + "priority": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "severity": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "promoted_to": [] + }, + "change": { + "comment": "", + "comment_html": "", + "delete_comment_date": null, + "comment_versions": null, + "edit_comment_date": null, + "diff": { + "status": { + "from": "In progress", + "to": "New" + } + } + } +} \ No newline at end of file diff --git a/components/taiga/sources/changed-task-instant/changed-task-instant.mjs b/components/taiga/sources/changed-task-instant/changed-task-instant.mjs new file mode 100644 index 0000000000000..06b5d81e37a72 --- /dev/null +++ b/components/taiga/sources/changed-task-instant/changed-task-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-changed-task-instant", + name: "Changed Task (Instant)", + description: "Emit new event when a task is updated in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `Changed Task: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "task" && body.action === "change" && !body.change.diff.status; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/changed-task-instant/test-event.mjs b/components/taiga/sources/changed-task-instant/test-event.mjs new file mode 100644 index 0000000000000..ac4641e2c6527 --- /dev/null +++ b/components/taiga/sources/changed-task-instant/test-event.mjs @@ -0,0 +1,198 @@ +export default { + "action": "change", + "type": "task", + "by": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4acf7f734332df6f6a65789330874e23" + }, + "date": "2025-09-16T14:07:00.458Z", + "data": { + "custom_attributes_values": {}, + "id": 123, + "ref": 15, + "created_date": "2025-09-16T14:06:23.334Z", + "modified_date": "2025-09-16T14:07:00.409Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "us_order": 1758031583317, + "taskboard_order": 1758031583317, + "is_iocaine": false, + "external_reference": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/task/123", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "In progress", + "slug": "in-progress", + "color": "#E47C40", + "is_closed": false + }, + "user_story": { + "custom_attributes_values": {}, + "id": 8423509, + "ref": 123, + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "is_closed": false, + "created_date": "2025-09-15T19:13:09.501Z", + "modified_date": "2025-09-15T19:13:09.506Z", + "finish_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "user story subject", + "client_requirement": false, + "team_requirement": false, + "generated_from_issue": null, + "generated_from_task": null, + "from_task_ref": null, + "external_reference": null, + "tribe_gig": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/us/123", + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "assigned_users": [], + "points": [ + { + "role": "UX", + "name": "?", + "value": null + }, + { + "role": "Design", + "name": "?", + "value": null + }, + { + "role": "Front", + "name": "?", + "value": null + }, + { + "role": "Back", + "name": "?", + "value": null + }, + { + "role": "Stakeholder", + "name": "?", + "value": null + } + ], + "status": { + "id": 10498870, + "name": "In progress", + "slug": "new", + "color": "#70728F", + "is_closed": false, + "is_archived": false + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-test-01-2", + "estimated_start": "2025-09-15", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-15T15:28:48.984Z", + "modified_date": "2025-09-15T15:28:48.989Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4acf7f734332df6f6a65789330874e23" + } + } + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-test-01-2", + "estimated_start": "2025-09-15", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-15T15:28:48.984Z", + "modified_date": "2025-09-15T15:28:48.989Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + } + }, + "promoted_to": [] + }, + "change": { + "comment": "", + "comment_html": "", + "delete_comment_date": null, + "comment_versions": null, + "edit_comment_date": null, + "diff": { + "subject": { + "from": "subject", + "to": "changed subject" + } + } + } +} \ No newline at end of file diff --git a/components/taiga/sources/changed-task-status-instant/changed-task-status-instant.mjs b/components/taiga/sources/changed-task-status-instant/changed-task-status-instant.mjs new file mode 100644 index 0000000000000..dc73782b1102e --- /dev/null +++ b/components/taiga/sources/changed-task-status-instant/changed-task-status-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-changed-task-status-instant", + name: "Changed Task Status (Instant)", + description: "Emit new event when a task status is changed in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `Changed Task Status: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "task" && body.action === "change" && body.change.diff.status; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/changed-task-status-instant/test-event.mjs b/components/taiga/sources/changed-task-status-instant/test-event.mjs new file mode 100644 index 0000000000000..e34c5dac8881c --- /dev/null +++ b/components/taiga/sources/changed-task-status-instant/test-event.mjs @@ -0,0 +1,198 @@ +export default { + "action": "change", + "type": "task", + "by": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4acf7f734332df6f6a65789330874e23" + }, + "date": "2025-09-16T14:07:00.458Z", + "data": { + "custom_attributes_values": {}, + "id": 123, + "ref": 15, + "created_date": "2025-09-16T14:06:23.334Z", + "modified_date": "2025-09-16T14:07:00.409Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "us_order": 1758031583317, + "taskboard_order": 1758031583317, + "is_iocaine": false, + "external_reference": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/task/123", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "In progress", + "slug": "in-progress", + "color": "#E47C40", + "is_closed": false + }, + "user_story": { + "custom_attributes_values": {}, + "id": 8423509, + "ref": 123, + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "is_closed": false, + "created_date": "2025-09-15T19:13:09.501Z", + "modified_date": "2025-09-15T19:13:09.506Z", + "finish_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "user story subject", + "client_requirement": false, + "team_requirement": false, + "generated_from_issue": null, + "generated_from_task": null, + "from_task_ref": null, + "external_reference": null, + "tribe_gig": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/us/123", + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "assigned_users": [], + "points": [ + { + "role": "UX", + "name": "?", + "value": null + }, + { + "role": "Design", + "name": "?", + "value": null + }, + { + "role": "Front", + "name": "?", + "value": null + }, + { + "role": "Back", + "name": "?", + "value": null + }, + { + "role": "Stakeholder", + "name": "?", + "value": null + } + ], + "status": { + "id": 10498870, + "name": "In progress", + "slug": "new", + "color": "#70728F", + "is_closed": false, + "is_archived": false + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-test-01-2", + "estimated_start": "2025-09-15", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-15T15:28:48.984Z", + "modified_date": "2025-09-15T15:28:48.989Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4acf7f734332df6f6a65789330874e23" + } + } + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-test-01-2", + "estimated_start": "2025-09-15", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-15T15:28:48.984Z", + "modified_date": "2025-09-15T15:28:48.989Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + } + }, + "promoted_to": [] + }, + "change": { + "comment": "", + "comment_html": "", + "delete_comment_date": null, + "comment_versions": null, + "edit_comment_date": null, + "diff": { + "status": { + "from": "New", + "to": "In progress" + } + } + } +} \ No newline at end of file diff --git a/components/taiga/sources/common/base.mjs b/components/taiga/sources/common/base.mjs new file mode 100644 index 0000000000000..e959f4469cd0a --- /dev/null +++ b/components/taiga/sources/common/base.mjs @@ -0,0 +1,83 @@ +import crypto from "crypto"; +import taiga from "../../taiga.app.mjs"; + +export default { + props: { + taiga, + db: "$.service.db", + http: { + type: "$.interface.http", + customResponse: true, + }, + projectId: { + propDefinition: [ + taiga, + "projectId", + ], + }, + name: { + type: "string", + label: "Name", + description: "The name of the webhook.", + }, + }, + methods: { + _setWebhookId(id) { + this.db.set("webhookId", id); + }, + _getWebhookId() { + return this.db.get("webhookId"); + }, + _getSecretKey() { + return this.db.get("secretKey"); + }, + _setSecretKey(secretKey) { + this.db.set("secretKey", secretKey); + }, + validateSecretKey(headers, bodyRaw) { + const secretKey = this._getSecretKey(); + const signature = headers["x-taiga-webhook-signature"]; + const hmac = crypto.createHmac("sha1", secretKey); + hmac.update(bodyRaw); + const signedMessage = hmac.digest("hex"); + + if (signature !== signedMessage) { + return this.http.respond({ + status: 401, + }); + } + }, + }, + hooks: { + async activate() { + const secretKey = crypto.randomUUID(); + const response = await this.taiga.createHook({ + data: { + key: secretKey, + name: this.name, + url: this.http.endpoint, + project: this.projectId, + }, + }); + this._setWebhookId(response.id); + this._setSecretKey(secretKey); + }, + async deactivate() { + const webhookId = this._getWebhookId(); + await this.taiga.deleteHook(webhookId); + }, + }, + async run({ + body, headers, bodyRaw, + }) { + if (!this.filterEvent(body)) return; + this.validateSecretKey(headers, bodyRaw); + + const ts = body.created || Date.now(); + this.$emit(body, { + id: `${body.id}-${ts}`, + summary: this.getSummary(body), + ts, + }); + }, +}; diff --git a/components/taiga/sources/deleted-issue-instant/deleted-issue-instant.mjs b/components/taiga/sources/deleted-issue-instant/deleted-issue-instant.mjs new file mode 100644 index 0000000000000..d7511942a47a8 --- /dev/null +++ b/components/taiga/sources/deleted-issue-instant/deleted-issue-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-deleted-issue-instant", + name: "Deleted Issue (Instant)", + description: "Emit new event when a issue is deleted in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `Deleted Issue: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "issue" && body.action === "delete"; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/deleted-issue-instant/test-event.mjs b/components/taiga/sources/deleted-issue-instant/test-event.mjs new file mode 100644 index 0000000000000..50fec44eacf3a --- /dev/null +++ b/components/taiga/sources/deleted-issue-instant/test-event.mjs @@ -0,0 +1,68 @@ +export default { + "action": "delete", + "type": "issue", + "by": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "date": "2025-09-16T13:57:05.239Z", + "data": { + "custom_attributes_values": null, + "id": 123, + "ref": 123, + "created_date": "2025-09-16T13:48:43.886Z", + "modified_date": "2025-09-16T13:48:43.896Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "external_reference": null, + "watchers": [], + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/issue/123", + "project": { + "id": 123, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "milestone": null, + "owner": { + "id": 123, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false + }, + "type": { + "id": 123, + "name": "Bug", + "color": "#E44057" + }, + "priority": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "severity": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "promoted_to": [] + } +} \ No newline at end of file diff --git a/components/taiga/sources/deleted-task-instant/deleted-task-instant.mjs b/components/taiga/sources/deleted-task-instant/deleted-task-instant.mjs new file mode 100644 index 0000000000000..319f2b2d0c708 --- /dev/null +++ b/components/taiga/sources/deleted-task-instant/deleted-task-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-deleted-task-instant", + name: "Deleted Task (Instant)", + description: "Emit new event when a task is deleted in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `Deleted Task: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "task" && body.action === "delete"; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/deleted-task-instant/test-event.mjs b/components/taiga/sources/deleted-task-instant/test-event.mjs new file mode 100644 index 0000000000000..cc7dae1e9bbcf --- /dev/null +++ b/components/taiga/sources/deleted-task-instant/test-event.mjs @@ -0,0 +1,172 @@ +export default { + "custom_attributes_values": null, + "id": 8239144, + "ref": 14, + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "fgbnnvbvbn", + "us_order": 1758030633775, + "taskboard_order": 1758030633775, + "is_iocaine": false, + "external_reference": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/task/123", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false + }, + "user_story": { + "custom_attributes_values": {}, + "id": 8423509, + "ref": 123, + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "is_closed": false, + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "finish_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "user story subject", + "client_requirement": false, + "team_requirement": false, + "generated_from_issue": null, + "generated_from_task": null, + "from_task_ref": null, + "external_reference": null, + "tribe_gig": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/us/123", + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "assigned_users": [], + "points": [ + { + "role": "UX", + "name": "?", + "value": null + }, + { + "role": "Design", + "name": "?", + "value": null + }, + { + "role": "Front", + "name": "?", + "value": null + }, + { + "role": "Back", + "name": "?", + "value": null + }, + { + "role": "Stakeholder", + "name": "?", + "value": null + } + ], + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false, + "is_archived": false + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-subject-2", + "estimated_start": "2025-09-16", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + } + } + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-subject-2", + "estimated_start": "2025-09-16", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + } + }, + "promoted_to": [] +} \ No newline at end of file diff --git a/components/taiga/sources/new-issue-instant/new-issue-instant.mjs b/components/taiga/sources/new-issue-instant/new-issue-instant.mjs new file mode 100644 index 0000000000000..cff28c2c146e2 --- /dev/null +++ b/components/taiga/sources/new-issue-instant/new-issue-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-new-issue-instant", + name: "New Issue (Instant)", + description: "Emit new event when an issue is created in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `New Issue: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "issue" && body.action === "create"; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/new-issue-instant/test-event.mjs b/components/taiga/sources/new-issue-instant/test-event.mjs new file mode 100644 index 0000000000000..1274df45f604b --- /dev/null +++ b/components/taiga/sources/new-issue-instant/test-event.mjs @@ -0,0 +1,68 @@ +export default { + "action": "create", + "type": "issue", + "by": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "date": "2025-09-16T13:45:14.585Z", + "data": { + "custom_attributes_values": {}, + "id": 123, + "ref": 123, + "created_date": "2025-09-16T13:45:14.508Z", + "modified_date": "2025-09-16T13:45:14.519Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "external_reference": null, + "watchers": [], + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/issue/123", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "milestone": null, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "pipedreamsage", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false + }, + "type": { + "id": 123, + "name": "Bug", + "color": "#E44057" + }, + "priority": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "severity": { + "id": 123, + "name": "Normal", + "color": "#A8E440" + }, + "promoted_to": [] + } +} \ No newline at end of file diff --git a/components/taiga/sources/new-task-instant/new-task-instant.mjs b/components/taiga/sources/new-task-instant/new-task-instant.mjs new file mode 100644 index 0000000000000..ed6952104f6d0 --- /dev/null +++ b/components/taiga/sources/new-task-instant/new-task-instant.mjs @@ -0,0 +1,22 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "taiga-new-task-instant", + name: "New Task (Instant)", + description: "Emit new event when a task is created in the selected project. [See the documentation](https://docs.taiga.io/api.html#webhooks-create)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getSummary(body) { + return `New Task: ${body.data.id}`; + }, + filterEvent(body) { + return body.type === "task" && body.action === "create"; + }, + }, + sampleEmit, +}; diff --git a/components/taiga/sources/new-task-instant/test-event.mjs b/components/taiga/sources/new-task-instant/test-event.mjs new file mode 100644 index 0000000000000..edc31f346a80e --- /dev/null +++ b/components/taiga/sources/new-task-instant/test-event.mjs @@ -0,0 +1,185 @@ +export default { + "action": "create", + "type": "task", + "by": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/yourprofile", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "date": "2025-09-16T13:50:33.888Z", + "data": { + "custom_attributes_values": {}, + "id": 123, + "ref": 123, + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "finished_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "subject", + "us_order": 123, + "taskboard_order": 123, + "is_iocaine": false, + "external_reference": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/task/123", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false + }, + "user_story": { + "custom_attributes_values": {}, + "id": 123, + "ref": 123, + "project": { + "id": 123, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "is_closed": false, + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "finish_date": null, + "due_date": null, + "due_date_reason": "", + "subject": "user story subject", + "client_requirement": false, + "team_requirement": false, + "generated_from_issue": null, + "generated_from_task": null, + "from_task_ref": null, + "external_reference": null, + "tribe_gig": null, + "watchers": [], + "is_blocked": false, + "blocked_note": "", + "description": "", + "tags": [], + "permalink": "https://tree.taiga.io/project/project-name/us/123", + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + }, + "assigned_to": null, + "assigned_users": [], + "points": [ + { + "role": "UX", + "name": "?", + "value": null + }, + { + "role": "Design", + "name": "?", + "value": null + }, + { + "role": "Front", + "name": "?", + "value": null + }, + { + "role": "Back", + "name": "?", + "value": null + }, + { + "role": "Stakeholder", + "name": "?", + "value": null + } + ], + "status": { + "id": 123, + "name": "New", + "slug": "new", + "color": "#70728F", + "is_closed": false, + "is_archived": false + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-subject-2", + "estimated_start": "2025-09-16", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + } + } + }, + "milestone": { + "id": 476374, + "name": "sprint subject", + "slug": "sprint-subject-2", + "estimated_start": "2025-09-16", + "estimated_finish": "2025-09-29", + "created_date": "2025-09-16T13:50:33.791Z", + "modified_date": "2025-09-16T13:50:33.805Z", + "closed": false, + "disponibility": 0, + "permalink": "https://tree.taiga.io/project/project-name/taskboard/sprint-subject-2", + "project": { + "id": 1731087, + "permalink": "https://tree.taiga.io/project/project-name", + "name": "Project Name", + "logo_big_url": null + }, + "owner": { + "id": 845439, + "permalink": "https://tree.taiga.io/profile/username", + "username": "username", + "full_name": "Full Name", + "photo": null, + "gravatar_id": "4aca6578f7f7df634332f69330874e23" + } + }, + "promoted_to": [] + } +} \ No newline at end of file diff --git a/components/taiga/taiga.app.mjs b/components/taiga/taiga.app.mjs index 74edb05ef1988..cfa77c70c2eab 100644 --- a/components/taiga/taiga.app.mjs +++ b/components/taiga/taiga.app.mjs @@ -1,11 +1,634 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "taiga", - propDefinitions: {}, + propDefinitions: { + projectId: { + type: "string", + label: "Project ID", + description: "Select a project or provide a project ID", + async options({ page }) { + let projects = []; + try { + projects = await this.listProjects({ + params: { + page: page + 1, + }, + }); + } catch (error) { + projects = []; + } + return projects.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + issuePriority: { + type: "string", + label: "Priority", + description: "Select a priority or provide a priority", + async options({ + page, projectId, + }) { + let priorities = []; + try { + priorities = await this.listPriorities({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + priorities = []; + } + return priorities.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + issueSeverity: { + type: "string", + label: "Severity", + description: "Select a severity or provide a severity", + async options({ + page, projectId, + }) { + let severities = []; + try { + severities = await this.listSeverities({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + severities = []; + } + return severities.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + issueStatus: { + type: "string", + label: "Status", + description: "Select a status or provide a status", + async options({ + page, projectId, + }) { + let statuses = []; + try { + statuses = await this.listStatuses({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + statuses = []; + } + return statuses.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + issueType: { + type: "string", + label: "Type", + description: "Select a type or provide a type", + async options({ + page, projectId, + }) { + let types = []; + try { + types = await this.listTypes({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + types = []; + } + return types.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + userId: { + type: "string", + label: "User ID", + description: "Select a user or provide a user ID", + async options({ + page, projectId, + }) { + let users = []; + try { + users = await this.listUsers({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + users = []; + } + return users.map(({ + id, full_name_display, username, + }) => ({ + label: `${full_name_display} (${username})`, + value: id, + })); + }, + }, + milestone: { + type: "string", + label: "Milestone", + description: "Select a milestone or provide a milestone", + async options({ + page, projectId, + }) { + let milestones = []; + try { + milestones = await this.listMilestones({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + milestones = []; + } + return milestones.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + taskStatus: { + type: "string", + label: "Task Status", + description: "Select a task status or provide a task status", + async options({ + page, projectId, + }) { + let statuses = []; + try { + statuses = await this.listTaskStatuses({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + statuses = []; + } + return statuses.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + issueId: { + type: "string", + label: "Issue ID", + description: "Select an issue or provide an issue ID", + async options({ + page, projectId, + }) { + let issues = []; + try { + issues = await this.listIssues({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + issues = []; + } + return issues.map(({ + id: value, subject: label, + }) => ({ + label, + value, + })); + }, + }, + taskId: { + type: "string", + label: "Task ID", + description: "Select a task or provide a task ID", + async options({ + page, projectId, + }) { + let tasks = []; + try { + tasks = await this.listTasks({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + tasks = []; + } + return tasks.map(({ + id: value, subject: label, + }) => ({ + label, + value, + })); + }, + }, + userStoryId: { + type: "string", + label: "User Story ID", + description: "Select a user story or provide a user story ID", + async options({ + page, projectId, + }) { + let userStories = []; + try { + userStories = await this.listUserStories({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + userStories = []; + } + return userStories.map(({ + id: value, subject: label, + }) => ({ + label, + value, + })); + }, + }, + userStoryStatus: { + type: "string", + label: "User Story Status", + description: "Select a user story status or provide a user story status", + async options({ + page, projectId, + }) { + let statuses = []; + try { + statuses = await this.listUserStoryStatuses({ + params: { + page: page + 1, + project: projectId, + }, + }); + } catch (error) { + statuses = []; + } + return statuses.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + }, + }, + issueSubject: { + type: "string", + label: "Subject", + description: "The issue subject/title", + }, + issueDescription: { + type: "string", + label: "Description", + description: "The issue description", + }, + tags: { + type: "string[]", + label: "Tags", + description: "Tags to associate with the issue", + }, + issueBlockedNote: { + type: "string", + label: "Blocked Note", + description: "The reason why the issue is blocked", + }, + isBlocked: { + type: "boolean", + label: "Is Blocked", + description: "Whether the issue is blocked", + }, + taskSubject: { + type: "string", + label: "Subject", + description: "The task subject/title", + }, + taskDescription: { + type: "string", + label: "Description", + description: "The task description", + }, + usOrder: { + type: "integer", + label: "User Story Order", + description: "The order in the user story", + }, + taskboardOrder: { + type: "integer", + label: "Taskboard Order", + description: "The order in the taskboard", + }, + userStorySubject: { + type: "string", + label: "Subject", + description: "The user story subject/title", + }, + userStoryDescription: { + type: "string", + label: "Description", + description: "The user story description", + }, + backlogOrder: { + type: "integer", + label: "Backlog Order", + description: "The order in the backlog", + }, + kanbanOrder: { + type: "integer", + label: "Kanban Order", + description: "The order in the kanban", + }, + sprintOrder: { + type: "integer", + label: "Sprint Order", + description: "The order in the sprint", + }, + clientRequirement: { + type: "boolean", + label: "Client Requirement", + description: "Whether the user story is a client requirement", + }, + points: { + type: "object", + label: "Points", + description: "A dictionary of points. The key is the id of the [role](https://docs.taiga.io/api.html#roles-list) and the value is the id of the [points](https://docs.taiga.io/api.html#points-list). Format: `{\"10469741\": 20817870, \"10469742\": 20817871, \"10469743\": 20817872, \"10469744\": 20817873}`", + }, + teamRequirement: { + type: "boolean", + label: "Team Requirement", + description: "Whether the user story is a team requirement", + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return `${this.$auth.api_url}/api/v1`; + }, + _headers() { + return { + "Authorization": `Bearer ${this.$auth.oauth_access_token}`, + "content-type": "application/json", + }; + }, + _makeRequest({ + $ = this, path, ...opts + }) { + return axios($, { + url: this._baseUrl() + path, + headers: this._headers(), + ...opts, + }); + }, + getMe() { + return this._makeRequest({ + path: "/users/me", + }); + }, + listPriorities(opts = {}) { + return this._makeRequest({ + path: "/priorities", + ...opts, + }); + }, + listSeverities(opts = {}) { + return this._makeRequest({ + path: "/severities", + ...opts, + }); + }, + listStatuses(opts = {}) { + return this._makeRequest({ + path: "/issue-statuses", + ...opts, + }); + }, + listTypes(opts = {}) { + return this._makeRequest({ + path: "/issue-types", + ...opts, + }); + }, + listMilestones(opts = {}) { + return this._makeRequest({ + path: "/milestones", + ...opts, + }); + }, + listTaskStatuses(opts = {}) { + return this._makeRequest({ + path: "/task-statuses", + ...opts, + }); + }, + listUserStoryStatuses(opts = {}) { + return this._makeRequest({ + path: "/userstory-statuses", + ...opts, + }); + }, + async listProjects({ + params, ...opts + }) { + const me = await this.getMe(); + return await this._makeRequest({ + path: "/projects", + params: { + member: me.id, + ...params, + }, + ...opts, + }); + }, + createIssue(opts = {}) { + return this._makeRequest({ + path: "/issues", + method: "POST", + ...opts, + }); + }, + createProject(opts = {}) { + return this._makeRequest({ + path: "/projects", + method: "POST", + ...opts, + }); + }, + createTask(opts = {}) { + return this._makeRequest({ + path: "/tasks", + method: "POST", + ...opts, + }); + }, + createUserStory(opts = {}) { + return this._makeRequest({ + path: "/userstories", + method: "POST", + ...opts, + }); + }, + deleteTask({ + taskId, ...opts + }) { + return this._makeRequest({ + path: `/tasks/${taskId}`, + method: "DELETE", + ...opts, + }); + }, + updateIssue({ + issueId, ...opts + }) { + return this._makeRequest({ + path: `/issues/${issueId}`, + method: "PATCH", + ...opts, + }); + }, + listIssues(opts = {}) { + return this._makeRequest({ + path: "/issues", + ...opts, + }); + }, + getIssue({ + issueId, ...opts + }) { + return this._makeRequest({ + path: `/issues/${issueId}`, + ...opts, + }); + }, + deleteIssue({ + issueId, ...opts + }) { + return this._makeRequest({ + path: `/issues/${issueId}`, + method: "DELETE", + ...opts, + }); + }, + deleteUserStory({ + userStoryId, ...opts + }) { + return this._makeRequest({ + path: `/userstories/${userStoryId}`, + method: "DELETE", + ...opts, + }); + }, + getTask({ + taskId, ...opts + }) { + return this._makeRequest({ + path: `/tasks/${taskId}`, + ...opts, + }); + }, + getUserStory({ + userStoryId, ...opts + }) { + return this._makeRequest({ + path: `/userstories/${userStoryId}`, + ...opts, + }); + }, + createHook(opts = {}) { + return this._makeRequest({ + path: "/webhooks", + method: "POST", + ...opts, + }); + }, + deleteHook(hookId) { + return this._makeRequest({ + path: `/webhooks/${hookId}`, + method: "DELETE", + }); + }, + updateUserStory({ + userStoryId, ...opts + }) { + return this._makeRequest({ + path: `/userstories/${userStoryId}`, + method: "PATCH", + ...opts, + }); + }, + updateProject({ + projectId, ...opts + }) { + return this._makeRequest({ + path: `/projects/${projectId}`, + method: "PATCH", + ...opts, + }); + }, + listUsers(opts = {}) { + return this._makeRequest({ + path: "/users", + ...opts, + }); + }, + listTasks(opts = {}) { + return this._makeRequest({ + path: "/tasks", + ...opts, + }); + }, + updateTask({ + taskId, ...opts + }) { + return this._makeRequest({ + path: `/tasks/${taskId}`, + method: "PATCH", + ...opts, + }); + }, + listUserStories(opts = {}) { + return this._makeRequest({ + path: "/userstories", + ...opts, + }); }, }, -}; \ No newline at end of file +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5c0819068c83d..212983bc49abb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14046,7 +14046,11 @@ importers: components/taggun: {} - components/taiga: {} + components/taiga: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/tailscale: {}