Skip to content

Commit d75b166

Browse files
author
Bhushankumar L
authored
Merge pull request #20 from bhushankumarl/development
Development
2 parents 6ee0de7 + 4035015 commit d75b166

File tree

10 files changed

+82
-17
lines changed

10 files changed

+82
-17
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
0.0.8
2+
- Upgrade library to latest version.
3+
- Search boards using the custom fields
4+
- Add Custom Fields Method in Board API & Card API
5+
6+
0.0.7 December 29, 2018
7+
- Add support for the cards filters
8+
- Make the test cases runnable properly
9+
110
0.0.6 June 06, 2018
211
- Added documentation for example
312
- Added basic test cases

index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ declare class TrelloBoard {
2828

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

31+
getCustomField(customFieldId: string): Promise<any>;
32+
3133
}
3234

3335
declare class TrelloCard {
@@ -42,6 +44,8 @@ declare class TrelloCard {
4244

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

47+
setCustomField(cardId: string, customFieldId: string): Promise<any>;
48+
4549
}
4650

4751
declare class TrelloChecklist {
@@ -58,6 +62,21 @@ declare class TrelloChecklist {
5862

5963
}
6064

65+
declare class TrelloCustomField {
66+
67+
create(params: any): Promise<any>;
68+
69+
search(customFieldId: string): Promise<any>;
70+
71+
searchField(customFieldId: string, fieldName: string): Promise<any>;
72+
73+
update(customFieldId: string, params: any): Promise<any>;
74+
75+
del(customFieldId: string): Promise<any>;
76+
77+
}
78+
79+
6180
declare class TrelloEnterprise {
6281

6382
search(enterpriseID: string): Promise<any>;
@@ -151,6 +170,7 @@ declare class TrelloNodeApi {
151170
board: TrelloBoard;
152171
card: TrelloCard;
153172
checklist: TrelloChecklist;
173+
customField: TrelloCustomField;
154174
enterprise: TrelloEnterprise;
155175
label: TrelloLabel;
156176
list: TrelloList;

lib/resources/Boards.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,19 @@ module.exports = TrelloResource.extend({
1313
searchCards: trelloMethod({
1414
method: 'GET',
1515
path: '/{id}/cards',
16-
urlParams: ['id']
16+
urlParams: [ 'id' ]
1717
}),
1818

1919
searchCardsFilter: trelloMethod({
2020
method: 'GET',
2121
path: '/{id}/cards/{filter}',
22-
urlParams: ['id', 'filter']
22+
urlParams: [ 'id', 'filter' ]
23+
}),
24+
25+
getCustomField: trelloMethod({
26+
method: 'GET',
27+
path: '/{id}/customFields',
28+
urlParams: [ 'id' ]
2329
})
30+
2431
});

lib/resources/Cards.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ module.exports = TrelloResource.extend({
88
path: 'cards',
99
includeBasic: [
1010
'create', 'search', 'searchField', 'update', 'del'
11-
]
11+
],
12+
13+
14+
setCustomField: trelloMethod({
15+
method: 'PUT',
16+
path: '/{idCard}/customField/{idCustomField}/item',
17+
urlParams: [ 'idCard', 'idCustomField' ]
18+
})
1219

1320
});

lib/resources/CustomField.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
var TrelloResource = require('../TrelloResource');
4+
var trelloMethod = TrelloResource.method;
5+
6+
module.exports = TrelloResource.extend({
7+
path: 'customfields',
8+
includeBasic: [
9+
'create', 'search', 'searchField', 'update', 'del'
10+
]
11+
12+
});

lib/trello-node-api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var resources = {
3131
Board: require('./resources/Boards'),
3232
Card: require('./resources/Cards'),
3333
Checklist: require('./resources/Checklists'),
34+
CustomField: require('./resources/CustomField'),
3435
Enterprise: require('./resources/Enterprises'),
3536
Label: require('./resources/Labels'),
3637
List: require('./resources/Lists'),

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trello-node-api",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Trello Node API wrapper",
55
"keywords": [
66
"node-trello",
@@ -40,24 +40,25 @@
4040
},
4141
"main": "lib/trello-node-api",
4242
"dependencies": {
43-
"bluebird": "^3.5.0",
44-
"debug": "^4.1.0",
43+
"bluebird": "^3.7.2",
44+
"debug": "^4.1.1",
4545
"lodash.isplainobject": "^4.0.6",
46-
"qs": "~6.5.1",
47-
"safe-buffer": "^5.1.1"
46+
"qs": "~6.9.1",
47+
"safe-buffer": "^5.2.0"
4848
},
4949
"devDependencies": {
50-
"@types/chai": "^4.0.10",
51-
"@types/mocha": "^2.2.44",
52-
"chai": "^4.1.2",
50+
"@types/chai": "^4.2.8",
51+
"@types/mocha": "^7.0.1",
52+
"@types/node": "^13.7.0",
53+
"chai": "^4.2.0",
5354
"chai-as-promised": "~7.1.1",
54-
"mocha": "^4.0.1",
55-
"ts-node": "^4.0.1",
56-
"typescript": "^2.6.2"
55+
"mocha": "^7.0.1",
56+
"ts-node": "^8.6.2",
57+
"typescript": "^3.7.5"
5758
},
5859
"license": "MIT",
5960
"scripts": {
6061
"lint": "tsc index.d.ts",
6162
"test.mocha": "npm run lint; mocha -r ts-node/register test/**/*.spec.ts"
6263
}
63-
}
64+
}

test/resources/Board.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {CONFIG} from '../intialize';
1+
import { CONFIG } from '../initialize';
2+
// @ts-ignore
23
import * as TrelloNodeAPI from '../../lib/trello-node-api';
34

45
import * as chai from 'chai';

tsconfig.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
"module": "commonjs",
1414
"moduleResolution": "node",
1515
"outDir": "dist",
16-
"target": "es5"
16+
"target": "es5",
17+
"lib": [
18+
"es2015"
19+
],
20+
"types": [
21+
"mocha",
22+
"node"
23+
]
1724
},
1825
"rootDirs": [
1926
"src",

0 commit comments

Comments
 (0)