Skip to content

Commit b53fe84

Browse files
author
Bhushankumar Lilapara
authored
Merge pull request #2 from bhushankumarl/development
Development
2 parents 993e18f + 79d3fca commit b53fe84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1670
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.0.4 December 06, 2017
2+
- Add JavaScript examples : Card, Action, Labels, Webhook etc
3+
- Add TypeScript examples : Boards, Card, Action, Labels, Webhook etc
4+
15
0.0.3 December 02, 2017
26
- Add support for TypeScript
37
- Add JavaScript examples

LICENSE

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
Copyright (C) 2017 Bhushankumar Lilapara
1+
Copyright (C) 2017 Bhushankumar Lilapara
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# trello-node-api (Trello REST API)
2+
[![Build Status](https://travis-ci.org/bhushankumarl/trello-node-api.svg?branch=master)](https://travis-ci.org/bhushankumarl/trello-node-api)
23

34
This API supported Trello's standard REST-style API that accepts/returns JSON requests and Here is the [API reference] (https://developers.trello.com/v1.0/reference)
45

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 actionRequest = function () {
7+
Trello.action.del('ACTION_ID').then(function (response) {
8+
console.log('response ', response);
9+
}).catch(function (error) {
10+
console.log('error', error);
11+
});
12+
};
13+
14+
actionRequest();
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 actionRequest = function () {
7+
Trello.action.search('ACTION_ID').then(function (response) {
8+
console.log('response ', response);
9+
}).catch(function (error) {
10+
console.log('error', error);
11+
});
12+
};
13+
14+
actionRequest();
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 actionRequest = function () {
7+
Trello.action.searchField('ACTION_ID', 'FIELD_NAME').then(function (response) {
8+
console.log('response ', response);
9+
}).catch(function (error) {
10+
console.log('error', error);
11+
});
12+
};
13+
14+
actionRequest();
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 actionRequest = function () {
7+
var id = 'ACTION_ID';
8+
var data = {text: 'text'};
9+
10+
Trello.action.update(id, data).then(function (response) {
11+
console.log('response ', response);
12+
}).catch(function (error) {
13+
console.log('error', error);
14+
});
15+
};
16+
17+
actionRequest();

examples/javascript/boards/updateBoard.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,28 @@ var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
55

66
var boardRequest = function () {
77
var id = 'BOARD_ID';
8-
var data = {name: 'BOARD'};
8+
var data = {
9+
name: 'BOARD',
10+
desc: 'Board descriptions',
11+
closed: false,
12+
subscribed: false,
13+
idOrganization: '',
14+
prefs_permissionLevel: 'private',
15+
prefs_selfJoin: true,
16+
prefs_cardCovers: true,
17+
prefs_invitations: 'members',
18+
prefs_voting: 'disabled',
19+
prefs_comments: 'members',
20+
prefs_background: 'blue',
21+
prefs_cardAging: 'regular',
22+
prefs_calendarFeedEnabled: false,
23+
labelNames_green: '',
24+
labelNames_yellow: '',
25+
labelNames_orange: '',
26+
labelNames_red: '',
27+
labelNames_purple: '',
28+
labelNames_blue: ''
29+
};
930

1031
Trello.board.update(id, data).then(function (response) {
1132
console.log('response ', response);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 cardRequest = function () {
7+
var data = {
8+
name: 'CARD_NAME',
9+
desc: 'Card description',
10+
pos: 'top',
11+
idList: 'LIST_ID', //required
12+
due: false,
13+
dueComplete: false,
14+
idMembers: ['MEMBER_ID', 'MEMBER_ID', 'MEMBER_ID'],
15+
idLabels: ['LABEL_ID', 'LABEL_ID', 'LABEL_ID'],
16+
urlSource: '',
17+
fileSource: '',
18+
idCardSource: '',
19+
keepFromSource: '',
20+
};
21+
Trello.card.create(data).then(function (response) {
22+
console.log('response ', response);
23+
}).catch(function (error) {
24+
console.log('error', error);
25+
});
26+
};
27+
28+
cardRequest();
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 cardRequest = function () {
7+
var id = 'CARD_ID';
8+
Trello.card.del(id).then(function (response) {
9+
console.log('response ', response);
10+
}).catch(function (error) {
11+
console.log('error', error);
12+
});
13+
};
14+
15+
cardRequest();

0 commit comments

Comments
 (0)