This module provide a wrapper to the Asana API for nodeJS applications.
Ultimately, a support in the browser, using node-browserify is also planned.
Asana = require "asana"
asana = new Asana
key : "deadbeef"
asana.user.fetch
success : -> ...
error : -> ...
users = new asana.Users
users.fetch
error : -> ...
success : ->
workspaces = new asana.Workspaces
workspaces.fetch
error : -> ...
successs : ->
workspace = workspaces.first
task = new asana.Task
assignee : users.find (user) ->
user.get("name") == "John Difool"
followers : [user]
name : "Protect the Incal"
workspace : workspace
task.save
error : -> ...
success : -> ...
- Base reference: Asana API
- All asana items are backbone models. You can fetch and save them as is usually done with backbone models. However, asana API does not allow to create or save some items.
- Backbone models support ID map and modelize as provided by backbone.modelizer
- All asana attributes are stored as model attributes. Creation arguments are those documented in the Asana API.
- It is possible to pass models or IDs as attributes values.
- Items structure is:
asana = new Asana key : asanaKey
:asana.user
: Current asana userasana.Users
: Collection of all known usersasana.Stories
: Collection of all storiesasna.Workspace
: Basic model for asana workspacesasana.Workspaces
: Collection of all asana workspacesasana.Project
: Basic model for asana projectsproject.workspace
: Workpace forproject
asana.Projects
: Collection of all asana projectsasana.Task
: Base task modelasana.Tasks
: Collection of available tasks.task = new asana.Task params
:task.Story
: Basic model to create a new story attached totask
task.assignee
: User assigned totask
task.followers
: Collection of users followingtask
task.stories
: Collection of all stories attached totask
task.projects
: Collection of all projects to whichtask
belongs
You can use your own copy of Backbone
by passing it as an option
when instanciating asana
's client:
asana = new Asana
key : "deadbeef"
Backbone : myBackbone