diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f44f9b..567575c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +0.0.9 + - Added New Search Methods in Boards API & Cards API + 0.0.8 - Upgrade library to latest version. - Search boards using the custom fields diff --git a/index.d.ts b/index.d.ts index 56ced8a..aa3103a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -28,7 +28,23 @@ declare class TrelloBoard { searchCardsFilter(boardId: string, filter: string): Promise; - getCustomField(customFieldId: string): Promise; + searchChecklists(boardId: string): Promise; + + searchCustomField(boardId: string): Promise; + + searchLabels(boardId: string): Promise; + + searchLists(boardId: string): Promise; + + searchListsFilter(boardId: string, filter: string): Promise; + + searchMembers(boardId: string): Promise; + + searchMemberships(boardId: string): Promise; + + searchPlugins(boardId: string): Promise; + + searchCardsByCardId(boardId: string, cardId: string): Promise; } @@ -46,6 +62,34 @@ declare class TrelloCard { setCustomField(cardId: string, customFieldId: string): Promise; + searchActions(cardId: string): Promise; + + searchAttachments(cardId: string): Promise; + + searchAttachmentByAttachmentId(cardId: string, attachmentId: string): Promise; + + searchBoard(cardId: string): Promise; + + searchCheckItemStates(cardId: string): Promise; + + searchChecklists(cardId: string): Promise; + + searchCheckItemByCheckItemId(cardId: string, checkItemId: string): Promise; + + searchCustomFieldItems(cardId: string): Promise; + + searchList(cardId: string): Promise; + + searchMembers(cardId: string): Promise; + + searchMembersVoted(cardId: string): Promise; + + searchPluginData(cardId: string): Promise; + + searchStickers(cardId: string): Promise; + + searchStickersByStickerId(cardId: string, stickerId: string): Promise; + } declare class TrelloChecklist { diff --git a/lib/resources/Boards.js b/lib/resources/Boards.js index c3b96ff..3e39fc5 100644 --- a/lib/resources/Boards.js +++ b/lib/resources/Boards.js @@ -22,10 +22,58 @@ module.exports = TrelloResource.extend({ urlParams: [ 'id', 'filter' ] }), - getCustomField: trelloMethod({ + searchChecklists: trelloMethod({ + method: 'GET', + path: '/{id}/checklists', + urlParams: [ 'id' ] + }), + + searchCustomField: trelloMethod({ method: 'GET', path: '/{id}/customFields', urlParams: [ 'id' ] + }), + + searchLabels: trelloMethod({ + method: 'GET', + path: '/{id}/customLabels', + urlParams: [ 'id' ] + }), + + searchLists: trelloMethod({ + method: 'GET', + path: '/{id}/lists', + urlParams: [ 'id' ] + }), + + searchListsFilter: trelloMethod({ + method: 'GET', + path: '/{id}/lists/{filter}', + urlParams: [ 'id', 'filter' ] + }), + + searchMembers: trelloMethod({ + method: 'GET', + path: '/{id}/members', + urlParams: [ 'id' ] + }), + + searchMemberships: trelloMethod({ + method: 'GET', + path: '/{id}/memberships', + urlParams: [ 'id' ] + }), + + searchPlugins: trelloMethod({ + method: 'GET', + path: '/{id}/plugins', + urlParams: [ 'id' ] + }), + + searchCardsByCardId: trelloMethod({ + method: 'GET', + path: '/{id}/cards/{idCard}', + urlParams: [ 'id', 'idCard' ] }) }); \ No newline at end of file diff --git a/lib/resources/Cards.js b/lib/resources/Cards.js index 810d942..adb0667 100644 --- a/lib/resources/Cards.js +++ b/lib/resources/Cards.js @@ -10,11 +10,94 @@ module.exports = TrelloResource.extend({ 'create', 'search', 'searchField', 'update', 'del' ], - setCustomField: trelloMethod({ method: 'PUT', path: '/{idCard}/customField/{idCustomField}/item', urlParams: [ 'idCard', 'idCustomField' ] + }), + + searchActions: trelloMethod({ + method: 'GET', + path: '/{id}/actions', + urlParams: [ 'id' ] + }), + + searchAttachments: trelloMethod({ + method: 'GET', + path: '/{id}/attachments', + urlParams: [ 'id' ] + }), + + searchAttachmentByAttachmentId: trelloMethod({ + method: 'GET', + path: '/{id}/attachments/{idAttachment}', + urlParams: [ 'id', 'idAttachment' ] + }), + + searchBoard: trelloMethod({ + method: 'GET', + path: '/{id}/board', + urlParams: [ 'id' ] + }), + + searchCheckItemStates: trelloMethod({ + method: 'GET', + path: '/{id}/checkItemStates', + urlParams: [ 'id' ] + }), + + searchChecklists: trelloMethod({ + method: 'GET', + path: '/{id}/checklists', + urlParams: [ 'id' ] + }), + + searchCheckItemByCheckItemId: trelloMethod({ + method: 'GET', + path: '/{id}/checkItem/{idCheckItem}', + urlParams: [ 'id', 'idCheckItem' ] + }), + + searchCustomFieldItems: trelloMethod({ + method: 'GET', + path: '/{id}/customFieldItems', + urlParams: [ 'id' ] + }), + + searchList: trelloMethod({ + method: 'GET', + path: '/{id}/list', + urlParams: [ 'id' ] + }), + + searchMembers: trelloMethod({ + method: 'GET', + path: '/{id}/members', + urlParams: [ 'id' ] + }), + + searchMembersVoted: trelloMethod({ + method: 'GET', + path: '/{id}/membersVoted', + urlParams: [ 'id' ] + }), + + searchPluginData: trelloMethod({ + method: 'GET', + path: '/{id}/pluginData', + urlParams: [ 'id' ] + }), + + searchStickers: trelloMethod({ + method: 'GET', + path: '/{id}/stickers', + urlParams: [ 'id' ] + }), + + searchStickersByStickerId: trelloMethod({ + method: 'GET', + path: '/{id}/stickers/{idSticker}', + urlParams: [ 'id' ] }) }); diff --git a/package.json b/package.json index edee215..7e79f00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trello-node-api", - "version": "0.0.8", + "version": "0.0.9", "description": "Trello Node API wrapper", "keywords": [ "node-trello",