racker/node-v1

Name: node-v1

Owner: racker

Description: null

Created: 2012-01-04 17:06:52.0

Updated: 2017-06-05 17:41:30.0

Pushed: 2012-01-09 21:34:54.0

Homepage:

Size: 105

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

node-v1

node-v1 is a Node.js module that wraps the VersionOne REST Data API.

Install

npm install node-v1

Use It
var connOptions = {
    proto: 'https',
    host: 'www.v1host.com',
    port: '443',
    org: 'MYORG',
    version: 'rest-1.v1'
    user: 'myuser',
    pass: 'mypass'
};

var v1http = require('v1').v1http;
var client = new v1http.RawV1(connOptions);

// create a query.
var query = new v1http.QueryBuilder().find('my search string').findin('Name');

// only certain fields.
query = query.sel('Name,Number,Timebox,AssetState');

// filter by status.
query = query.where('Status.Name=\'Accepted\'');

// execute query against defects
client.defect(query, function(err, status, results) {
    // err is an Error object. it will be null in most cases.
    // status is an HTTP status integer.
    // results will be XML.
});

// execute the same query against tasks
client.task(query, function(err, status, results) {

    // do something interesting with the xml
    var Asset = require('v1').Asset;
    var assets = Asset.fromXml(results);
    assets.forEach(function(asset) {
        // assets have the following fields:
        // href, id, idref, attributes, relations.
        // attributes are simple string:string hashes, while
        // relations are string:asset hashes.
    });
});
TODO

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.