Trello-As-A-Backend
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 = ;const taab = TAAB;const myProject = taab; // create `sub_project` listmyProject; // gets reference for `sub_project` listmyProject; // gets details for `sub_project` listmyProject; // get all cards from `sub_project` listmyProject;// get all cards from `sub_project` list satisfyingmyProject;// get card from `sub_project` list with ID `:id`myProject; // update card from `sub_project` list with ID `:id`myProject; // delete card from `sub_project` list with ID `:id`myProject; // move card from `sub_project` list with ID `:id` to `done_sub_project` listmyProject;
Get Trello Developer Keys
- 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 Token&key=
<Trello Developer API Key>
- You should now have a Developer API Key and a personal Token
Get Started
Install TAAB by npm
or yarn
:
#> npm install taab ## /or/ #> yarn add taab
Initialize the module:
const taab = ;const taabInstance = taab;
Get started by using taabInstance
!
API Documentation
Static Methods
.init()
Arguments
:apiKey
:token
apiKey
The Developer API Key obtained from https://trello.com/app-key
token
Your personal development token obtained from https://trello.com/1/authorize?expiration=never&scope=read,write,account&response_type=token&name=Server Token&key=<Trello Developer API Key>
Instance Methods
Boards
.createBoard()
Creates a Board
Arguments
: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
Example
taabInstance ;
See More
https://developers.trello.com/advanced-reference/board#post-1-boards
.getBoard()
Retrieves the board identified by :boardId
.
Arguments
: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
Examples
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#boardsboardid-1
.getBoards()
Retrieves all boards belonging to yourself.
Arguments
None.
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#membersidboards
.deleteBoard()
Closes the board specified by ID :boardId
Arguments
:options
: hash containing keys as follows::boardId
: ID of board to close
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#idnext
Cards
.createCard()
Creates a Card
Arguments
: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
Example
taabInstance ;
See More
https://developers.trello.com/advanced-reference/card#post-1-cards
.getCard()
Retrieves a card given a :cardId
.
Arguments
: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
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#cardsid
.getAllCards()
Retrievs all cards belonging to yourself.
Arguments
:options
: hash optionally containing the following keys:actions
attachments
attachment_fields
stickers
members
member_fields
checkItemStates
checklists
limit
since
before
filter
fields
Example
taabInstance ;
See More
https://developers.trello.com/advanced-reference/member#get-1-members-idmember-or-username-cards
.getBoardCards()
Retrieves all cards belonging to a board.
Arguments
:options
: hash containing the following properties:boardId
: requiredfields
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#listsidboard
.getListCards()
Retrieves all cards belonging to a list.
Arguments
:options
: hash containing the following properties:listId
requiredfields
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#listsidcards
Lists
.createList()
Creates a List
Arguments
:options
: hash optionally containing the following keys:name
=taabConst.defaults.listName
idBoard
idListSource
pos
Example
taabInstance ;
See More
https://developers.trello.com/advanced-reference/list#post-1-lists
.getBoardLists()
Retrieves all lists from a board
Arguments
:options
: hashidBoard
required
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#boardsboardidlists
.getList()
Arguments
:options
: hashlistId
requiredfields
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#listsid
Utility
.getMember()
Retrieves a member given a Trello user ID
Arguments
:memberId
: Trello ID of the member
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#membersid
.getProfile()
Retrieves your own profile.
Arguments
None
Example
taabInstance ;
See More
.getOrganizations()
Retrieves your organisations.
Arguments
None
Example
taabInstance ;
See More
https://developers.trello.com/v1.0/reference#membersidorganizations
.verify()
Verifies that the correct key/token was provided to the instance.
Arguments
None
Example
taabInstance ;
SDLC
Process
- 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
Examples
To run the examples, execute the following command:
#> npm start
General Task Checklist
☐ 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
Versioning
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
Notes
- 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.
Changelog
23rd August 2017
Published 0.8.1
➕ instance.getList()
22nd August 2017
Published 0.7.1
➕ instance.deleteBoard()
➕ instance.getBoard()
11th August 2017
Published 0.6.0
➕ instance.getCard()
9th August 2017
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()
3rd July 2017
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()