Skip to content

Commit

Permalink
Merge pull request #21 from bhushankumarl/development
Browse files Browse the repository at this point in the history
Added New Search Methods in Boards API & Cards API
  • Loading branch information
Bhushankumar L authored Feb 9, 2020
2 parents d75b166 + 07bb2fa commit fd0397c
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
46 changes: 45 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,23 @@ declare class TrelloBoard {

searchCardsFilter(boardId: string, filter: string): Promise<any>;

getCustomField(customFieldId: string): Promise<any>;
searchChecklists(boardId: string): Promise<any>;

searchCustomField(boardId: string): Promise<any>;

searchLabels(boardId: string): Promise<any>;

searchLists(boardId: string): Promise<any>;

searchListsFilter(boardId: string, filter: string): Promise<any>;

searchMembers(boardId: string): Promise<any>;

searchMemberships(boardId: string): Promise<any>;

searchPlugins(boardId: string): Promise<any>;

searchCardsByCardId(boardId: string, cardId: string): Promise<any>;

}

Expand All @@ -46,6 +62,34 @@ declare class TrelloCard {

setCustomField(cardId: string, customFieldId: string): Promise<any>;

searchActions(cardId: string): Promise<any>;

searchAttachments(cardId: string): Promise<any>;

searchAttachmentByAttachmentId(cardId: string, attachmentId: string): Promise<any>;

searchBoard(cardId: string): Promise<any>;

searchCheckItemStates(cardId: string): Promise<any>;

searchChecklists(cardId: string): Promise<any>;

searchCheckItemByCheckItemId(cardId: string, checkItemId: string): Promise<any>;

searchCustomFieldItems(cardId: string): Promise<any>;

searchList(cardId: string): Promise<any>;

searchMembers(cardId: string): Promise<any>;

searchMembersVoted(cardId: string): Promise<any>;

searchPluginData(cardId: string): Promise<any>;

searchStickers(cardId: string): Promise<any>;

searchStickersByStickerId(cardId: string, stickerId: string): Promise<any>;

}

declare class TrelloChecklist {
Expand Down
50 changes: 49 additions & 1 deletion lib/resources/Boards.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]
})

});
85 changes: 84 additions & 1 deletion lib/resources/Cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]
})

});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trello-node-api",
"version": "0.0.8",
"version": "0.0.9",
"description": "Trello Node API wrapper",
"keywords": [
"node-trello",
Expand Down

0 comments on commit fd0397c

Please sign in to comment.