Skip to content

Commit c685b51

Browse files
author
Bhushankumar L
authored
Merge pull request #4 from bhushankumarl/development
Development
2 parents bbe66e7 + 3c1cc02 commit c685b51

File tree

8 files changed

+105
-6
lines changed

8 files changed

+105
-6
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: node_js
22
node_js:
3-
- "0.12"
43
- "4"
54
- "5"
65
- "6"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.0.6 June 06, 2018
2+
- Added documentation for example
3+
- Added basic test cases
4+
15
0.0.5 December 06, 2017
26
- Bug fix
37

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ $ npm install trello-node-api --save
1212

1313
## Debugging
1414

15-
Run the DEBUG:
16-
1715
```bash
1816
$ export DEBUG=TA:*
1917
```
@@ -30,6 +28,30 @@ var trelloNode = require('trello-node-api')(apiKey, oauthToken);
3028

3129
##### It does supports EcmaScript 5, EcmaScript 6, TypeScript, async-await, Promises, Callback !
3230

31+
## Examples
32+
33+
#### [Actions](https://github.com/bhushankumarl/trello-node-api/wiki/Actions-TypeScript)
34+
35+
#### [Boards](https://github.com/bhushankumarl/trello-node-api/wiki/Boards-TypeScript)
36+
37+
#### [Cards](https://github.com/bhushankumarl/trello-node-api/wiki/Cards-TypeScript)
38+
39+
#### [Checklists](https://github.com/bhushankumarl/trello-node-api/wiki/Checklists-TypeScript)
40+
41+
#### [Enterprises](https://github.com/bhushankumarl/trello-node-api/wiki/Enterprises-TypeScript)
42+
43+
#### [Labels](https://github.com/bhushankumarl/trello-node-api/wiki/Labels-TypeScript)
44+
45+
#### [Lists](https://github.com/bhushankumarl/trello-node-api/wiki/Lists-TypeScript)
46+
47+
#### [Members](https://github.com/bhushankumarl/trello-node-api/wiki/Members-TypeScript)
48+
49+
#### [Notifications](https://github.com/bhushankumarl/trello-node-api/wiki/Notifications-TypeScript)
50+
51+
#### [Organizations](https://github.com/bhushankumarl/trello-node-api/wiki/Organizations-TypeScript)
52+
53+
#### [Webhooks](https://github.com/bhushankumarl/trello-node-api/wiki/Webhooks-TypeScript)
54+
3355
##### Please Feel free to create Issue for any help !
3456

3557
Originally by [Bhushankumar Lilapara](https://github.com/bhushankumarl) (bhushankumar.lilapara@gmail.com).

examples/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"@types/es6-promise": "0.0.33",
99
"babel-eslint": "^8.0.1",
1010
"babel-preset-node6": "^11.0.0",
11-
"trello-node-api": "^0.0.4"
11+
"trello-node-api": "*"
1212
},
1313
"devDependencies": {}
1414
}

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trello-node-api",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "Trello Node API wrapper",
55
"keywords": [
66
"node-trello",
@@ -45,8 +45,18 @@
4545
"qs": "~6.5.1",
4646
"safe-buffer": "^5.1.1"
4747
},
48+
"devDependencies": {
49+
"@types/chai": "^4.0.10",
50+
"@types/mocha": "^2.2.44",
51+
"chai": "^4.1.2",
52+
"chai-as-promised": "~7.1.1",
53+
"mocha": "^4.0.1",
54+
"ts-node": "^4.0.1",
55+
"typescript": "^2.6.2"
56+
},
4857
"license": "MIT",
4958
"scripts": {
50-
"lint": "tsc index.d.ts"
59+
"lint": "tsc index.d.ts",
60+
"test.mocha": "npm run lint; mocha -r ts-node/register test/**/*.spec.ts"
5161
}
5262
}

test/mocha.opts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--bail
2+
--recursive

test/resources/Board.spec.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
2+
const oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
4+
import * as TrelloNodeAPI from 'trello-node-api';
5+
6+
const Trello = new TrelloNodeAPI();
7+
Trello.setApiKey(apiKey);
8+
Trello.setOauthToken(oauthToken);
9+
import {mocha} from 'mocha'
10+
/* tslint:disable:no-string-literal */
11+
describe('Board', () => {
12+
13+
it('It should create the Board', async () => {
14+
let data = {
15+
name: 'BOARD_NAME_1', // REQUIRED
16+
defaultLabels: false,
17+
defaultLists: false,
18+
desc: 'Board description.',
19+
idOrganization: 'ORGANIZATION_ID',
20+
keepFromSource: 'none',
21+
powerUps: 'all',
22+
prefs_permissionLevel: 'private',
23+
prefs_voting: 'disabled',
24+
prefs_comments: 'members',
25+
prefs_invitations: 'members',
26+
prefs_selfJoin: true,
27+
prefs_cardCovers: true,
28+
prefs_background: 'blue',
29+
prefs_cardAging: 'regular'
30+
};
31+
let response = await Trello.board.create(data).catch(error => {
32+
if (error) {
33+
console.log('error ', error);
34+
return;
35+
}
36+
});
37+
console.log('response', response);
38+
});
39+
40+
});

tsconfig.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"inlineSources": true,
5+
"noImplicitAny": true,
6+
"noImplicitReturns": true,
7+
"noImplicitThis": true,
8+
"noUnusedParameters": true,
9+
"noUnusedLocals": true,
10+
"removeComments": true,
11+
"strictNullChecks": true,
12+
"sourceMap": true,
13+
"module": "commonjs",
14+
"moduleResolution": "node",
15+
"outDir": "dist",
16+
"target": "es5"
17+
},
18+
"rootDirs": [
19+
"src",
20+
"test"
21+
]
22+
}

0 commit comments

Comments
 (0)