@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,70 @@
|
|
|
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 { listCardsInBoardActionOutputSchema } from '../../output-schemas';
|
|
12
|
+
|
|
13
|
+
export const listCardsInBoard = createAction({
|
|
14
|
+
auth: trelloAuth,
|
|
15
|
+
name: 'list_cards_in_board',
|
|
16
|
+
displayName: 'List Cards In Board (Agent)',
|
|
17
|
+
description: 'List all cards on a Trello board.',
|
|
18
|
+
audience: 'ai',
|
|
19
|
+
outputSchema: listCardsInBoardActionOutputSchema,
|
|
20
|
+
aiMetadata: {
|
|
21
|
+
description:
|
|
22
|
+
'Lists every card on a Trello board identified by board_id, returning each card id and fields. Use it to enumerate all cards across a board. 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
|
+
filter: Property.StaticDropdown({
|
|
32
|
+
displayName: 'Filter',
|
|
33
|
+
description: 'Which cards to include.',
|
|
34
|
+
required: false,
|
|
35
|
+
options: {
|
|
36
|
+
options: [
|
|
37
|
+
{ label: 'Open', value: 'open' },
|
|
38
|
+
{ label: 'Closed (archived)', value: 'closed' },
|
|
39
|
+
{ label: 'All', value: 'all' },
|
|
40
|
+
{ label: 'Visible', value: 'visible' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
async run(context) {
|
|
47
|
+
const params: QueryParams = {};
|
|
48
|
+
if (context.propsValue['filter']) {
|
|
49
|
+
params['filter'] = context.propsValue['filter'] as string;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const request: HttpRequest = {
|
|
53
|
+
method: HttpMethod.GET,
|
|
54
|
+
url: `${trelloCommon.baseUrl}boards/${context.propsValue['board_id']}/cards`,
|
|
55
|
+
headers: { Accept: 'application/json' },
|
|
56
|
+
queryParams: withAuthParams(context.auth, params),
|
|
57
|
+
};
|
|
58
|
+
const response = await httpClient.sendRequest<
|
|
59
|
+
Array<Record<string, unknown>>
|
|
60
|
+
>(request);
|
|
61
|
+
const cards = response.body ?? [];
|
|
62
|
+
return { cards, count: cards.length };
|
|
63
|
+
} catch (error: any) {
|
|
64
|
+
rethrowTrelloError(
|
|
65
|
+
error,
|
|
66
|
+
'Board not found. Verify the board_id (resolve it via List Boards).'
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { listCardsInListActionOutputSchema } from '../../output-schemas';
|
|
12
|
+
|
|
13
|
+
export const listCardsInList = createAction({
|
|
14
|
+
auth: trelloAuth,
|
|
15
|
+
name: 'list_cards_in_list',
|
|
16
|
+
displayName: 'List Cards In List (Agent)',
|
|
17
|
+
description: 'List all cards in a Trello list.',
|
|
18
|
+
audience: 'ai',
|
|
19
|
+
outputSchema: listCardsInListActionOutputSchema,
|
|
20
|
+
aiMetadata: {
|
|
21
|
+
description:
|
|
22
|
+
'Lists the cards in a single Trello list identified by list_id, returning each card id and fields. Use it to enumerate the cards of a column (e.g. "what is in To Do"). Obtain list_id from List Lists. Read-only and idempotent.',
|
|
23
|
+
idempotent: true,
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
list_id: Property.ShortText({
|
|
27
|
+
displayName: 'List ID',
|
|
28
|
+
description: 'The ID of the list. Obtain it from List Lists.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
filter: Property.StaticDropdown({
|
|
32
|
+
displayName: 'Filter',
|
|
33
|
+
description: 'Which cards to include.',
|
|
34
|
+
required: false,
|
|
35
|
+
options: {
|
|
36
|
+
options: [
|
|
37
|
+
{ label: 'Open', value: 'open' },
|
|
38
|
+
{ label: 'Closed (archived)', value: 'closed' },
|
|
39
|
+
{ label: 'All', value: 'all' },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
async run(context) {
|
|
46
|
+
const params: QueryParams = {};
|
|
47
|
+
if (context.propsValue['filter']) {
|
|
48
|
+
params['filter'] = context.propsValue['filter'] as string;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const request: HttpRequest = {
|
|
52
|
+
method: HttpMethod.GET,
|
|
53
|
+
url: `${trelloCommon.baseUrl}lists/${context.propsValue['list_id']}/cards`,
|
|
54
|
+
headers: { Accept: 'application/json' },
|
|
55
|
+
queryParams: withAuthParams(context.auth, params),
|
|
56
|
+
};
|
|
57
|
+
const response = await httpClient.sendRequest<
|
|
58
|
+
Array<Record<string, unknown>>
|
|
59
|
+
>(request);
|
|
60
|
+
const cards = response.body ?? [];
|
|
61
|
+
return { cards, count: cards.length };
|
|
62
|
+
} catch (error: any) {
|
|
63
|
+
rethrowTrelloError(
|
|
64
|
+
error,
|
|
65
|
+
'List not found. Verify the list_id (resolve it via List Lists).'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { listListsActionOutputSchema } from '../../output-schemas';
|
|
12
|
+
|
|
13
|
+
export const listLists = createAction({
|
|
14
|
+
auth: trelloAuth,
|
|
15
|
+
name: 'list_lists',
|
|
16
|
+
displayName: 'List Lists (Agent)',
|
|
17
|
+
description: 'List the lists (columns) on a Trello board.',
|
|
18
|
+
audience: 'ai',
|
|
19
|
+
outputSchema: listListsActionOutputSchema,
|
|
20
|
+
aiMetadata: {
|
|
21
|
+
description:
|
|
22
|
+
'Lists the lists (columns) on a Trello board, returning each list id and name. This is the key resolver for turning a column name into a list_id used by Create Card, Move Card, and other list actions. 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
|
+
filter: Property.StaticDropdown({
|
|
32
|
+
displayName: 'Filter',
|
|
33
|
+
description: 'Which lists to include.',
|
|
34
|
+
required: false,
|
|
35
|
+
options: {
|
|
36
|
+
options: [
|
|
37
|
+
{ label: 'Open', value: 'open' },
|
|
38
|
+
{ label: 'Closed (archived)', value: 'closed' },
|
|
39
|
+
{ label: 'All', value: 'all' },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
async run(context) {
|
|
46
|
+
const params: QueryParams = {};
|
|
47
|
+
if (context.propsValue['filter']) {
|
|
48
|
+
params['filter'] = context.propsValue['filter'] as string;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const request: HttpRequest = {
|
|
52
|
+
method: HttpMethod.GET,
|
|
53
|
+
url: `${trelloCommon.baseUrl}boards/${context.propsValue['board_id']}/lists`,
|
|
54
|
+
headers: { Accept: 'application/json' },
|
|
55
|
+
queryParams: withAuthParams(context.auth, params),
|
|
56
|
+
};
|
|
57
|
+
const response = await httpClient.sendRequest<
|
|
58
|
+
Array<Record<string, unknown>>
|
|
59
|
+
>(request);
|
|
60
|
+
const lists = response.body ?? [];
|
|
61
|
+
return { lists, count: lists.length };
|
|
62
|
+
} catch (error: any) {
|
|
63
|
+
rethrowTrelloError(
|
|
64
|
+
error,
|
|
65
|
+
'Board not found. Verify the board_id (resolve it via List Boards).'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { listOrganizationBoardsActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const listOrganizationBoards = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'list_organization_boards',
|
|
15
|
+
displayName: 'List Organization Boards (Agent)',
|
|
16
|
+
description: 'List the boards in a Trello workspace.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: listOrganizationBoardsActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Lists the boards in a Trello workspace (organization), returning each board id and name. Use it when you have an org_id and want only that workspace\'s boards; for all boards you can access, use List Boards instead. Obtain org_id from Get My Member or List Boards. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
org_id: Property.ShortText({
|
|
26
|
+
displayName: 'Organization ID',
|
|
27
|
+
description:
|
|
28
|
+
'The workspace (organization) id. Obtain it from Get My Member or a board\'s details.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
async run(context) {
|
|
34
|
+
try {
|
|
35
|
+
const request: HttpRequest = {
|
|
36
|
+
method: HttpMethod.GET,
|
|
37
|
+
url: `${trelloCommon.baseUrl}organizations/${context.propsValue['org_id']}/boards`,
|
|
38
|
+
headers: { Accept: 'application/json' },
|
|
39
|
+
queryParams: withAuthParams(context.auth),
|
|
40
|
+
};
|
|
41
|
+
const response = await httpClient.sendRequest<
|
|
42
|
+
Array<Record<string, unknown>>
|
|
43
|
+
>(request);
|
|
44
|
+
const boards = response.body ?? [];
|
|
45
|
+
return { boards, count: boards.length };
|
|
46
|
+
} catch (error: any) {
|
|
47
|
+
rethrowTrelloError(
|
|
48
|
+
error,
|
|
49
|
+
'Organization not found. Verify the org_id.'
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
|
|
11
|
+
export const moveAllCardsInList = createAction({
|
|
12
|
+
auth: trelloAuth,
|
|
13
|
+
name: 'move_all_cards_in_list',
|
|
14
|
+
displayName: 'Move All Cards In List (Agent)',
|
|
15
|
+
description: 'Move every card from one Trello list to another.',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
aiMetadata: {
|
|
18
|
+
description:
|
|
19
|
+
'Moves every card from a source list to a destination list (e.g. clear a "Done" column into an "Archive" list). Obtain board_id from List Boards and both list ids from List Lists; the destination list must be on the given board. This is a bulk mutation, so it is not idempotent.',
|
|
20
|
+
idempotent: false,
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
list_id: Property.ShortText({
|
|
24
|
+
displayName: 'Source List ID',
|
|
25
|
+
description: 'The list to move all cards from. Obtain it from List Lists.',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
board_id: Property.ShortText({
|
|
29
|
+
displayName: 'Destination Board ID',
|
|
30
|
+
description:
|
|
31
|
+
'The board the destination list belongs to. Obtain it from List Boards.',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
destination_list_id: Property.ShortText({
|
|
35
|
+
displayName: 'Destination List ID',
|
|
36
|
+
description: 'The list to move all cards into. Obtain it from List Lists.',
|
|
37
|
+
required: true,
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
async run(context) {
|
|
42
|
+
try {
|
|
43
|
+
const request: HttpRequest = {
|
|
44
|
+
method: HttpMethod.POST,
|
|
45
|
+
url: `${trelloCommon.baseUrl}lists/${context.propsValue['list_id']}/moveAllCards`,
|
|
46
|
+
headers: { Accept: 'application/json' },
|
|
47
|
+
queryParams: withAuthParams(context.auth, {
|
|
48
|
+
idBoard: context.propsValue['board_id'],
|
|
49
|
+
idList: context.propsValue['destination_list_id'],
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
const response = await httpClient.sendRequest(request);
|
|
53
|
+
return response.body;
|
|
54
|
+
} catch (error: any) {
|
|
55
|
+
rethrowTrelloError(
|
|
56
|
+
error,
|
|
57
|
+
'A list or board was not found. Verify the source list_id, destination board_id, and destination list_id.'
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { moveCardActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const moveCard = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'move_card',
|
|
15
|
+
displayName: 'Move Card (Agent)',
|
|
16
|
+
description: 'Move a Trello card to a different list.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: moveCardActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Moves a Trello card to a different list (the high-intent single-purpose alternative to Update Card). Obtain card_id from Search Cards and the destination list_id from List Lists. Moving to the list it is already in converges to the same state, so it is idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
card_id: Property.ShortText({
|
|
26
|
+
displayName: 'Card ID',
|
|
27
|
+
description: 'The ID of the card to move. Obtain it from Search Cards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
list_id: Property.ShortText({
|
|
31
|
+
displayName: 'Destination List ID',
|
|
32
|
+
description:
|
|
33
|
+
'The list to move the card into. Obtain it from List Lists.',
|
|
34
|
+
required: true,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async run(context) {
|
|
39
|
+
try {
|
|
40
|
+
const request: HttpRequest = {
|
|
41
|
+
method: HttpMethod.PUT,
|
|
42
|
+
url: `${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/idList`,
|
|
43
|
+
headers: { Accept: 'application/json' },
|
|
44
|
+
queryParams: withAuthParams(context.auth, {
|
|
45
|
+
value: context.propsValue['list_id'],
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
const response = await httpClient.sendRequest(request);
|
|
49
|
+
return response.body;
|
|
50
|
+
} catch (error: any) {
|
|
51
|
+
rethrowTrelloError(
|
|
52
|
+
error,
|
|
53
|
+
'Card or list not found. Verify the card_id and list_id (resolve via Search Cards / List Lists).'
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
|
|
11
|
+
export const removeLabelFromCard = createAction({
|
|
12
|
+
auth: trelloAuth,
|
|
13
|
+
name: 'remove_label_from_card',
|
|
14
|
+
displayName: 'Remove Label From Card (Agent)',
|
|
15
|
+
description: 'Detach a label from a Trello card.',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
aiMetadata: {
|
|
18
|
+
description:
|
|
19
|
+
'Detaches a label from a Trello card. Obtain card_id from Search Cards and label_id from Get Card or List Board Labels. Removing an already-absent label converges to the same state, so it is idempotent.',
|
|
20
|
+
idempotent: true,
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
card_id: Property.ShortText({
|
|
24
|
+
displayName: 'Card ID',
|
|
25
|
+
description: 'The ID of the card. Obtain it from Search Cards.',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
label_id: Property.ShortText({
|
|
29
|
+
displayName: 'Label ID',
|
|
30
|
+
description:
|
|
31
|
+
'The label id to detach. Obtain it from Get Card or List Board Labels.',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
async run(context) {
|
|
37
|
+
try {
|
|
38
|
+
const request: HttpRequest = {
|
|
39
|
+
method: HttpMethod.DELETE,
|
|
40
|
+
url: `${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/idLabels/${context.propsValue['label_id']}`,
|
|
41
|
+
headers: { Accept: 'application/json' },
|
|
42
|
+
queryParams: withAuthParams(context.auth),
|
|
43
|
+
};
|
|
44
|
+
const response = await httpClient.sendRequest(request);
|
|
45
|
+
return response.body;
|
|
46
|
+
} catch (error: any) {
|
|
47
|
+
rethrowTrelloError(
|
|
48
|
+
error,
|
|
49
|
+
'Card or label not found. Verify the card_id and label_id.'
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { removeMemberFromCardActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const removeMemberFromCard = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'remove_member_from_card',
|
|
15
|
+
displayName: 'Remove Member From Card (Agent)',
|
|
16
|
+
description: 'Unassign a member from a Trello card.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: removeMemberFromCardActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Unassigns a member from a Trello card. Obtain card_id from Search Cards and member_id from List Card Members. Removing an already-absent member converges to the same state, so it is 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
|
+
member_id: Property.ShortText({
|
|
31
|
+
displayName: 'Member ID',
|
|
32
|
+
description:
|
|
33
|
+
'The member id to unassign. Obtain it from List Card Members.',
|
|
34
|
+
required: true,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async run(context) {
|
|
39
|
+
try {
|
|
40
|
+
const request: HttpRequest = {
|
|
41
|
+
method: HttpMethod.DELETE,
|
|
42
|
+
url: `${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/idMembers/${context.propsValue['member_id']}`,
|
|
43
|
+
headers: { Accept: 'application/json' },
|
|
44
|
+
queryParams: withAuthParams(context.auth),
|
|
45
|
+
};
|
|
46
|
+
const response = await httpClient.sendRequest(request);
|
|
47
|
+
return response.body;
|
|
48
|
+
} catch (error: any) {
|
|
49
|
+
rethrowTrelloError(
|
|
50
|
+
error,
|
|
51
|
+
'Card or member not found. Verify the card_id and member_id.'
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { renameListActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const renameList = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'rename_list',
|
|
15
|
+
displayName: 'Rename List (Agent)',
|
|
16
|
+
description: 'Rename a Trello list.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: renameListActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Renames a Trello list identified by list_id. Obtain list_id from List Lists. Setting the same name again converges to the same list, so it is 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
|
+
name: Property.ShortText({
|
|
31
|
+
displayName: 'New Name',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
async run(context) {
|
|
37
|
+
try {
|
|
38
|
+
const request: HttpRequest = {
|
|
39
|
+
method: HttpMethod.PUT,
|
|
40
|
+
url: `${trelloCommon.baseUrl}lists/${context.propsValue['list_id']}/name`,
|
|
41
|
+
headers: { Accept: 'application/json' },
|
|
42
|
+
queryParams: withAuthParams(context.auth, {
|
|
43
|
+
value: context.propsValue['name'],
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
const response = await httpClient.sendRequest(request);
|
|
47
|
+
return response.body;
|
|
48
|
+
} catch (error: any) {
|
|
49
|
+
rethrowTrelloError(
|
|
50
|
+
error,
|
|
51
|
+
'List not found. Verify the list_id (resolve it via List Lists).'
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
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 { searchCardsActionOutputSchema } from '../../output-schemas';
|
|
11
|
+
|
|
12
|
+
export const searchCards = createAction({
|
|
13
|
+
auth: trelloAuth,
|
|
14
|
+
name: 'search_cards',
|
|
15
|
+
displayName: 'Search Cards (Agent)',
|
|
16
|
+
description: 'Full-text search for Trello cards.',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
outputSchema: searchCardsActionOutputSchema,
|
|
19
|
+
aiMetadata: {
|
|
20
|
+
description:
|
|
21
|
+
'Searches Trello cards by free-text query (name, description, comments) and returns matching cards with their ids. This is the primary way to resolve a card from text before acting on it; results are best-effort/eventually-consistent, so hydrate full fields via Get Card. Optionally narrow to specific boards or a list. Read-only and idempotent.',
|
|
22
|
+
idempotent: true,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
query: Property.ShortText({
|
|
26
|
+
displayName: 'Query',
|
|
27
|
+
description: 'The search text to match against cards.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
board_ids: Property.Array({
|
|
31
|
+
displayName: 'Board IDs',
|
|
32
|
+
description:
|
|
33
|
+
'Restrict the search to these board ids (obtain from List Boards). Leave empty to search all boards you can access.',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
list_id: Property.ShortText({
|
|
37
|
+
displayName: 'List ID',
|
|
38
|
+
description: 'Restrict the search to a single list id.',
|
|
39
|
+
required: false,
|
|
40
|
+
}),
|
|
41
|
+
limit: Property.Number({
|
|
42
|
+
displayName: 'Limit',
|
|
43
|
+
description: 'Maximum number of cards to return (1-1000, default 50).',
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
async run(context) {
|
|
49
|
+
const qs: QueryParams = {
|
|
50
|
+
query: context.propsValue['query'],
|
|
51
|
+
modelTypes: 'cards',
|
|
52
|
+
key: context.auth.username,
|
|
53
|
+
token: context.auth.password,
|
|
54
|
+
};
|
|
55
|
+
const boardIds = context.propsValue['board_ids'] as string[] | undefined;
|
|
56
|
+
if (boardIds && boardIds.length > 0) {
|
|
57
|
+
qs['idBoards'] = boardIds.join(',');
|
|
58
|
+
}
|
|
59
|
+
if (context.propsValue['list_id']) {
|
|
60
|
+
qs['idList'] = context.propsValue['list_id'] as string;
|
|
61
|
+
}
|
|
62
|
+
if (context.propsValue['limit']) {
|
|
63
|
+
qs['cards_limit'] = String(context.propsValue['limit']);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
const request: HttpRequest = {
|
|
68
|
+
method: HttpMethod.GET,
|
|
69
|
+
url: `${trelloCommon.baseUrl}search`,
|
|
70
|
+
headers: { Accept: 'application/json' },
|
|
71
|
+
queryParams: qs,
|
|
72
|
+
};
|
|
73
|
+
const response = await httpClient.sendRequest<{
|
|
74
|
+
cards?: Array<Record<string, unknown>>;
|
|
75
|
+
}>(request);
|
|
76
|
+
const cards = response.body.cards ?? [];
|
|
77
|
+
return { cards, count: cards.length };
|
|
78
|
+
} catch (error: any) {
|
|
79
|
+
const status = error?.response?.status;
|
|
80
|
+
if (status === 401 || status === 403) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
'Permission denied searching cards. Check the connection token.'
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (status === 429) {
|
|
86
|
+
throw new Error('Trello rate limit exceeded. Retry after a short delay.');
|
|
87
|
+
}
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
});
|