UNPKG

@edicarlos.lds/businessmap-mcp

Version:

Model Context Protocol server for BusinessMap (Kanbanize) integration

162 lines 5.14 kB
import { BaseClientModuleImpl } from './base-client.js'; export class CardClient extends BaseClientModuleImpl { /** * Get cards from a board with optional filters */ async getCards(boardId, filters) { const params = { board_id: boardId, ...filters }; const response = await this.http.get('/cards', { params }); return response.data.data; } /** * Get a specific card by ID */ async getCard(cardId) { const response = await this.http.get(`/cards/${cardId}`); return response.data.data; } /** * Create a new card */ async createCard(params) { this.checkReadOnlyMode('create card'); const response = await this.http.post('/cards', params); return response.data.data; } /** * Update an existing card */ async updateCard(params) { this.checkReadOnlyMode('update card'); const { card_id, ...updateData } = params; const response = await this.http.patch(`/cards/${card_id}`, updateData); return response.data.data; } /** * Move a card to a different column or lane */ async moveCard(cardId, columnId, laneId, position) { this.checkReadOnlyMode('move card'); const response = await this.http.patch(`/cards/${cardId}`, { column_id: columnId, lane_id: laneId, position: position, }); return response.data.data; } /** * Delete a card */ async deleteCard(cardId) { this.checkReadOnlyMode('delete card'); await this.http.delete(`/cards/${cardId}`); } /** * Get comments for a specific card */ async getCardComments(cardId) { const response = await this.http.get(`/cards/${cardId}/comments`); return response.data.data; } /** * Get details of a specific comment */ async getCardComment(cardId, commentId) { const response = await this.http.get(`/cards/${cardId}/comments/${commentId}`); return response.data.data; } /** * Get custom fields for a specific card */ async getCardCustomFields(cardId) { const response = await this.http.get(`/cards/${cardId}/customFields`); return response.data.data; } /** * Get all card types */ async getCardTypes() { const response = await this.http.get('/cardTypes'); return response.data.data; } /** * Get card outcome history */ async getCardHistory(cardId, outcomeId) { const response = await this.http.get(`/cards/${cardId}/outcomes/${outcomeId}/history`); return response.data.data; } /** * Get card outcomes */ async getCardOutcomes(cardId) { const response = await this.http.get(`/cards/${cardId}/outcomes`); return response.data.data; } /** * Get linked cards for a specific card */ async getCardLinkedCards(cardId) { const response = await this.http.get(`/cards/${cardId}/linkedCards`); return response.data.data; } /** * Get subtasks for a specific card */ async getCardSubtasks(cardId) { const response = await this.http.get(`/cards/${cardId}/subtasks`); return response.data.data; } /** * Get details of a specific subtask */ async getCardSubtask(cardId, subtaskId) { const response = await this.http.get(`/cards/${cardId}/subtasks/${subtaskId}`); return response.data.data; } /** * Create a new subtask for a card */ async createCardSubtask(cardId, params) { this.checkReadOnlyMode('create subtask'); const response = await this.http.post(`/cards/${cardId}/subtasks`, params); return response.data.data; } /** * Get parent cards for a specific card */ async getCardParents(cardId) { const response = await this.http.get(`/cards/${cardId}/parents`); return response.data.data; } /** * Check if a card is a parent of a given card */ async getCardParent(cardId, parentCardId) { const response = await this.http.get(`/cards/${cardId}/parents/${parentCardId}`); return response.data.data; } /** * Make a card a parent of a given card */ async addCardParent(cardId, parentCardId) { this.checkReadOnlyMode('add card parent'); const response = await this.http.put(`/cards/${cardId}/parents/${parentCardId}`); return response.data.data; } /** * Remove the link between a child card and a parent card */ async removeCardParent(cardId, parentCardId) { this.checkReadOnlyMode('remove card parent'); await this.http.delete(`/cards/${cardId}/parents/${parentCardId}`); } /** * Get parent graph for a specific card (including parent's parents) */ async getCardParentGraph(cardId) { const response = await this.http.get(`/cards/${cardId}/parentGraph`); return response.data.data; } } //# sourceMappingURL=card-client.js.map