@divyacon/piece-trello 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MIT-AP +24 -0
- package/README.md +8 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +153 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/ai/add-checklist-item.d.ts +6 -0
- package/dist/lib/actions/ai/add-checklist-item.d.ts.map +1 -0
- package/dist/lib/actions/ai/add-checklist-item.js +64 -0
- package/dist/lib/actions/ai/add-checklist-item.js.map +1 -0
- package/dist/lib/actions/ai/add-checklist-to-card.d.ts +5 -0
- package/dist/lib/actions/ai/add-checklist-to-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/add-checklist-to-card.js +57 -0
- package/dist/lib/actions/ai/add-checklist-to-card.js.map +1 -0
- package/dist/lib/actions/ai/add-comment-to-card.d.ts +5 -0
- package/dist/lib/actions/ai/add-comment-to-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/add-comment-to-card.js +55 -0
- package/dist/lib/actions/ai/add-comment-to-card.js.map +1 -0
- package/dist/lib/actions/ai/add-label-to-card.d.ts +5 -0
- package/dist/lib/actions/ai/add-label-to-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/add-label-to-card.js +56 -0
- package/dist/lib/actions/ai/add-label-to-card.js.map +1 -0
- package/dist/lib/actions/ai/add-member-to-card.d.ts +5 -0
- package/dist/lib/actions/ai/add-member-to-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/add-member-to-card.js +56 -0
- package/dist/lib/actions/ai/add-member-to-card.js.map +1 -0
- package/dist/lib/actions/ai/add-reaction-to-comment.d.ts +5 -0
- package/dist/lib/actions/ai/add-reaction-to-comment.d.ts.map +1 -0
- package/dist/lib/actions/ai/add-reaction-to-comment.js +60 -0
- package/dist/lib/actions/ai/add-reaction-to-comment.js.map +1 -0
- package/dist/lib/actions/ai/ai-common.d.ts +18 -0
- package/dist/lib/actions/ai/ai-common.d.ts.map +1 -0
- package/dist/lib/actions/ai/ai-common.js +29 -0
- package/dist/lib/actions/ai/ai-common.js.map +1 -0
- package/dist/lib/actions/ai/archive-all-cards-in-list.d.ts +4 -0
- package/dist/lib/actions/ai/archive-all-cards-in-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/archive-all-cards-in-list.js +47 -0
- package/dist/lib/actions/ai/archive-all-cards-in-list.js.map +1 -0
- package/dist/lib/actions/ai/archive-board.d.ts +5 -0
- package/dist/lib/actions/ai/archive-board.d.ts.map +1 -0
- package/dist/lib/actions/ai/archive-board.js +59 -0
- package/dist/lib/actions/ai/archive-board.js.map +1 -0
- package/dist/lib/actions/ai/archive-card.d.ts +5 -0
- package/dist/lib/actions/ai/archive-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/archive-card.js +59 -0
- package/dist/lib/actions/ai/archive-card.js.map +1 -0
- package/dist/lib/actions/ai/archive-list.d.ts +5 -0
- package/dist/lib/actions/ai/archive-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/archive-list.js +59 -0
- package/dist/lib/actions/ai/archive-list.js.map +1 -0
- package/dist/lib/actions/ai/create-board-label.d.ts +6 -0
- package/dist/lib/actions/ai/create-board-label.d.ts.map +1 -0
- package/dist/lib/actions/ai/create-board-label.js +67 -0
- package/dist/lib/actions/ai/create-board-label.js.map +1 -0
- package/dist/lib/actions/ai/create-board.d.ts +6 -0
- package/dist/lib/actions/ai/create-board.d.ts.map +1 -0
- package/dist/lib/actions/ai/create-board.js +64 -0
- package/dist/lib/actions/ai/create-board.js.map +1 -0
- package/dist/lib/actions/ai/create-card-ai.d.ts +8 -0
- package/dist/lib/actions/ai/create-card-ai.d.ts.map +1 -0
- package/dist/lib/actions/ai/create-card-ai.js +99 -0
- package/dist/lib/actions/ai/create-card-ai.js.map +1 -0
- package/dist/lib/actions/ai/create-list.d.ts +6 -0
- package/dist/lib/actions/ai/create-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/create-list.js +70 -0
- package/dist/lib/actions/ai/create-list.js.map +1 -0
- package/dist/lib/actions/ai/delete-card-ai.d.ts +4 -0
- package/dist/lib/actions/ai/delete-card-ai.d.ts.map +1 -0
- package/dist/lib/actions/ai/delete-card-ai.js +63 -0
- package/dist/lib/actions/ai/delete-card-ai.js.map +1 -0
- package/dist/lib/actions/ai/delete-checklist-item.d.ts +5 -0
- package/dist/lib/actions/ai/delete-checklist-item.d.ts.map +1 -0
- package/dist/lib/actions/ai/delete-checklist-item.js +52 -0
- package/dist/lib/actions/ai/delete-checklist-item.js.map +1 -0
- package/dist/lib/actions/ai/delete-checklist.d.ts +4 -0
- package/dist/lib/actions/ai/delete-checklist.d.ts.map +1 -0
- package/dist/lib/actions/ai/delete-checklist.js +47 -0
- package/dist/lib/actions/ai/delete-checklist.js.map +1 -0
- package/dist/lib/actions/ai/delete-comment.d.ts +5 -0
- package/dist/lib/actions/ai/delete-comment.d.ts.map +1 -0
- package/dist/lib/actions/ai/delete-comment.js +52 -0
- package/dist/lib/actions/ai/delete-comment.js.map +1 -0
- package/dist/lib/actions/ai/get-board.d.ts +4 -0
- package/dist/lib/actions/ai/get-board.d.ts.map +1 -0
- package/dist/lib/actions/ai/get-board.js +49 -0
- package/dist/lib/actions/ai/get-board.js.map +1 -0
- package/dist/lib/actions/ai/get-card-ai.d.ts +4 -0
- package/dist/lib/actions/ai/get-card-ai.d.ts.map +1 -0
- package/dist/lib/actions/ai/get-card-ai.js +64 -0
- package/dist/lib/actions/ai/get-card-ai.js.map +1 -0
- package/dist/lib/actions/ai/get-list.d.ts +4 -0
- package/dist/lib/actions/ai/get-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/get-list.js +49 -0
- package/dist/lib/actions/ai/get-list.js.map +1 -0
- package/dist/lib/actions/ai/get-member.d.ts +4 -0
- package/dist/lib/actions/ai/get-member.d.ts.map +1 -0
- package/dist/lib/actions/ai/get-member.js +49 -0
- package/dist/lib/actions/ai/get-member.js.map +1 -0
- package/dist/lib/actions/ai/get-my-member.d.ts +2 -0
- package/dist/lib/actions/ai/get-my-member.d.ts.map +1 -0
- package/dist/lib/actions/ai/get-my-member.js +43 -0
- package/dist/lib/actions/ai/get-my-member.js.map +1 -0
- package/dist/lib/actions/ai/list-board-labels.d.ts +5 -0
- package/dist/lib/actions/ai/list-board-labels.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-board-labels.js +60 -0
- package/dist/lib/actions/ai/list-board-labels.js.map +1 -0
- package/dist/lib/actions/ai/list-board-members.d.ts +4 -0
- package/dist/lib/actions/ai/list-board-members.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-board-members.js +51 -0
- package/dist/lib/actions/ai/list-board-members.js.map +1 -0
- package/dist/lib/actions/ai/list-boards.d.ts +5 -0
- package/dist/lib/actions/ai/list-boards.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-boards.js +68 -0
- package/dist/lib/actions/ai/list-boards.js.map +1 -0
- package/dist/lib/actions/ai/list-card-attachments-ai.d.ts +4 -0
- package/dist/lib/actions/ai/list-card-attachments-ai.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-card-attachments-ai.js +64 -0
- package/dist/lib/actions/ai/list-card-attachments-ai.js.map +1 -0
- package/dist/lib/actions/ai/list-card-checklists.d.ts +4 -0
- package/dist/lib/actions/ai/list-card-checklists.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-card-checklists.js +51 -0
- package/dist/lib/actions/ai/list-card-checklists.js.map +1 -0
- package/dist/lib/actions/ai/list-card-comments.d.ts +5 -0
- package/dist/lib/actions/ai/list-card-comments.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-card-comments.js +60 -0
- package/dist/lib/actions/ai/list-card-comments.js.map +1 -0
- package/dist/lib/actions/ai/list-card-members.d.ts +4 -0
- package/dist/lib/actions/ai/list-card-members.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-card-members.js +51 -0
- package/dist/lib/actions/ai/list-card-members.js.map +1 -0
- package/dist/lib/actions/ai/list-cards-in-board.d.ts +5 -0
- package/dist/lib/actions/ai/list-cards-in-board.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-cards-in-board.js +68 -0
- package/dist/lib/actions/ai/list-cards-in-board.js.map +1 -0
- package/dist/lib/actions/ai/list-cards-in-list.d.ts +5 -0
- package/dist/lib/actions/ai/list-cards-in-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-cards-in-list.js +67 -0
- package/dist/lib/actions/ai/list-cards-in-list.js.map +1 -0
- package/dist/lib/actions/ai/list-lists.d.ts +5 -0
- package/dist/lib/actions/ai/list-lists.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-lists.js +67 -0
- package/dist/lib/actions/ai/list-lists.js.map +1 -0
- package/dist/lib/actions/ai/list-organization-boards.d.ts +4 -0
- package/dist/lib/actions/ai/list-organization-boards.d.ts.map +1 -0
- package/dist/lib/actions/ai/list-organization-boards.js +51 -0
- package/dist/lib/actions/ai/list-organization-boards.js.map +1 -0
- package/dist/lib/actions/ai/move-all-cards-in-list.d.ts +6 -0
- package/dist/lib/actions/ai/move-all-cards-in-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/move-all-cards-in-list.js +60 -0
- package/dist/lib/actions/ai/move-all-cards-in-list.js.map +1 -0
- package/dist/lib/actions/ai/move-card.d.ts +5 -0
- package/dist/lib/actions/ai/move-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/move-card.js +56 -0
- package/dist/lib/actions/ai/move-card.js.map +1 -0
- package/dist/lib/actions/ai/remove-label-from-card.d.ts +5 -0
- package/dist/lib/actions/ai/remove-label-from-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/remove-label-from-card.js +52 -0
- package/dist/lib/actions/ai/remove-label-from-card.js.map +1 -0
- package/dist/lib/actions/ai/remove-member-from-card.d.ts +5 -0
- package/dist/lib/actions/ai/remove-member-from-card.d.ts.map +1 -0
- package/dist/lib/actions/ai/remove-member-from-card.js +54 -0
- package/dist/lib/actions/ai/remove-member-from-card.js.map +1 -0
- package/dist/lib/actions/ai/rename-list.d.ts +5 -0
- package/dist/lib/actions/ai/rename-list.d.ts.map +1 -0
- package/dist/lib/actions/ai/rename-list.js +55 -0
- package/dist/lib/actions/ai/rename-list.js.map +1 -0
- package/dist/lib/actions/ai/search-cards.d.ts +7 -0
- package/dist/lib/actions/ai/search-cards.d.ts.map +1 -0
- package/dist/lib/actions/ai/search-cards.js +88 -0
- package/dist/lib/actions/ai/search-cards.js.map +1 -0
- package/dist/lib/actions/ai/search-members.d.ts +7 -0
- package/dist/lib/actions/ai/search-members.d.ts.map +1 -0
- package/dist/lib/actions/ai/search-members.js +75 -0
- package/dist/lib/actions/ai/search-members.js.map +1 -0
- package/dist/lib/actions/ai/set-checklist-item-state.d.ts +7 -0
- package/dist/lib/actions/ai/set-checklist-item-state.d.ts.map +1 -0
- package/dist/lib/actions/ai/set-checklist-item-state.js +71 -0
- package/dist/lib/actions/ai/set-checklist-item-state.js.map +1 -0
- package/dist/lib/actions/ai/update-board.d.ts +6 -0
- package/dist/lib/actions/ai/update-board.d.ts.map +1 -0
- package/dist/lib/actions/ai/update-board.js +64 -0
- package/dist/lib/actions/ai/update-board.js.map +1 -0
- package/dist/lib/actions/ai/update-card-ai.d.ts +11 -0
- package/dist/lib/actions/ai/update-card-ai.d.ts.map +1 -0
- package/dist/lib/actions/ai/update-card-ai.js +130 -0
- package/dist/lib/actions/ai/update-card-ai.js.map +1 -0
- package/dist/lib/actions/ai/update-comment.d.ts +6 -0
- package/dist/lib/actions/ai/update-comment.d.ts.map +1 -0
- package/dist/lib/actions/ai/update-comment.js +60 -0
- package/dist/lib/actions/ai/update-comment.js.map +1 -0
- package/dist/lib/actions/ai/update-label.d.ts +6 -0
- package/dist/lib/actions/ai/update-label.d.ts.map +1 -0
- package/dist/lib/actions/ai/update-label.js +65 -0
- package/dist/lib/actions/ai/update-label.js.map +1 -0
- package/dist/lib/actions/card/create-card.d.ts +9 -0
- package/dist/lib/actions/card/create-card.d.ts.map +1 -0
- package/dist/lib/actions/card/create-card.js +73 -0
- package/dist/lib/actions/card/create-card.js.map +1 -0
- package/dist/lib/actions/card/delete-card.d.ts +4 -0
- package/dist/lib/actions/card/delete-card.d.ts.map +1 -0
- package/dist/lib/actions/card/delete-card.js +44 -0
- package/dist/lib/actions/card/delete-card.js.map +1 -0
- package/dist/lib/actions/card/get-card.d.ts +4 -0
- package/dist/lib/actions/card/get-card.d.ts.map +1 -0
- package/dist/lib/actions/card/get-card.js +45 -0
- package/dist/lib/actions/card/get-card.js.map +1 -0
- package/dist/lib/actions/card/update-card.d.ts +12 -0
- package/dist/lib/actions/card/update-card.d.ts.map +1 -0
- package/dist/lib/actions/card/update-card.js +104 -0
- package/dist/lib/actions/card/update-card.js.map +1 -0
- package/dist/lib/actions/card-attachment/add-card-attachment.d.ts +8 -0
- package/dist/lib/actions/card-attachment/add-card-attachment.d.ts.map +1 -0
- package/dist/lib/actions/card-attachment/add-card-attachment.js +76 -0
- package/dist/lib/actions/card-attachment/add-card-attachment.js.map +1 -0
- package/dist/lib/actions/card-attachment/delete-card-attachment.d.ts +5 -0
- package/dist/lib/actions/card-attachment/delete-card-attachment.d.ts.map +1 -0
- package/dist/lib/actions/card-attachment/delete-card-attachment.js +49 -0
- package/dist/lib/actions/card-attachment/delete-card-attachment.js.map +1 -0
- package/dist/lib/actions/card-attachment/get-card-attachment.d.ts +5 -0
- package/dist/lib/actions/card-attachment/get-card-attachment.d.ts.map +1 -0
- package/dist/lib/actions/card-attachment/get-card-attachment.js +50 -0
- package/dist/lib/actions/card-attachment/get-card-attachment.js.map +1 -0
- package/dist/lib/actions/card-attachment/get-card-attachments.d.ts +4 -0
- package/dist/lib/actions/card-attachment/get-card-attachments.d.ts.map +1 -0
- package/dist/lib/actions/card-attachment/get-card-attachments.js +45 -0
- package/dist/lib/actions/card-attachment/get-card-attachments.js.map +1 -0
- package/dist/lib/common/index.d.ts +25 -0
- package/dist/lib/common/index.d.ts.map +1 -0
- package/dist/lib/common/index.js +292 -0
- package/dist/lib/common/index.js.map +1 -0
- package/dist/lib/common/props/card.d.ts +116 -0
- package/dist/lib/common/props/card.d.ts.map +1 -0
- package/dist/lib/common/props/card.js +3 -0
- package/dist/lib/common/props/card.js.map +1 -0
- package/dist/lib/output-schemas.d.ts +50 -0
- package/dist/lib/output-schemas.d.ts.map +1 -0
- package/dist/lib/output-schemas.js +316 -0
- package/dist/lib/output-schemas.js.map +1 -0
- package/dist/lib/triggers/cardMoved.d.ts +15 -0
- package/dist/lib/triggers/cardMoved.d.ts.map +1 -0
- package/dist/lib/triggers/cardMoved.js +152 -0
- package/dist/lib/triggers/cardMoved.js.map +1 -0
- package/dist/lib/triggers/deadline.d.ts +23 -0
- package/dist/lib/triggers/deadline.d.ts.map +1 -0
- package/dist/lib/triggers/deadline.js +94 -0
- package/dist/lib/triggers/deadline.js.map +1 -0
- package/dist/lib/triggers/newCard.d.ts +15 -0
- package/dist/lib/triggers/newCard.d.ts.map +1 -0
- package/dist/lib/triggers/newCard.js +151 -0
- package/dist/lib/triggers/newCard.js.map +1 -0
- package/package.json +45 -3
- package/src/index.ts +153 -0
- package/src/lib/actions/ai/add-checklist-item.ts +67 -0
- package/src/lib/actions/ai/add-checklist-to-card.ts +58 -0
- package/src/lib/actions/ai/add-comment-to-card.ts +55 -0
- package/src/lib/actions/ai/add-label-to-card.ts +57 -0
- package/src/lib/actions/ai/add-member-to-card.ts +57 -0
- package/src/lib/actions/ai/add-reaction-to-comment.ts +61 -0
- package/src/lib/actions/ai/ai-common.ts +40 -0
- package/src/lib/actions/ai/archive-all-cards-in-list.ts +47 -0
- package/src/lib/actions/ai/archive-board.ts +58 -0
- package/src/lib/actions/ai/archive-card.ts +58 -0
- package/src/lib/actions/ai/archive-list.ts +58 -0
- package/src/lib/actions/ai/create-board-label.ts +69 -0
- package/src/lib/actions/ai/create-board.ts +66 -0
- package/src/lib/actions/ai/create-card-ai.ts +103 -0
- package/src/lib/actions/ai/create-list.ts +71 -0
- package/src/lib/actions/ai/delete-card-ai.ts +64 -0
- package/src/lib/actions/ai/delete-checklist-item.ts +54 -0
- package/src/lib/actions/ai/delete-checklist.ts +48 -0
- package/src/lib/actions/ai/delete-comment.ts +52 -0
- package/src/lib/actions/ai/get-board.ts +49 -0
- package/src/lib/actions/ai/get-card-ai.ts +67 -0
- package/src/lib/actions/ai/get-list.ts +49 -0
- package/src/lib/actions/ai/get-member.ts +50 -0
- package/src/lib/actions/ai/get-my-member.ts +43 -0
- package/src/lib/actions/ai/list-board-labels.ts +62 -0
- package/src/lib/actions/ai/list-board-members.ts +52 -0
- package/src/lib/actions/ai/list-boards.ts +71 -0
- package/src/lib/actions/ai/list-card-attachments-ai.ts +66 -0
- package/src/lib/actions/ai/list-card-checklists.ts +52 -0
- package/src/lib/actions/ai/list-card-comments.ts +62 -0
- package/src/lib/actions/ai/list-card-members.ts +52 -0
- package/src/lib/actions/ai/list-cards-in-board.ts +70 -0
- package/src/lib/actions/ai/list-cards-in-list.ts +69 -0
- package/src/lib/actions/ai/list-lists.ts +69 -0
- package/src/lib/actions/ai/list-organization-boards.ts +53 -0
- package/src/lib/actions/ai/move-all-cards-in-list.ts +61 -0
- package/src/lib/actions/ai/move-card.ts +57 -0
- package/src/lib/actions/ai/remove-label-from-card.ts +53 -0
- package/src/lib/actions/ai/remove-member-from-card.ts +55 -0
- package/src/lib/actions/ai/rename-list.ts +55 -0
- package/src/lib/actions/ai/search-cards.ts +91 -0
- package/src/lib/actions/ai/search-members.ts +75 -0
- package/src/lib/actions/ai/set-checklist-item-state.ts +73 -0
- package/src/lib/actions/ai/update-board.ts +65 -0
- package/src/lib/actions/ai/update-card-ai.ts +136 -0
- package/src/lib/actions/ai/update-comment.ts +61 -0
- package/src/lib/actions/ai/update-label.ts +67 -0
- package/src/lib/actions/card/create-card.ts +73 -0
- package/src/lib/actions/card/delete-card.ts +44 -0
- package/src/lib/actions/card/get-card.ts +44 -0
- package/src/lib/actions/card/update-card.ts +113 -0
- package/src/lib/actions/card-attachment/add-card-attachment.ts +86 -0
- package/src/lib/actions/card-attachment/delete-card-attachment.ts +49 -0
- package/src/lib/actions/card-attachment/get-card-attachment.ts +51 -0
- package/src/lib/actions/card-attachment/get-card-attachments.ts +45 -0
- package/src/lib/common/index.ts +333 -0
- package/src/lib/common/props/card.ts +113 -0
- package/src/lib/output-schemas.ts +374 -0
- package/src/lib/triggers/cardMoved.ts +155 -0
- package/src/lib/triggers/deadline.ts +89 -0
- package/src/lib/triggers/newCard.ts +156 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { getBoardActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const getBoard = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'get_board',
|
|
15
|
+
displayName: 'Get Board (Agent)',
|
|
16
|
+
description: 'Get the details of a Trello board by ID.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: getBoardActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Retrieves the details of a single Trello board by its board_id (name, description, url, prefs). Obtain board_id from List Boards. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
board_id: Property.ShortText({
|
|
26
|
+
displayName: 'Board ID',
|
|
27
|
+
description: 'The ID of the board. Obtain it from List Boards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async run(context) {
|
|
33
|
+
try {
|
|
34
|
+
const request: HttpRequest = {
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url: `${trelloCommon.baseUrl}boards/${context.propsValue['board_id']}`,
|
|
37
|
+
headers: { Accept: 'application/json' },
|
|
38
|
+
queryParams: withAuthParams(context.auth),
|
|
39
|
+
};
|
|
40
|
+
const response = await httpClient.sendRequest(request);
|
|
41
|
+
return response.body;
|
|
42
|
+
} catch (error: any) {
|
|
43
|
+
rethrowTrelloError(
|
|
44
|
+
error,
|
|
45
|
+
'Board not found. Verify the board_id (resolve it via List Boards).'
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { TrelloCard } from '../../common/props/card';
|
|
9
|
+
import { trelloAuth } from '../../..';
|
|
10
|
+
import { getCardAiActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const getCardAi = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'get_card_ai',
|
|
15
|
+
displayName: 'Get Card (Agent)',
|
|
16
|
+
description: 'Get the full details of a Trello card by ID.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: getCardAiActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Retrieves the full details of a single Trello card by its card_id (name, description, due date, labels, list, members, and more). Obtain the card_id from Search Cards, List Cards In List, or List Cards In Board. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
card_id: Property.ShortText({
|
|
26
|
+
displayName: 'Card ID',
|
|
27
|
+
description:
|
|
28
|
+
'The ID of the card. Obtain it from Search Cards, List Cards In List, or List Cards In Board.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
async run(context) {
|
|
34
|
+
try {
|
|
35
|
+
const request: HttpRequest = {
|
|
36
|
+
method: HttpMethod.GET,
|
|
37
|
+
url:
|
|
38
|
+
`${trelloCommon.baseUrl}cards/` +
|
|
39
|
+
context.propsValue['card_id'] +
|
|
40
|
+
`?key=` +
|
|
41
|
+
context.auth.username +
|
|
42
|
+
`&token=` +
|
|
43
|
+
context.auth.password,
|
|
44
|
+
headers: {
|
|
45
|
+
Accept: 'application/json',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
return (await httpClient.sendRequest<TrelloCard>(request)).body;
|
|
49
|
+
} catch (error: any) {
|
|
50
|
+
const status = error?.response?.status;
|
|
51
|
+
if (status === 401 || status === 403) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
'Permission denied reading the card. Check the connection token and your access to the board.'
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
if (status === 404) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
'Card not found. Verify the card_id (resolve it via Search Cards).'
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
if (status === 429) {
|
|
62
|
+
throw new Error('Trello rate limit exceeded. Retry after a short delay.');
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { getListActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const getList = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'get_list',
|
|
15
|
+
displayName: 'Get List (Agent)',
|
|
16
|
+
description: 'Get the details of a Trello list by ID.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: getListActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Retrieves the details of a single Trello list by its list_id (name, board, open/closed state). Obtain list_id from List Lists. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
list_id: Property.ShortText({
|
|
26
|
+
displayName: 'List ID',
|
|
27
|
+
description: 'The ID of the list. Obtain it from List Lists.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async run(context) {
|
|
33
|
+
try {
|
|
34
|
+
const request: HttpRequest = {
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url: `${trelloCommon.baseUrl}lists/${context.propsValue['list_id']}`,
|
|
37
|
+
headers: { Accept: 'application/json' },
|
|
38
|
+
queryParams: withAuthParams(context.auth),
|
|
39
|
+
};
|
|
40
|
+
const response = await httpClient.sendRequest(request);
|
|
41
|
+
return response.body;
|
|
42
|
+
} catch (error: any) {
|
|
43
|
+
rethrowTrelloError(
|
|
44
|
+
error,
|
|
45
|
+
'List not found. Verify the list_id (resolve it via List Lists).'
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { getMemberActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const getMember = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'get_member',
|
|
15
|
+
displayName: 'Get Member (Agent)',
|
|
16
|
+
description: 'Get a Trello member by id or username.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: getMemberActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Retrieves a Trello member profile by member id or username. Obtain a member id from Search Members or List Board Members. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
member_id: Property.ShortText({
|
|
26
|
+
displayName: 'Member ID or Username',
|
|
27
|
+
description:
|
|
28
|
+
'The member id or username. Obtain it from Search Members or List Board Members.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
async run(context) {
|
|
34
|
+
try {
|
|
35
|
+
const request: HttpRequest = {
|
|
36
|
+
method: HttpMethod.GET,
|
|
37
|
+
url: `${trelloCommon.baseUrl}members/${context.propsValue['member_id']}`,
|
|
38
|
+
headers: { Accept: 'application/json' },
|
|
39
|
+
queryParams: withAuthParams(context.auth),
|
|
40
|
+
};
|
|
41
|
+
const response = await httpClient.sendRequest(request);
|
|
42
|
+
return response.body;
|
|
43
|
+
} catch (error: any) {
|
|
44
|
+
rethrowTrelloError(
|
|
45
|
+
error,
|
|
46
|
+
'Member not found. Verify the member id or username (resolve it via Search Members).'
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createAction } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { getMyMemberActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const getMyMember = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'get_my_member',
|
|
15
|
+
displayName: 'Get My Member (Agent)',
|
|
16
|
+
description: 'Get the connected Trello user.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: getMyMemberActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Returns the connected Trello user (id, username, full name). Use it to resolve "me" — your own member id — for assigning yourself to cards or as the member filter in List Boards. Takes no inputs. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {},
|
|
25
|
+
|
|
26
|
+
async run(context) {
|
|
27
|
+
try {
|
|
28
|
+
const request: HttpRequest = {
|
|
29
|
+
method: HttpMethod.GET,
|
|
30
|
+
url: `${trelloCommon.baseUrl}members/me`,
|
|
31
|
+
headers: { Accept: 'application/json' },
|
|
32
|
+
queryParams: withAuthParams(context.auth),
|
|
33
|
+
};
|
|
34
|
+
const response = await httpClient.sendRequest(request);
|
|
35
|
+
return response.body;
|
|
36
|
+
} catch (error: any) {
|
|
37
|
+
rethrowTrelloError(
|
|
38
|
+
error,
|
|
39
|
+
'Could not resolve the connected user. Check the connection token.'
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
QueryParams,
|
|
7
|
+
} from '@agnocon/pieces-common';
|
|
8
|
+
import { trelloCommon } from '../../common';
|
|
9
|
+
import { trelloAuth } from '../../..';
|
|
10
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
11
|
+
import { listBoardLabelsActionOutputSchema } from '../../output-schemas';
|
|
12
|
+
|
|
13
|
+
export const listBoardLabels = createAction({
|
|
14
|
+
auth: trelloAuth,
|
|
15
|
+
name: 'list_board_labels',
|
|
16
|
+
displayName: 'List Board Labels (Agent)',
|
|
17
|
+
description: "List a board's labels.",
|
|
18
|
+
audience: 'ai',
|
|
19
|
+
outputSchema: listBoardLabelsActionOutputSchema,
|
|
20
|
+
aiMetadata: {
|
|
21
|
+
description:
|
|
22
|
+
"Lists the labels defined on a Trello board, returning each label id, name, and color. Use it to resolve a label_id for Add Label To Card / Remove Label From Card. Obtain board_id from List Boards. Read-only and idempotent.",
|
|
23
|
+
idempotent: true,
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
board_id: Property.ShortText({
|
|
27
|
+
displayName: 'Board ID',
|
|
28
|
+
description: 'The ID of the board. Obtain it from List Boards.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
limit: Property.Number({
|
|
32
|
+
displayName: 'Limit',
|
|
33
|
+
description: 'Maximum number of labels to return (1-1000, default 50).',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async run(context) {
|
|
39
|
+
const params: QueryParams = {};
|
|
40
|
+
if (context.propsValue['limit']) {
|
|
41
|
+
params['limit'] = String(context.propsValue['limit']);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const request: HttpRequest = {
|
|
45
|
+
method: HttpMethod.GET,
|
|
46
|
+
url: `${trelloCommon.baseUrl}boards/${context.propsValue['board_id']}/labels`,
|
|
47
|
+
headers: { Accept: 'application/json' },
|
|
48
|
+
queryParams: withAuthParams(context.auth, params),
|
|
49
|
+
};
|
|
50
|
+
const response = await httpClient.sendRequest<
|
|
51
|
+
Array<Record<string, unknown>>
|
|
52
|
+
>(request);
|
|
53
|
+
const labels = response.body ?? [];
|
|
54
|
+
return { labels, count: labels.length };
|
|
55
|
+
} catch (error: any) {
|
|
56
|
+
rethrowTrelloError(
|
|
57
|
+
error,
|
|
58
|
+
'Board not found. Verify the board_id (resolve it via List Boards).'
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { listBoardMembersActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const listBoardMembers = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'list_board_members',
|
|
15
|
+
displayName: 'List Board Members (Agent)',
|
|
16
|
+
description: 'List the members of a Trello board.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: listBoardMembersActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Lists the members of a Trello board, returning each member id, username, and full name. Use it to resolve a member_id for card assignment (Add Member To Card) or board removal. Obtain board_id from List Boards. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
board_id: Property.ShortText({
|
|
26
|
+
displayName: 'Board ID',
|
|
27
|
+
description: 'The ID of the board. Obtain it from List Boards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async run(context) {
|
|
33
|
+
try {
|
|
34
|
+
const request: HttpRequest = {
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url: `${trelloCommon.baseUrl}boards/${context.propsValue['board_id']}/members`,
|
|
37
|
+
headers: { Accept: 'application/json' },
|
|
38
|
+
queryParams: withAuthParams(context.auth),
|
|
39
|
+
};
|
|
40
|
+
const response = await httpClient.sendRequest<
|
|
41
|
+
Array<Record<string, unknown>>
|
|
42
|
+
>(request);
|
|
43
|
+
const members = response.body ?? [];
|
|
44
|
+
return { members, count: members.length };
|
|
45
|
+
} catch (error: any) {
|
|
46
|
+
rethrowTrelloError(
|
|
47
|
+
error,
|
|
48
|
+
'Board not found. Verify the board_id (resolve it via List Boards).'
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
QueryParams,
|
|
7
|
+
} from '@agnocon/pieces-common';
|
|
8
|
+
import { trelloCommon } from '../../common';
|
|
9
|
+
import { trelloAuth } from '../../..';
|
|
10
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
11
|
+
import { listBoardsActionOutputSchema } from '../../output-schemas';
|
|
12
|
+
|
|
13
|
+
export const listBoards = createAction({
|
|
14
|
+
auth: trelloAuth,
|
|
15
|
+
name: 'list_boards',
|
|
16
|
+
displayName: 'List Boards (Agent)',
|
|
17
|
+
description: 'List the Trello boards you can access.',
|
|
18
|
+
audience: 'ai',
|
|
19
|
+
outputSchema: listBoardsActionOutputSchema,
|
|
20
|
+
aiMetadata: {
|
|
21
|
+
description:
|
|
22
|
+
'Lists the Trello boards the connected user can access, returning each board id and name. This is the top-level resolver: start here to get a board_id, then use List Lists / List Board Labels / List Board Members to drill down. Defaults to the connected user (member "me"). Read-only and idempotent.',
|
|
23
|
+
idempotent: true,
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
member_id: Property.ShortText({
|
|
27
|
+
displayName: 'Member ID',
|
|
28
|
+
description:
|
|
29
|
+
'Whose boards to list. Defaults to the connected user ("me"). Obtain another member id from Search Members.',
|
|
30
|
+
required: false,
|
|
31
|
+
}),
|
|
32
|
+
filter: Property.StaticDropdown({
|
|
33
|
+
displayName: 'Filter',
|
|
34
|
+
description: 'Which boards to include.',
|
|
35
|
+
required: false,
|
|
36
|
+
options: {
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'Open', value: 'open' },
|
|
39
|
+
{ label: 'Closed', value: 'closed' },
|
|
40
|
+
{ label: 'All', value: 'all' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
async run(context) {
|
|
47
|
+
const memberId = (context.propsValue['member_id'] as string) || 'me';
|
|
48
|
+
const params: QueryParams = {};
|
|
49
|
+
if (context.propsValue['filter']) {
|
|
50
|
+
params['filter'] = context.propsValue['filter'] as string;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const request: HttpRequest = {
|
|
54
|
+
method: HttpMethod.GET,
|
|
55
|
+
url: `${trelloCommon.baseUrl}members/${memberId}/boards`,
|
|
56
|
+
headers: { Accept: 'application/json' },
|
|
57
|
+
queryParams: withAuthParams(context.auth, params),
|
|
58
|
+
};
|
|
59
|
+
const response = await httpClient.sendRequest<
|
|
60
|
+
Array<Record<string, unknown>>
|
|
61
|
+
>(request);
|
|
62
|
+
const boards = response.body ?? [];
|
|
63
|
+
return { boards, count: boards.length };
|
|
64
|
+
} catch (error: any) {
|
|
65
|
+
rethrowTrelloError(
|
|
66
|
+
error,
|
|
67
|
+
'Member not found. Verify the member_id, or omit it to list your own boards.'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { listCardAttachmentsAiActionOutputSchema } from '../../output-schemas';
|
|
10
|
+
|
|
11
|
+
export const listCardAttachmentsAi = createAction({
|
|
12
|
+
auth: trelloAuth,
|
|
13
|
+
name: 'list_card_attachments_ai',
|
|
14
|
+
displayName: 'List Card Attachments (Agent)',
|
|
15
|
+
description: 'List all attachments on a Trello card.',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
outputSchema: listCardAttachmentsAiActionOutputSchema,
|
|
18
|
+
aiMetadata: {
|
|
19
|
+
description:
|
|
20
|
+
'Lists all attachments on a Trello card identified by card_id, returning each attachment id, name, and url. Use it to find an attachment id before fetching or deleting it. Obtain card_id from Search Cards. Read-only and idempotent.',
|
|
21
|
+
idempotent: true,
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
card_id: Property.ShortText({
|
|
25
|
+
displayName: 'Card ID',
|
|
26
|
+
description:
|
|
27
|
+
'The ID of the card to list attachments for. Obtain it from Search Cards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async run(context) {
|
|
33
|
+
try {
|
|
34
|
+
const request: HttpRequest = {
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url:
|
|
37
|
+
`${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/attachments` +
|
|
38
|
+
`?key=` +
|
|
39
|
+
context.auth.username +
|
|
40
|
+
`&token=` +
|
|
41
|
+
context.auth.password,
|
|
42
|
+
headers: {
|
|
43
|
+
Accept: 'application/json',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
const response = await httpClient.sendRequest(request);
|
|
47
|
+
return response.body;
|
|
48
|
+
} catch (error: any) {
|
|
49
|
+
const status = error?.response?.status;
|
|
50
|
+
if (status === 401 || status === 403) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
'Permission denied reading attachments. Check the connection token and your access to the board.'
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
if (status === 404) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
'Card not found. Verify the card_id (resolve it via Search Cards).'
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (status === 429) {
|
|
61
|
+
throw new Error('Trello rate limit exceeded. Retry after a short delay.');
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { listCardChecklistsActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const listCardChecklists = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'list_card_checklists',
|
|
15
|
+
displayName: 'List Card Checklists (Agent)',
|
|
16
|
+
description: "List a card's checklists and their items.",
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: listCardChecklistsActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
"Lists the checklists on a Trello card, each with its idChecklist and its check items (idCheckItem, name, state). This is the source for the ids needed by Set Checklist Item State, Add Checklist Item, Delete Checklist, and Delete Checklist Item. Obtain card_id from Search Cards. Read-only and idempotent.",
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
card_id: Property.ShortText({
|
|
26
|
+
displayName: 'Card ID',
|
|
27
|
+
description: 'The ID of the card. Obtain it from Search Cards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async run(context) {
|
|
33
|
+
try {
|
|
34
|
+
const request: HttpRequest = {
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url: `${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/checklists`,
|
|
37
|
+
headers: { Accept: 'application/json' },
|
|
38
|
+
queryParams: withAuthParams(context.auth, { checkItems: 'all' }),
|
|
39
|
+
};
|
|
40
|
+
const response = await httpClient.sendRequest<
|
|
41
|
+
Array<Record<string, unknown>>
|
|
42
|
+
>(request);
|
|
43
|
+
const checklists = response.body ?? [];
|
|
44
|
+
return { checklists, count: checklists.length };
|
|
45
|
+
} catch (error: any) {
|
|
46
|
+
rethrowTrelloError(
|
|
47
|
+
error,
|
|
48
|
+
'Card not found. Verify the card_id (resolve it via Search Cards).'
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
QueryParams,
|
|
7
|
+
} from '@agnocon/pieces-common';
|
|
8
|
+
import { trelloCommon } from '../../common';
|
|
9
|
+
import { trelloAuth } from '../../..';
|
|
10
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
11
|
+
import { listCardCommentsActionOutputSchema } from '../../output-schemas';
|
|
12
|
+
|
|
13
|
+
export const listCardComments = createAction({
|
|
14
|
+
auth: trelloAuth,
|
|
15
|
+
name: 'list_card_comments',
|
|
16
|
+
displayName: 'List Card Comments (Agent)',
|
|
17
|
+
description: "Read a card's comment history.",
|
|
18
|
+
audience: 'ai',
|
|
19
|
+
outputSchema: listCardCommentsActionOutputSchema,
|
|
20
|
+
aiMetadata: {
|
|
21
|
+
description:
|
|
22
|
+
"Lists the comments on a Trello card identified by card_id, returning each comment's id (idAction), text, author, and date. Use the returned comment id with Update Comment / Delete Comment. Obtain card_id from Search Cards. Read-only and idempotent.",
|
|
23
|
+
idempotent: true,
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
card_id: Property.ShortText({
|
|
27
|
+
displayName: 'Card ID',
|
|
28
|
+
description: 'The ID of the card. Obtain it from Search Cards.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
limit: Property.Number({
|
|
32
|
+
displayName: 'Limit',
|
|
33
|
+
description: 'Maximum number of comments to return (1-1000, default 50).',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async run(context) {
|
|
39
|
+
const params: QueryParams = { filter: 'commentCard' };
|
|
40
|
+
if (context.propsValue['limit']) {
|
|
41
|
+
params['limit'] = String(context.propsValue['limit']);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const request: HttpRequest = {
|
|
45
|
+
method: HttpMethod.GET,
|
|
46
|
+
url: `${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/actions`,
|
|
47
|
+
headers: { Accept: 'application/json' },
|
|
48
|
+
queryParams: withAuthParams(context.auth, params),
|
|
49
|
+
};
|
|
50
|
+
const response = await httpClient.sendRequest<
|
|
51
|
+
Array<Record<string, unknown>>
|
|
52
|
+
>(request);
|
|
53
|
+
const comments = response.body ?? [];
|
|
54
|
+
return { comments, count: comments.length };
|
|
55
|
+
} catch (error: any) {
|
|
56
|
+
rethrowTrelloError(
|
|
57
|
+
error,
|
|
58
|
+
'Card not found. Verify the card_id (resolve it via Search Cards).'
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createAction, Property } from '@agnocon/pieces-framework';
|
|
2
|
+
import {
|
|
3
|
+
httpClient,
|
|
4
|
+
HttpRequest,
|
|
5
|
+
HttpMethod,
|
|
6
|
+
} from '@agnocon/pieces-common';
|
|
7
|
+
import { trelloCommon } from '../../common';
|
|
8
|
+
import { trelloAuth } from '../../..';
|
|
9
|
+
import { withAuthParams, rethrowTrelloError } from './ai-common';
|
|
10
|
+
import { listCardMembersActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const listCardMembers = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'list_card_members',
|
|
15
|
+
displayName: 'List Card Members (Agent)',
|
|
16
|
+
description: 'List the members assigned to a Trello card.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: listCardMembersActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Lists the members currently assigned to a Trello card, returning each member id and username. Use it to see who is on a card or to get a member_id for Remove Member From Card. Obtain card_id from Search Cards. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
card_id: Property.ShortText({
|
|
26
|
+
displayName: 'Card ID',
|
|
27
|
+
description: 'The ID of the card. Obtain it from Search Cards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async run(context) {
|
|
33
|
+
try {
|
|
34
|
+
const request: HttpRequest = {
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url: `${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/members`,
|
|
37
|
+
headers: { Accept: 'application/json' },
|
|
38
|
+
queryParams: withAuthParams(context.auth),
|
|
39
|
+
};
|
|
40
|
+
const response = await httpClient.sendRequest<
|
|
41
|
+
Array<Record<string, unknown>>
|
|
42
|
+
>(request);
|
|
43
|
+
const members = response.body ?? [];
|
|
44
|
+
return { members, count: members.length };
|
|
45
|
+
} catch (error: any) {
|
|
46
|
+
rethrowTrelloError(
|
|
47
|
+
error,
|
|
48
|
+
'Card not found. Verify the card_id (resolve it via Search Cards).'
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
});
|