analytics-node
Advanced tools
Comparing version 1.2.2 to 2.0.0
2.0.0 / 2015-09-21 | ||
================== | ||
* update analytics-node.js | ||
* Remove proxy support | ||
* Merge pull request #47 from yorkie/patch-1 | ||
* remove the duplicated keyword | ||
1.2.2 / 2015-03-19 | ||
@@ -3,0 +11,0 @@ ================== |
@@ -6,3 +6,2 @@ var assert = require('assert'); | ||
var request = require('superagent'); | ||
require('superagent-proxy')(request); | ||
require('superagent-retry')(request); | ||
@@ -32,3 +31,2 @@ var type = require('component-type'); | ||
* @property {String} host (default: 'https://api.segment.io') | ||
* @property {String|Object} proxy (default: null) | ||
*/ | ||
@@ -45,3 +43,2 @@ | ||
this.flushAfter = options.flushAfter || 10000; | ||
this.proxy = options.proxy || null; | ||
} | ||
@@ -152,9 +149,3 @@ | ||
var req = request | ||
.post(this.host + '/v1/batch'); | ||
if (this.proxy) { | ||
req = req.proxy(this.proxy); | ||
} | ||
req | ||
.post(this.host + '/v1/batch') | ||
.auth(this.writeKey, '') | ||
@@ -161,0 +152,0 @@ .retry(3) |
{ | ||
"name": "analytics-node", | ||
"repository": "git://github.com/segmentio/analytics-node", | ||
"version": "1.2.2", | ||
"version": "2.0.0", | ||
"description": "The hassle-free way to integrate analytics into any node application.", | ||
@@ -11,4 +11,3 @@ "keywords": [ | ||
"client", | ||
"driver", | ||
"analytics" | ||
"driver" | ||
], | ||
@@ -36,3 +35,3 @@ "main": "lib/index.js", | ||
"express": "~3.4.8", | ||
"http-proxy": "~1.3.0", | ||
"http-proxy": "~1.11.1", | ||
"mocha": "1.8.1", | ||
@@ -48,2 +47,2 @@ "brfs": "^1.3.0" | ||
"license": "MIT" | ||
} | ||
} |
var assert = require('assert'); | ||
var Analytics = require('..'); | ||
var async = require('async'); | ||
var Browser = require('../analytics-node'); | ||
var server = require('./server'); | ||
@@ -18,12 +17,5 @@ | ||
before(function(done){ | ||
async.series([ | ||
function(cb){ | ||
server.proxy.listen(server.ports.proxy, cb); | ||
}, | ||
function(cb){ | ||
server.app | ||
.post('/v1/batch', server.fixture) | ||
.listen(server.ports.source, cb); | ||
} | ||
], done); | ||
server.app | ||
.post('/v1/batch', server.fixture) | ||
.listen(server.ports.source, done); | ||
}); | ||
@@ -67,4 +59,3 @@ | ||
flushAt: 1, | ||
flushAfter: 2, | ||
proxy: 'http://localhost:9001' | ||
flushAfter: 2 | ||
}); | ||
@@ -74,3 +65,2 @@ assert.equal(a.host, 'a'); | ||
assert.equal(a.flushAfter, 2); | ||
assert.equal(a.proxy, 'http://localhost:9001'); | ||
}); | ||
@@ -157,17 +147,2 @@ | ||
it('should proxy', function(done) { | ||
a = Analytics('key', { | ||
host: 'http://localhost:4063', | ||
flushAt: Infinity, | ||
flushAfter: Infinity, | ||
proxy: 'http://localhost:4064' | ||
}); | ||
a.enqueue('type', { event: 'test' }, noop); | ||
a.flush(function(err, data){ | ||
// our proxy turns all responses into 408/errs | ||
assert(err); | ||
done(); | ||
}); | ||
}); | ||
it('should callback with an HTTP error', function(done){ | ||
@@ -330,8 +305,2 @@ enqueue(a, ['error']); | ||
}); | ||
describe('browserify', function(){ | ||
it('should expose a browserified bundle', function(){ | ||
assert('function' == typeof Browser); | ||
}); | ||
}); | ||
}); | ||
@@ -338,0 +307,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
375848
11261
5
4