@aspecto/core
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -34,3 +34,2 @@ "use strict"; | ||
: "http://localhost:8082/"; | ||
// console.log('collector address: ' + analyticsEndpoint) | ||
let ws = new ws_1.default(analyticsEndpoint); | ||
@@ -48,4 +47,2 @@ const http = new HttpReporter_1.default(); | ||
const collector = new collector_1.default(ws); | ||
// collector.addCollection(new CpuCollector()); | ||
// collector.addCollection(new MemoryCollector()); | ||
collector.addCollection(new OsCollector_1.default()); | ||
@@ -52,0 +49,0 @@ collector.addCollection(new NpmCollector_1.default()); |
@@ -9,16 +9,7 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const socketIo = __importStar(require("socket.io-client")); | ||
const ws_1 = __importDefault(require("ws")); | ||
class WebSocketConnection { | ||
constructor(host) { | ||
this.host = host; | ||
try { | ||
this.localSocket = new ws_1.default("ws://127.0.0.1:7531"); | ||
this.localSocket.on("error", () => { }); | ||
} | ||
catch (e) { } | ||
} | ||
@@ -38,8 +29,2 @@ auth(token) { | ||
this.socket.on("error", function (err) { | ||
// console.error( | ||
// `Aspecto error while connecting to WebSocket ${err.message} ${ | ||
// err.stack | ||
// }`, | ||
// err | ||
// ); | ||
reject(); | ||
@@ -49,6 +34,2 @@ }); | ||
catch (error) { | ||
// console.error( | ||
// `Aspecto error while connecting to WebSocket ${error}`, | ||
// error | ||
// ); | ||
reject(); | ||
@@ -62,5 +43,2 @@ } | ||
this.socket.send(stringData); | ||
if (this.localSocket && this.localSocket.readyState === ws_1.default.OPEN) { | ||
this.localSocket.send(stringData); | ||
} | ||
} | ||
@@ -67,0 +45,0 @@ } |
@@ -27,2 +27,6 @@ "use strict"; | ||
this.use((req, res, next) => { | ||
if (Math.random() >= aspectoConfig_1.default.getSamplingRatio()) { | ||
next(); | ||
return; | ||
} | ||
req.aspecto = { | ||
@@ -39,7 +43,3 @@ uuid: uuid_1.default.v4(), | ||
}; | ||
res.finish = function () { | ||
// console.log('in finish'); | ||
}; | ||
res.end = function (chunk) { | ||
// console.log('in end'); | ||
if (chunk) { | ||
@@ -46,0 +46,0 @@ chunks.push(chunk); |
@@ -22,5 +22,6 @@ import WebSocketConnection from "./src/communication/ws"; | ||
: "http://localhost:8082/"; | ||
// console.log('collector address: ' + analyticsEndpoint) | ||
let ws = new WebSocketConnection(analyticsEndpoint); | ||
const http = new HttpReporter(); | ||
const auth = AspectoConfig.getToken(options); | ||
@@ -31,2 +32,3 @@ http.set(ws, auth); | ||
errorReporter.set(ws, auth); | ||
const allowed = await ws.auth(auth); | ||
@@ -39,4 +41,2 @@ if (!allowed) { | ||
const collector = new Collector(ws); | ||
// collector.addCollection(new CpuCollector()); | ||
// collector.addCollection(new MemoryCollector()); | ||
collector.addCollection(new OsCollector()); | ||
@@ -43,0 +43,0 @@ collector.addCollection(new NpmCollector()); |
{ | ||
"name": "@aspecto/core", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Aspecto metric collector", | ||
@@ -26,5 +26,3 @@ "main": "index.js", | ||
"husky": "^2.1.0", | ||
"typescript": "^3.2.4" | ||
}, | ||
"dependencies": { | ||
"typescript": "^3.2.4", | ||
"@types/node": "^10.12.18", | ||
@@ -34,7 +32,8 @@ "@types/socket.io": "^2.1.2", | ||
"@types/uuid": "^3.4.4", | ||
"@types/ws": "^6.0.1", | ||
"@types/ws": "^6.0.1" | ||
}, | ||
"dependencies": { | ||
"pidusage": "^2.0.17", | ||
"socket.io": "^2.2.0", | ||
"uuid": "^3.3.2", | ||
"ws": "^6.1.2" | ||
"uuid": "^3.3.2" | ||
}, | ||
@@ -41,0 +40,0 @@ "husky": { |
@@ -7,10 +7,5 @@ import * as socketIo from "socket.io-client"; | ||
private token: string; | ||
private localSocket: WebSocket; | ||
constructor(private host: string) { | ||
try { | ||
this.localSocket = new WebSocket("ws://127.0.0.1:7531"); | ||
this.localSocket.on("error", () => {}); | ||
} catch (e) {} | ||
} | ||
@@ -33,15 +28,5 @@ | ||
this.socket.on("error", function(err: any) { | ||
// console.error( | ||
// `Aspecto error while connecting to WebSocket ${err.message} ${ | ||
// err.stack | ||
// }`, | ||
// err | ||
// ); | ||
reject(); | ||
}); | ||
} catch (error) { | ||
// console.error( | ||
// `Aspecto error while connecting to WebSocket ${error}`, | ||
// error | ||
// ); | ||
reject(); | ||
@@ -57,6 +42,3 @@ } | ||
if (this.localSocket && this.localSocket.readyState === WebSocket.OPEN) { | ||
this.localSocket.send(stringData); | ||
} | ||
} | ||
} |
@@ -48,7 +48,3 @@ import uuid from "uuid"; | ||
res.finish = function() { | ||
// console.log('in finish'); | ||
}; | ||
res.end = function(chunk: any) { | ||
// console.log('in end'); | ||
if (chunk) { | ||
@@ -55,0 +51,0 @@ chunks.push(chunk); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
3
66
67388
8
1340
20
- Removed@types/node@^10.12.18
- Removed@types/socket.io@^2.1.2
- Removed@types/socket.io-client@^1.4.32
- Removed@types/uuid@^3.4.4
- Removed@types/ws@^6.0.1
- Removedws@^6.1.2
- Removed@socket.io/component-emitter@3.1.2(transitive)
- Removed@types/engine.io@3.1.10(transitive)
- Removed@types/node@10.17.60(transitive)
- Removed@types/socket.io@2.1.13(transitive)
- Removed@types/socket.io-client@1.4.36(transitive)
- Removed@types/socket.io-parser@3.0.0(transitive)
- Removed@types/uuid@3.4.13(transitive)
- Removed@types/ws@6.0.4(transitive)
- Removedasync-limiter@1.0.1(transitive)
- Removeddebug@4.3.7(transitive)
- Removedsocket.io-parser@4.2.4(transitive)
- Removedws@6.2.3(transitive)