Skip to content

Commit f0d069a

Browse files
author
Bhushankumar L
authored
Merge pull request #8 from bhushankumarl/development
Development
2 parents 96c2559 + 0d91717 commit f0d069a

26 files changed

+729
-62
lines changed

README.md

Lines changed: 607 additions & 3 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 boardId = 'BOARD_ID';
8+
var field = 'shortUrl';
9+
Trello.board.searchField(boardId, field).then(function (response) {
10+
console.log('response ', response);
11+
}).catch(function (error) {
12+
console.log('error', error);
13+
});
14+
};
15+
16+
boardRequest();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 = async function () {
7+
const promises = [];
8+
const boardIds = ['BOARD_ID_1', 'BOARD_ID_2'];
9+
10+
boardIds.forEach((boardId) => {
11+
promises.push(Trello.board.search(boardId));
12+
});
13+
14+
try {
15+
const boards = await Promise.all(promises);
16+
console.log('boards ', boards);
17+
} catch (error) {
18+
console.error('[trello]', error);
19+
}
20+
};
21+
22+
boardRequest();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 boardId = 'BOARD_ID';
8+
var fields = {
9+
actions: 'all'
10+
};
11+
Trello.board.search(boardId, fields).then(function (response) {
12+
console.log('response ', response);
13+
}).catch(function (error) {
14+
console.log('error', error);
15+
});
16+
};
17+
18+
boardRequest();

examples/javascript/members/searchMemberBoards.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var oauthToken = process.env.TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN';
44
var Trello = require('../../../lib/trello-node-api')(apiKey, oauthToken);
55

66
var memberRequest = function () {
7-
Trello.member.searchBoards('MEMBER_ID').then(function (response) {
7+
Trello.member.searchBoards('me').then(function (response) {
88
console.log('response ', response);
99
}).catch(function (error) {
1010
console.log('error', error);

examples/typescript/src/checklists/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let checklistRequest = async function () {
1414
};
1515
let response;
1616
try {
17-
response = await Trello.checklist.update(id, data)
17+
response = await Trello.checklist.update(id, data);
1818
} catch (error) {
1919
if (error) {
2020
console.log('error ', error);

examples/typescript/src/organizations/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let organizationRequest = async function () {
1515
};
1616
let response;
1717
try {
18-
response = await Trello.organization.create(data)
18+
response = await Trello.organization.create(data);
1919
} catch (error) {
2020
if (error) {
2121
console.log('error ', error);

lib/Error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var TrelloError = _Error.TrelloError = _Error.extend({
4343
//this.headers = raw.headers;
4444
//this.requestId = raw.requestId;
4545
this.statusCode = raw.statusCode;
46-
},
46+
}
4747
});
4848

4949
/**

lib/TrelloMethod.basic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module.exports = {
6767
} else {
6868
// Set entire metadata object after resetting it:
6969
this._request('POST', path, {
70-
metadata: null,
70+
metadata: null
7171
}, auth, {}, function (err, response) {
7272
if (err) {
7373
return reject(err);
@@ -78,7 +78,7 @@ module.exports = {
7878

7979
function sendMetadata(metadata, auth) {
8080
self._request('POST', path, {
81-
metadata: metadata,
81+
metadata: metadata
8282
}, auth, {}, function (err, response) {
8383
if (err) {
8484
reject(err);
@@ -108,6 +108,6 @@ module.exports = {
108108
}
109109
});
110110
}).bind(this)), cb);
111-
},
111+
}
112112

113113
};

lib/TrelloMethod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ function trelloMethod(spec) {
2323
var requestMethod = (spec.method || 'GET').toUpperCase();
2424
var urlParams = spec.urlParams || [];
2525
var encode = spec.encode || function (data) {
26-
return data;
27-
};
26+
return data;
27+
};
2828

2929
return function () {
3030
var self = this;

0 commit comments

Comments
 (0)