Skip to content

Commit 993e18f

Browse files
author
Bhushankumar Lilapara
authored
Merge pull request #1 from bhushankumarl/development
Development
2 parents f306b67 + a510ffd commit 993e18f

File tree

14 files changed

+229
-38
lines changed

14 files changed

+229
-38
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
node_js:
3+
- "0.12"
4+
- "4"
5+
- "5"
6+
- "6"
7+
- "7"
8+
- "8"
9+
sudo: false

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
0.0.3 December 02, 2017
2+
- Add support for TypeScript
3+
- Add JavaScript examples
4+
- Add TypeScript examples
5+
- Add travis CI
6+
17
0.0.2 October 15, 2017
28
- Add details to the README.MD
39

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
2+
var oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
4+
var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
5+
6+
var boardRequest = function () {
7+
var data = {
8+
name: 'BOARD',
9+
defaultLabels: false,
10+
defaultLists: false,
11+
desc: 'Board description.',
12+
idOrganization: 'BOARD123456789',
13+
idBoardSource: 'BOARD123456789',
14+
keepFromSource: 'none',
15+
powerUps: 'all',
16+
prefs_permissionLevel: 'private',
17+
prefs_voting: 'disabled',
18+
prefs_comments: 'members',
19+
prefs_invitations: 'members',
20+
prefs_selfJoin: true,
21+
prefs_cardCovers: true,
22+
prefs_background: 'blue',
23+
prefs_cardAging: 'regular'
24+
};
25+
Trello.board.create(data).then(function (response) {
26+
console.log('response ', response);
27+
}).catch(function (error) {
28+
console.log('error', error);
29+
});
30+
};
31+
32+
boardRequest();
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
2+
var oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
4+
var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
5+
6+
var boardRequest = function () {
7+
var id = 'BOARD_ID';
8+
Trello.board.del(id).then(function (response) {
9+
console.log('response ', response);
10+
}).catch(function (error) {
11+
console.log('error', error);
12+
});
13+
};
14+
15+
boardRequest();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
2+
var oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
4+
var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
5+
6+
var boardRequest = function () {
7+
Trello.board.search('BOARD_ID').then(function (response) {
8+
console.log('response ', response);
9+
}).catch(function (error) {
10+
console.log('error', error);
11+
});
12+
};
13+
14+
boardRequest();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
2+
var oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
4+
var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
5+
6+
var boardRequest = function () {
7+
Trello.board.searchField('BOARD_ID', 'FIELD_NAME').then(function (response) {
8+
console.log('response ', response);
9+
}).catch(function (error) {
10+
console.log('error', error);
11+
});
12+
};
13+
14+
boardRequest();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
2+
var oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
4+
var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
5+
6+
var boardRequest = function () {
7+
var id = 'BOARD_ID';
8+
var data = {name: 'BOARD'};
9+
10+
Trello.board.update(id, data).then(function (response) {
11+
console.log('response ', response);
12+
}).catch(function (error) {
13+
console.log('error', error);
14+
});
15+
};
16+
17+
boardRequest();

examples/package.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

examples/typescript/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock = false

examples/boards/search.js renamed to examples/typescript/boards/search.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
const apiKey = process.env.TRELLO_API_KEY || 'YOUR_API_KEY';
22
const oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
3+
import * as TrelloNodeAPI from 'trello-node-api';
34

4-
let trelloNode = require('../../lib/trello-node-api')(apiKey, oauthToken);
5+
const Trello = new TrelloNodeAPI();
56

67
let boardRequest = async function () {
7-
let response = await trelloNode.board.search('ABCD').catch(error => {
8+
Trello.setApiKey(apiKey);
9+
Trello.setOauthToken(oauthToken);
10+
let response = await Trello.board.search('ABCD').catch(error => {
811
if (error) {
912
console.log('error ', error);
1013
}

0 commit comments

Comments
 (0)