@pm2/js-api
Advanced tools
Comparing version 0.5.12 to 0.5.13
{ | ||
"name": "@pm2/js-api", | ||
"version": "0.5.12", | ||
"version": "0.5.13", | ||
"description": "PM2.io API Client for Javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -70,3 +70,6 @@ | ||
.filter(bucket => bucket._id === bucketID) | ||
.map(bucket => bucket.node_cache)[0] | ||
.map(bucket => { | ||
return typeof bucket.node === 'object' ? bucket.node : bucket.node_cache | ||
})[0] | ||
// if found, return it | ||
@@ -86,3 +89,4 @@ if (node && node.endpoints) { | ||
this._buckets.push(bucket) | ||
return resolve(bucket.node_cache.endpoints.web) | ||
const node = typeof bucket.node === 'object' ? bucket.node : bucket.node_cache | ||
return resolve(node.endpoints.web) | ||
}).catch(reject) | ||
@@ -271,3 +275,4 @@ }) | ||
let endpoint = bucket.node_cache.endpoints.realtime || bucket.node_cache.endpoints.web | ||
const endpoints = bucket.node.endpoints || bucket.node_cache.endpoints | ||
let endpoint = endpoints.realtime || endpoints.web | ||
endpoint = endpoint.replace('http', 'ws') | ||
@@ -286,2 +291,3 @@ if (this.opts.IS_DEBUG) { | ||
socket.send(`primus::pong::${Date.now()}`) | ||
socket.ping() | ||
} | ||
@@ -288,0 +294,0 @@ let keepAliveInterval = null |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1105415
17855