0.0.4 • Published 10 years ago

clarizen v0.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

Node-Clarizen

Note: This project is currently in development. It is not complete or tested.

An easy to use nodeJS wrapper on the Clarizen REST API.

Example

var Clarizen = require('clarizen');

// create a new clarizen service
var clarizen = new Clarizen();

// log in on the service
clarizen.login({username: 'user@domain.com', password: 'userpass'}, function (data) {
	
	// then do something with the API
	clarizen.find('Task')
		.select('name dueDate')
		.exec(function (err, data) {
			if (err) throw err;
			console.log(JSON.stringify(data));
		});
});

Functions

login(credentials, callback)

Finds the correct Clarizen server for the account, logs in using the supplied credentials, and stores the returned session information. Anything called on a Clarizen object after it has been successfully logged in will use this stored user session.

find(datatype)

This call should begin a chain of calls that end with an exec function similar to a Mongoose query.

populate(data, fields, subfields, callback)

note: Alternative syntax is populate(data, fields, callback) where fields is an object with fieldNames as keys and subfield arrays as their values.

Expands the data object with information from the objects it references. For example, if you want to include the name of the parent project to a task in the task's object, you would call populate on it with the field being "parentProject" and the subfield being "name".

get(id, fields, callback)

Gets an object where id is the Clarizen entity id and fields are the required fields.

update(id, data, callback)

Updates an object on Clarizen where id is the entity id and data contains just the keys and values to update.

delete(id, callback)

Deletes an object from Clarizen where id is the entity id of the object.

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago