TAAB is a tool to use Trello like a NoSQL back-end by using Boards as the databases, Lists as tables and Cards as rows. I imagine this is useful for creating customised Trello workflows which will be contextualised when accessing through your own interface, yet viewable by all through Trello itself. Feel free to fork & contribute. My progress can be tracked at this Trello board: https://trello.com/b/KqOzXTWL/taab-roadmap. Feel free to request for access!
Please note that this project is not ready for use till 1.0.0. The roadmap is not clearly defined yet either, but the end-goal of this project should look like the following code snippet:
const TAAB = require('taab');
const taab = TAAB.init(TRELLO_API_DEVELOPER_KEY, TRELLO_TOKEN);
const myProject = taab.db('my_project');
// create `sub_project` list
myProject.create('sub_project', { ... });
// gets reference for `sub_project` list
myProject.ref('sub_project');
// gets details for `sub_project` list
myProject.ref('sub_project').info();
// get all cards from `sub_project` list
myProject.getAll('sub_project');
// get all cards from `sub_project` list satisfying
myProject.getAllWhere('sub_project', { ...CONDITIONS });
// get card from `sub_project` list with ID `:id`
myProject.get('sub_project', { id: ... });
// update card from `sub_project` list with ID `:id`
myProject.update('sub_project', { id: ... }, { ... });
// delete card from `sub_project` list with ID `:id`
myProject.del('sub_project', { id: ... });
// move card from `sub_project` list with ID `:id` to `done_sub_project` list
myProject.move(
myProject.get(`sub_project`, { id: ... }),
myProject.ref('done_sub_project')
);
- Get your Trello Developer API Key from https://trello.com/app-key
- Obtain a personal development Token from https://trello.com/1/authorize?expiration=never&scope=read,write,account&response_type=token&name=Server%20Token&key=``
- You should now have a Developer API Key and a personal Token
Install TAAB by npm
or yarn
:
#> npm install taab
## /or/
#> yarn add taab
Initialize the module:
const taab = require('taab');
const taabInstance = taab.init(TRELLO_DEVELOPER_API_KEY, TRELLO_PERSONAL_TOKEN);
Get started by using taabInstance
!
:apiKey
:token
The Developer API Key obtained from https://trello.com/app-key
Your personal development token obtained from https://trello.com/1/authorize?expiration=never&scope=read,write,account&response_type=token&name=Server%20Token&key=``
Creates a Board
:options
: hash optionally containing the following keys:name
=taabConst.defaults.boardName
defaultLabels
=false
defaultLists
=false
desc
=taabConst.defaults.boardDescription
idOrganization
idBoardSource
keepFromSource
='all'
powerUps
prefs_permissionLevel
prefs_voting
prefs_comments
prefs_invitations
prefs_selfJoin
prefs_cardCovers
prefs_background
=taabConst.defaults.backgroundColor
prefs_cardAging
taabInstance.createBoard({})
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/advanced-reference/board#post-1-boards
Retrieves the board identified by :boardId
.
:options
: hash containing the following keys:boardId
: ID of board requiredactions
boardStars
cards
card_pluginData
checklists
fields
labels
lists
members
memberships
membersInvited
membersInvited_fields
pluginData
organization
organization_pluginData
myPrefs
taabInstance.getBoard({boardId: 'BOARD_ID'})
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#boardsboardid-1
Retrieves all boards belonging to yourself.
None.
taabInstance.getBoards()
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#membersidboards
Closes the board specified by ID :boardId
:options
: hash containing keys as follows::boardId
: ID of board to close
taabInstance.deleteBoard({boardId: 'BOARD_ID'})
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#idnext
Creates a Card
:options
: hash containing the following keys:name
=taabConst.defaults.cardName
desc
=taabConst.defaults.cardDescription
pos
='top'
due
dueComplete
idList
idMembers
idLabels
urlSource
fileSource
idCardSource
keepFromSource
taabInstance.createList({})
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/advanced-reference/card#post-1-cards
Retrieves a card given a :cardId
.
:options
: hashcardId
: requiredfields
actions
attachments
attachment_fields
members
member_fields
membersVoted
memberVoted_fields
checkItemStates
checklists
checklist_fields
board
board_fields
list
pluginData
stickers
sticker_fields
taabInstance.getCard({
cardId: '1234abcdeTEST',
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#cardsid
Retrievs all cards belonging to yourself.
:options
: hash optionally containing the following keys:actions
attachments
attachment_fields
stickers
members
member_fields
checkItemStates
checklists
limit
since
before
filter
fields
taabInstance.getAllCards()
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/advanced-reference/member#get-1-members-idmember-or-username-cards
Retrieves all cards belonging to a board.
:options
: hash containing the following properties:boardId
: requiredfields
taabInstance.getBoardCards({
boardId: '93CstY3zuTest'
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#listsidboard
Retrieves all cards belonging to a list.
:options
: hash containing the following properties:listId
requiredfields
taabInstance.getListCards({
listId: '93CstY3zuTest'
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#listsidcards
Creates a List
:options
: hash optionally containing the following keys:name
=taabConst.defaults.listName
idBoard
idListSource
pos
taabInstance.createList({})
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/advanced-reference/list#post-1-lists
Closes a List
:options
: hash of argumentslistId
*required
taabInstance.deleteList({
listId: '1234567890abced',
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#listsid-1
Retrieves all lists from a board
:options
: hashidBoard
required
taabInstance.getBoardLists({
boardId: '93DquTrsTEST'
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#boardsboardidlists
:options
: hashlistId
requiredfields
taabInstance.getList({
listId: '8faASd938DS13w'
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#listsid
Retrieves a member given a Trello user ID
:memberId
: Trello ID of the member
taabInstance.getMember({
memberId: '3892e8asd7ea8bc231'
}).then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#membersid
Retrieves your own profile.
None
taabInstance.getProfile()
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
Retrieves your organisations.
None
taabInstance.getOrganizations()
.then((results) => { console.info(results); })
.catch((error) => { console.error(error); });
https://developers.trello.com/v1.0/reference#membersidorganizations
Verifies that the correct key/token was provided to the instance.
None
taabInstance.verify()
.then(() => { console.info('success'); })
.catch((error) => { console.error('error'); });
- Fork this repository
- See Trello board @ https://trello.com/b/KqOzXTWL/taab-roadmap
- Pick an item from the Feature List and move it to Work In Progress
- Make your changes/additions
- If reasonable to do so, squash your commits with
git rebase HEAD~<N>
whereN
is the number of commits in your change/addition (makes it easier to see what was changed). - Run
npm run eslint
- Run
npm test
- Merge into your
master
branch and create a Merge Request - On passing of the pipeline on Travis, I'll merge it in
To run the examples, execute the following command:
#> npm start
☐ Add changes to ./lib/*.js
☐ Add relevant tests into ./test
☐ Add example usage in ./examples
☐ Change README.md to reflect modifications
☐ Bump minor version number for non-breaking changes
☐ Bump major version number ofr breaking changes
We follow semver
which means:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards-compatible manner, and
- PATCH version when you make backwards-compatible bug fixes.
Apply the appropriate changes to package.json
when you contribute
- Remember to update the readme if adding new APIs
- Add it to the changelog below as well for the next version. Ie if the current version is 1.0.0 when you make the change, list it under 1.0.
Published 0.9.0
➕ instance.deleteList()
Published 0.8.1
➕ instance.getList()
Published 0.7.1
➕ instance.deleteBoard()
➕ instance.getBoard()
Published 0.6.0
➕ instance.getCard()
Published 0.5.2
Added examples (use
npm start
to run the basic example)
➕instance.getCards()instance.getAllCards()
➕ instance.getBoardCards()
➕ instance.getListCards()
➕ instance.getBoardLists()
➕ instance.createBoard()
Published 0.3.0.
➕ instance.verify()
➕ instance.createCard()
➕ instance.createList()
Published 0.2.0.
➕ static.init()
➕ instance.getMember()
➕ instance.getProfile()
➕ instance.getBoards()
➕ instance.getOrganisations()
➕ instance.getOrganizations()
➕ instance.getCards()