walkie-talkie
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -266,4 +266,3 @@ var request = require("request"); | ||
"Authorization": sign(), | ||
"Accept": "application/json", | ||
"Content-type": "application/json" | ||
"Accept": "application/json" | ||
} | ||
@@ -274,11 +273,53 @@ }; | ||
if(e) { | ||
console.dir('event create failed with error: ' + JSON.stringify(e)); | ||
console.dir('counts get failed with error: ' + JSON.stringify(e)); | ||
cb(null, null, null); | ||
} else { | ||
cb(r.statusCode, body); | ||
cb(r.statusCode, JSON.parse(body)); | ||
} | ||
}); | ||
} | ||
}, | ||
segments: { | ||
get_all: function(cb) { | ||
var args = { | ||
"method": "GET", | ||
"url": gen_api_url("segments"), | ||
"headers": { | ||
"Authorization": sign(), | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return request(args, function(e, r, body) { | ||
if(e) { | ||
console.dir('segments get all failed with error: ' + JSON.stringify(e)); | ||
cb(null, null, null); | ||
} else { | ||
cb(r.statusCode, JSON.parse(body)); | ||
} | ||
}); | ||
}, | ||
get: function(segment_id, cb) { | ||
var args = { | ||
"method": "GET", | ||
"url": gen_api_url("segments/" + segment_id), | ||
"headers": { | ||
"Authorization": sign(), | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return request(args, function(e, r, body) { | ||
if(e) { | ||
console.dir('segments get failed with error: ' + JSON.stringify(e)); | ||
cb(null, null, null); | ||
} else { | ||
cb(r.statusCode, JSON.parse(body)); | ||
} | ||
}); | ||
} | ||
} | ||
}; | ||
}; |
{ | ||
"name": "walkie-talkie", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "An Intercom.io interface for nodejs", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -12,3 +12,3 @@ var config = require('./config.json'); | ||
expect(body.type).to.equal('count.hash'); | ||
// console.dir(body); | ||
// console.dir(body.type); | ||
done(); | ||
@@ -15,0 +15,0 @@ }); |
23978
12
533