Socket
Socket
Sign inDemoInstall

asana

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asana - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

bower.json

61

gulpfile.js

@@ -0,1 +1,2 @@

var browserify = require('browserify');
var gulp = require('gulp');

@@ -6,3 +7,4 @@ var istanbul = require('gulp-istanbul');

var path = require('path');
var runSequence = require('run-sequence');
var through = require('through');
var vinylSourceStream = require('vinyl-source-stream');
var wicked = require('wicked');

@@ -15,2 +17,32 @@

var replace = function(regex, replacement) {
return function() {
var data = '';
function write(buf) {
data += buf;
}
function end() {
this.queue(data.replace(regex, replacement));
this.queue(null);
}
return through(write, end);
};
};
gulp.task('browser', function() {
return browserify({
entries: [index],
standalone: 'asana'
})
.transform(
replace(/require\('request'\)/g, 'require(\'browser-request\')'))
.bundle()
.pipe(vinylSourceStream('asana.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['test']);
gulp.task('docs', function(callback) {

@@ -27,18 +59,29 @@ wicked(null, null, callback);

gulp.task('spec', function(callback) {
gulp.src([lib, index])
.pipe(istanbul())
gulp.src(lib)
.pipe(istanbul({
includeUntested: true
}))
.on('finish', function() {
gulp.src(tests)
.pipe(mocha({
reporter: 'nyan'
reporter: process.env.TRAVIS ? 'spec' : 'nyan'
}))
.pipe(istanbul.writeReports({
reporters: ['lcovonly']
reporters: ['text', 'text-summary']
}))
.on('end', callback);
.on('end', function() {
var errOrNull = null;
var coverage = istanbul.summarizeCoverage();
var incomplete = Object.keys(coverage).filter(function(key) {
return coverage[key].pct !== 100;
});
if (incomplete.length > 0) {
errOrNull = new Error(
'Incomplete coverage for ' + incomplete.join(', '));
}
callback(errOrNull);
});
});
});
gulp.task('test', function(callback) {
runSequence('lint', 'spec', callback);
});
gulp.task('test', ['browser', 'lint', 'spec']);

14

lib/dispatcher.js
var errors = require('./errors');
var Promise = require('bluebird');
var BPromise = require('bluebird');
var request = require('request');

@@ -51,7 +51,7 @@

* @param {Object} params The params for request
* @return {Promise} The response for the request
* @return {BPromise} The response for the request
*/
Dispatcher.prototype.dispatch = function(params) {
params[this.authKey] = this.authValue;
return new Promise(function(resolve, reject) {
return new BPromise(function(resolve, reject) {
request(params, function(err, res, payload) {

@@ -73,3 +73,3 @@ if (err) {

* @param {Object} [query] The query params
* @return {Promise} The response for the request
* @return {BPromise} The response for the request
*/

@@ -92,3 +92,3 @@ Dispatcher.prototype.get = function(path, query) {

* @param {Object} data The data to be sent
* @return {Promise} The response for the request
* @return {BPromise} The response for the request
*/

@@ -110,3 +110,3 @@ Dispatcher.prototype.post = function(path, data) {

* @param {Object} data The data to be sent
* @return {Promise} The response for the request
* @return {BPromise} The response for the request
*/

@@ -127,3 +127,3 @@ Dispatcher.prototype.put = function(path, data) {

* @param {String} path The path of the API
* @return {Promise} The response for the request
* @return {BPromise} The response for the request
*/

@@ -130,0 +130,0 @@ Dispatcher.prototype.delete = function(path) {

@@ -75,34 +75,2 @@ var util = require('util');

/**
* Update a task
* @param {Number} taskId The task id
* @param {Object} data The data to be sent to the workspace
* @return {Promise} The result of the API call
*/
Tasks.prototype.update = function(taskId, data) {
var path = util.format('/tasks/%d', taskId);
return this.dispatcher.put(path, data);
};
/**
* Deletes a task
* @param {Number} taskId The task id
* @return {Promise} The result of the API call
*/
Tasks.prototype.delete = function(taskId) {
var path = util.format('/tasks/%d', taskId);
return this.dispatcher.delete(path);
};
/**
* Dispatches a POST request to /tasks/:taskId/addFollowers with to add
* followers to the task.
* @param {Number} taskId The task id
* @param {Object} data The data containing the list of followers
*/
Tasks.prototype.addFollowers = function(taskId, data) {
var path = util.format('/tasks/%d/addFollowers', taskId);
return this.dispatcher.post(path, data);
};
/**
* Dispatches a POST request to /tasks/:taskId/removeFollowers with to remove

@@ -109,0 +77,0 @@ * followers from the task.

@@ -32,2 +32,13 @@ var util = require('util');

/**
* Dispatches a GET request to /workspaces/:workspaceId/typeahead to run a
* typeahead search in the specified workspace
* @type {Number} workspaceId The workspace id
* @type {Object} data The data to be sent to the workspace
*/
Workspaces.prototype.typeahead = function(workspaceId, data) {
var path = util.format('/workspaces/%d/typeahead', workspaceId);
return this.dispatcher.get(path, data);
};
module.exports = Workspaces;
{
"name": "asana",
"version": "0.3.0",
"version": "0.3.1",
"description": "A node.js client for the Asana API",

@@ -25,18 +25,20 @@ "main": "index.js",

"dependencies": {
"bluebird": "^2.1.3",
"request": "^2.36.0"
"bluebird": "^2.3.0",
"request": "^2.45.0"
},
"devDependencies": {
"browser-request": "^0.3.2",
"browserify": "^6.3.2",
"gulp": "^3.8.5",
"gulp-istanbul": "^0.2.0",
"gulp-istanbul": "^0.3.1",
"gulp-jshint": "^1.6.4",
"gulp-mocha": "^0.5.1",
"gulp-mocha": "^1.1.1",
"install": "^0.1.7",
"jshint-stylish": "^0.4.0",
"npm": "^1.4.20",
"jshint-stylish": "^1.0.0",
"rewire": "^2.0.1",
"run-sequence": "^0.3.6",
"sinon": "^1.10.2",
"through": "^2.3.6",
"vinyl-source-stream": "^1.0.0",
"wicked": "^0.3.1"
}
}

@@ -1,2 +0,2 @@

# Asana [![Build Status][travis-image]][travis-url]
# Asana [![Build Status][travis-image]][travis-url] [![NPM Version][npm-image]][npm-url]

@@ -85,4 +85,7 @@ A node.js client for the 1.0 version of the Asana API.

[travis-url]: http://travis-ci.org/Asana/node-asana
[travis-image]: http://img.shields.io/travis/Asana/node-asana.svg?style=flat
[travis-image]: http://img.shields.io/travis/Asana/node-asana.svg?style=flat-square
[npm-url]: https://www.npmjs.org/package/asana
[npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square
[bluebird]: https://github.com/petkaantonov/bluebird

@@ -89,0 +92,0 @@ [co]: https://github.com/visionmedia/co

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc