Announcing Force.com Tooling API for Node.js (nforce)

nforce-toolingOver Christmas break I stared playing around with the Force.com Tooling API in node.js. We have some ideas over at topcoder for the Tooling API and I wanted to build a POC to see how crazy I was.

After a couple of days I started to realize how cool the Tooling API could be and the development impact it could make. I've always been big fan and user of Kevin O'Hara's nforce package so I emailed him to see if he would be interested in including it in nforce. After a few emails we decided to go the Passport route and implement the new functionality with plugins that could be developed and maintained independently and not "muddy-up" the core nforce package. Brilliant! My guess is that there are more plugins coming down the road for nforce ;).

So while Kevin essentially rewrote nforce (added plugin functionality, improved performance, simpler signatures, etc), I worked on the nforce-tooling plugin. I did most of the work while on my vacation in Jamaica (you can only lay around in the sun drinking daiquiris for so long!) and finally release version 0.0.1 this morning.

Github repo: https://github.com/jeffdonthemic/nforce-tooling

Like anything else with Salesforce.com, it's a work in progress as the Tooling API revs. I'll be adding more features as they become available but please send me any issues or pull requests. I'll be writing a few tutorials in the near future but for some sample code see the mocha tests. See the github readme for complete info.

The 0.0.1 plugin supports the following functionality:

createContainer() - Creates a container as a package for your workspace that manages working copies of Tooling objects, including collections of objects that should be deployed together.

getContainer() - Returns a container.

addContainerArtifact() - Adds an artifact to the container for deployment. The artifact object links the container, to the saved copy of the object (e.g., ApexClass), to the working copy of the object (e.g., ApexClassMember) for deployment.

deployContainer() - Compiles and deploys a container.

getContainerDeployStatus() - Returns the deploy status of a container.

deleteContainer() - Deletes a container.

getObjects() - Returns a collection of available Tooling API objects and their metadata.

getObject() - Returns the individual metadata for a specified object.

getRecord() - Returns high-level metadata for a specific object. For more detailed metadata, use getDescribe().

getDescribe() - Returns detailed metadata at all levels for a specified object.

getCustomField() - Returns the metadata on a custom field for a custom object. Includes access to the associated CustomField object in Salesforce Metadata API.

query() - Executes a query against a Tooling API object and returns data that matches the specified criteria.

insert() - Creates a new Tooling API object.

update() - Updates a Tooling API object with the specified data.

delete() - Deletes a Tooling API object.

executeAnonymous() - Executes some Apex code anonymously and returns the results.

getApexLog() - Returns a raw debug log.