Skip to content

Commit

Permalink
Merge pull request #20 from bhushankumarl/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Bhushankumar L authored Feb 9, 2020
2 parents 6ee0de7 + 4035015 commit d75b166
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 17 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
0.0.8
- Upgrade library to latest version.
- Search boards using the custom fields
- Add Custom Fields Method in Board API & Card API

0.0.7 December 29, 2018
- Add support for the cards filters
- Make the test cases runnable properly

0.0.6 June 06, 2018
- Added documentation for example
- Added basic test cases
Expand Down
20 changes: 20 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ declare class TrelloBoard {

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

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

}

declare class TrelloCard {
Expand All @@ -42,6 +44,8 @@ declare class TrelloCard {

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

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

}

declare class TrelloChecklist {
Expand All @@ -58,6 +62,21 @@ declare class TrelloChecklist {

}

declare class TrelloCustomField {

create(params: any): Promise<any>;

search(customFieldId: string): Promise<any>;

searchField(customFieldId: string, fieldName: string): Promise<any>;

update(customFieldId: string, params: any): Promise<any>;

del(customFieldId: string): Promise<any>;

}


declare class TrelloEnterprise {

search(enterpriseID: string): Promise<any>;
Expand Down Expand Up @@ -151,6 +170,7 @@ declare class TrelloNodeApi {
board: TrelloBoard;
card: TrelloCard;
checklist: TrelloChecklist;
customField: TrelloCustomField;
enterprise: TrelloEnterprise;
label: TrelloLabel;
list: TrelloList;
Expand Down
11 changes: 9 additions & 2 deletions lib/resources/Boards.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ module.exports = TrelloResource.extend({
searchCards: trelloMethod({
method: 'GET',
path: '/{id}/cards',
urlParams: ['id']
urlParams: [ 'id' ]
}),

searchCardsFilter: trelloMethod({
method: 'GET',
path: '/{id}/cards/{filter}',
urlParams: ['id', 'filter']
urlParams: [ 'id', 'filter' ]
}),

getCustomField: trelloMethod({
method: 'GET',
path: '/{id}/customFields',
urlParams: [ 'id' ]
})

});
9 changes: 8 additions & 1 deletion lib/resources/Cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ module.exports = TrelloResource.extend({
path: 'cards',
includeBasic: [
'create', 'search', 'searchField', 'update', 'del'
]
],


setCustomField: trelloMethod({
method: 'PUT',
path: '/{idCard}/customField/{idCustomField}/item',
urlParams: [ 'idCard', 'idCustomField' ]
})

});
12 changes: 12 additions & 0 deletions lib/resources/CustomField.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

var TrelloResource = require('../TrelloResource');
var trelloMethod = TrelloResource.method;

module.exports = TrelloResource.extend({
path: 'customfields',
includeBasic: [
'create', 'search', 'searchField', 'update', 'del'
]

});
1 change: 1 addition & 0 deletions lib/trello-node-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var resources = {
Board: require('./resources/Boards'),
Card: require('./resources/Cards'),
Checklist: require('./resources/Checklists'),
CustomField: require('./resources/CustomField'),
Enterprise: require('./resources/Enterprises'),
Label: require('./resources/Labels'),
List: require('./resources/Lists'),
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trello-node-api",
"version": "0.0.7",
"version": "0.0.8",
"description": "Trello Node API wrapper",
"keywords": [
"node-trello",
Expand Down Expand Up @@ -40,24 +40,25 @@
},
"main": "lib/trello-node-api",
"dependencies": {
"bluebird": "^3.5.0",
"debug": "^4.1.0",
"bluebird": "^3.7.2",
"debug": "^4.1.1",
"lodash.isplainobject": "^4.0.6",
"qs": "~6.5.1",
"safe-buffer": "^5.1.1"
"qs": "~6.9.1",
"safe-buffer": "^5.2.0"
},
"devDependencies": {
"@types/chai": "^4.0.10",
"@types/mocha": "^2.2.44",
"chai": "^4.1.2",
"@types/chai": "^4.2.8",
"@types/mocha": "^7.0.1",
"@types/node": "^13.7.0",
"chai": "^4.2.0",
"chai-as-promised": "~7.1.1",
"mocha": "^4.0.1",
"ts-node": "^4.0.1",
"typescript": "^2.6.2"
"mocha": "^7.0.1",
"ts-node": "^8.6.2",
"typescript": "^3.7.5"
},
"license": "MIT",
"scripts": {
"lint": "tsc index.d.ts",
"test.mocha": "npm run lint; mocha -r ts-node/register test/**/*.spec.ts"
}
}
}
File renamed without changes.
3 changes: 2 additions & 1 deletion test/resources/Board.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {CONFIG} from '../intialize';
import { CONFIG } from '../initialize';
// @ts-ignore
import * as TrelloNodeAPI from '../../lib/trello-node-api';

import * as chai from 'chai';
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"target": "es5"
"target": "es5",
"lib": [
"es2015"
],
"types": [
"mocha",
"node"
]
},
"rootDirs": [
"src",
Expand Down

0 comments on commit d75b166

Please sign in to comment.