burrito-trello
Advanced tools
Comparing version 0.1.6 to 0.1.8
@@ -7,4 +7,4 @@ const Interface = require('./Interface'); | ||
const methods = { | ||
info: () => this.get(`/tokens/${idToken}`), | ||
member: () => this.get(`/tokens/${idToken}/member`) | ||
info: (params = {}) => this.get(`/tokens/${idToken}`, params), | ||
member: (params = {}) => this.get(`/tokens/${idToken}/member`, params) | ||
}; | ||
@@ -19,6 +19,6 @@ return methods; | ||
this.get(`/boards/${idBoard}/cards${idCardOrFilter ? `/${idCardOrFilter}` : ''}`), | ||
info: (field = false) => this.get(`/boards/${idBoard}${field ? `/${field}` : ''}`), | ||
labels: () => this.get(`/boards/${idBoard}/labels`), | ||
lists: (filter = false) => this.get(`/boards/${idBoard}/lists${filter ? `/${filter}` : ''}`), | ||
members: () => this.get(`/boards/${idBoard}/members`), | ||
info: (field = false, params = {}) => this.get(`/boards/${idBoard}${field ? `/${field}` : ''}`, params), | ||
labels: (params = {}) => this.get(`/boards/${idBoard}/labels`, params), | ||
lists: (filter = false, params = {}) => this.get(`/boards/${idBoard}/lists${filter ? `/${filter}` : ''}`, params), | ||
members: (params = {}) => this.get(`/boards/${idBoard}/members`, params), | ||
memberships: (params = {}) => this.get(`/boards/${idBoard}/memberships`, params) | ||
@@ -31,5 +31,5 @@ }; | ||
const methods = { | ||
info: (field = false) => this.get(`/lists/${idList}${field ? `/${field}` : ''}`), | ||
info: (field = false, params = {}) => this.get(`/lists/${idList}${field ? `/${field}` : ''}`, params), | ||
actions: () => this.get(`/lists/${idList}/actions`), | ||
board: () => this.get(`/lists/${idList}/board`), | ||
board: (params = {}) => this.get(`/lists/${idList}/board`, params), | ||
cards: () => this.get(`/lists/${idList}/cards`) | ||
@@ -43,10 +43,11 @@ }; | ||
actions: (params = {}) => this.get(`/cards/${idCard}/actions`, params), | ||
attachments: (idAttachment = false) => | ||
this.get(`/cards/${idCard}/attachments${idAttachment ? `/${idAttachment}` : ''}`), | ||
board: () => this.get(`/cards/${idCard}/board`), | ||
info: (field = false) => this.get(`/cards/${idCard}${field ? `/${field}` : ''}`), | ||
list: () => this.get(`/cards/${idCard}/list`), | ||
members: () => this.get(`/cards/${idCard}/members`), | ||
attachments: (idAttachment = false, params = {}) => | ||
this.get(`/cards/${idCard}/attachments${idAttachment ? `/${idAttachment}` : ''}`, params), | ||
board: (params) => this.get(`/cards/${idCard}/board`, params), | ||
info: (field = false, params = {}) => this.get(`/cards/${idCard}${field ? `/${field}` : ''}`, params), | ||
list: (params = {}) => this.get(`/cards/${idCard}/list`, params), | ||
members: (params = {}) => this.get(`/cards/${idCard}/members`, params), | ||
comments: () => this.get(`/cards/${idCard}/actions`, { filter: 'commentCard' }), | ||
addComment: comment => this.post(`/cards/${idCard}/actions/comments`, { text: comment }), | ||
removeComment: idAction => this.delete(`/cards/${idCard}/actions/${idAction}/comments`), | ||
addMember: idMember => this.post(`/cards/${idCard}/idMembers`, { value: idMember }), | ||
@@ -62,6 +63,6 @@ removeMember: idMember => this.delete(`/cards/${idCard}/idMembers/${idMember}`) | ||
actions: () => this.get(`/members/${idMember}/actions`), | ||
boards: () => this.get(`/members/${idMember}/boards`), | ||
cards: () => this.get(`/members/${idMember}/cards`), | ||
boards: (params = {}) => this.get(`/members/${idMember}/boards`, params), | ||
cards: (params = {}) => this.get(`/members/${idMember}/cards`, params), | ||
notifications: (params = {}) => this.get(`/members/${idMember}/notifications`, params), | ||
organizations: () => this.get(`/members/${idMember}/organizations`) | ||
organizations: (params = {}) => this.get(`/members/${idMember}/organizations`, params) | ||
}; | ||
@@ -68,0 +69,0 @@ return methods; |
@@ -6,14 +6,16 @@ const Interface = require('./Interface'); | ||
if (config) { | ||
config.key = this.trelloKey; | ||
config.callback_method = !config.callback_method ? 'fragment' : config.callback_method; | ||
if(!config.name) | ||
const settings = config; | ||
settings.key = this.trelloKey; | ||
settings.callback_method = !settings.callback_method ? 'fragment' : settings.callback_method; | ||
if(!settings.name) | ||
throw Error('TrelloAuthToken URL requires an application name.'); | ||
if(!config.return_url) | ||
if(!settings.return_url) | ||
throw Error('TrelloAuthToken URL requires a return URL.'); | ||
if(!config.expiration) | ||
if(!settings.expiration) | ||
throw Error('TrelloAuthToken URL requires an expiration.'); | ||
if(config.scope === undefined || config.scope.length < 1) | ||
if(settings.scope === undefined || settings.scope.length < 1) | ||
throw Error('TrelloAuthToken URL requires a scope setting.'); | ||
return `https://trello.com/1/authorize${this.queryParams(config, false)}`; | ||
return `https://trello.com/1/authorize${this.queryParams(settings, false)}`; | ||
} | ||
return config; | ||
} | ||
@@ -20,0 +22,0 @@ } |
{ | ||
"name": "burrito-trello", | ||
"version": "0.1.6", | ||
"version": "0.1.8", | ||
"description": "A better Trello API for node and the browser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93160
12
216