cote
Advanced tools
Comparing version 0.19.1 to 0.20.0
"use strict"; | ||
require("core-js/modules/es6.symbol"); | ||
require("core-js/modules/es6.object.to-string"); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
@@ -25,3 +29,3 @@ | ||
class Discovery extends Discover { | ||
constructor(advertisement, options = {}) { | ||
constructor(advertisement, options) { | ||
options = _objectSpread({}, defaultOptions, Discovery.defaults, options); | ||
@@ -28,0 +32,0 @@ super(options); |
"use strict"; | ||
require("core-js/modules/es6.symbol"); | ||
require("core-js/modules/es6.object.to-string"); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
@@ -4,0 +8,0 @@ |
@@ -37,3 +37,3 @@ "use strict"; | ||
for (let id in this.discovery.nodes) { | ||
for (const id in this.discovery.nodes) { | ||
const node = this.discovery.nodes[id]; | ||
@@ -40,0 +40,0 @@ |
"use strict"; | ||
require("core-js/modules/es6.object.to-string"); | ||
require("core-js/modules/es7.object.values"); | ||
@@ -47,3 +49,3 @@ | ||
// (1) Original logic from https://github.com/dashersw/axon/blob/master/lib/sockets/req.js#L94 | ||
let socks = this.sock.socks; // Enqueue if no socks connected yet | ||
const socks = this.sock.socks; // Enqueue if no socks connected yet | ||
@@ -60,3 +62,3 @@ if (!socks || !socks.length) { | ||
const subset = data[SUBSET_IDENTIFIER]; | ||
let possibleSocks = subset ? this.filterSubsetInSocks(subset, socks) : socks; // Enqueue if the correct nodes did not connect yet/does not exist | ||
const possibleSocks = subset ? this.filterSubsetInSocks(subset, socks) : socks; // Enqueue if the correct nodes did not connect yet/does not exist | ||
@@ -68,3 +70,3 @@ if (!possibleSocks.length) return this.sock.enqueue(args); // Balance between available | ||
let fn = args.pop(); | ||
const fn = args.pop(); | ||
fn.id = this.sock.id(); | ||
@@ -71,0 +73,0 @@ this.sock.callbacks[fn.id] = fn; |
"use strict"; | ||
require("core-js/modules/es6.object.to-string"); | ||
require("core-js/modules/es6.set"); | ||
@@ -61,3 +63,3 @@ | ||
for (let sId in server.sockets) { | ||
for (const sId in server.sockets) { | ||
obj.requesterSocketHandler(server.sockets[sId]); | ||
@@ -97,3 +99,3 @@ } | ||
topic = topic.join(''); | ||
let emitter = io.of(namespace); | ||
const emitter = io.of(namespace); | ||
@@ -100,0 +102,0 @@ if (data.__room) { |
"use strict"; | ||
require("core-js/modules/es6.object.to-string"); | ||
const Requester = require('./requester'); | ||
@@ -23,4 +25,4 @@ | ||
for (let index in this.responders) { | ||
for (let id in this.responders[index]) { | ||
for (const index in this.responders) { | ||
for (const id in this.responders[index]) { | ||
if (now - this.responders[index][id].sent > this.CALCULATION_TIMEOUT) { | ||
@@ -42,3 +44,3 @@ if (this.timers[id]) { | ||
for (let id in responder) { | ||
for (const id in responder) { | ||
// clear timers and callbacks for the disconnected socket | ||
@@ -93,3 +95,3 @@ clearInterval(this.timers[id]); | ||
for (let request in item) { | ||
for (const request in item) { | ||
const time = item[request].time || 0; | ||
@@ -96,0 +98,0 @@ totalTime += time; |
"use strict"; | ||
require("core-js/modules/es6.object.to-string"); | ||
module.exports = function (port) { | ||
@@ -67,3 +69,3 @@ const fs = require('fs'); | ||
for (let nodeId in rawLinks) { | ||
for (const nodeId in rawLinks) { | ||
const rawLink = rawLinks[nodeId]; | ||
@@ -70,0 +72,0 @@ const removedNodeIndex = rawLink.target.indexOf(removedNode); |
"use strict"; | ||
require("core-js/modules/es6.symbol"); | ||
require("core-js/modules/es6.object.to-string"); | ||
require("core-js/modules/es7.object.entries"); | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "cote", | ||
"version": "0.19.1", | ||
"version": "0.20.0", | ||
"keywords": [ | ||
@@ -38,26 +38,26 @@ "microservices", | ||
"charm": "1.0.2", | ||
"colors": "1.3.0", | ||
"core-js": "^2.6.1", | ||
"colors": "1.3.3", | ||
"core-js": "^2.6.5", | ||
"eventemitter2": "5.0.1", | ||
"lodash": "^4.17.11", | ||
"portfinder": "1.0.13", | ||
"socket.io": "2.1.1", | ||
"uuid": "^3.2.1" | ||
"portfinder": "1.0.20", | ||
"socket.io": "2.2.0", | ||
"uuid": "^3.3.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/preset-env": "^7.2.3", | ||
"async": "^2.6.1", | ||
"ava": "^0.25.0", | ||
"commander": "2.15.1", | ||
"coveralls": "^3.0.1", | ||
"eslint": "^5.11.0", | ||
"eslint-config-google": "^0.9.1", | ||
"@babel/cli": "^7.4.3", | ||
"@babel/core": "^7.4.3", | ||
"@babel/preset-env": "^7.4.3", | ||
"async": "^2.6.2", | ||
"ava": "^1.4.1", | ||
"commander": "2.20.0", | ||
"coveralls": "^3.0.3", | ||
"eslint": "^5.16.0", | ||
"eslint-config-google": "^0.12.0", | ||
"humanize-number": "0.0.2", | ||
"nyc": "^12.0.2", | ||
"nyc": "^13.3.0", | ||
"randomstring": "^1.1.5", | ||
"request": "^2.87.0", | ||
"sinon": "^6.0.1", | ||
"socket.io-client": "2.1.1" | ||
"request": "^2.88.0", | ||
"sinon": "^7.3.1", | ||
"socket.io-client": "2.2.0" | ||
}, | ||
@@ -78,2 +78,6 @@ "eslintConfig": { | ||
"guard-for-in": "off", | ||
"indent": [ | ||
"error", | ||
4 | ||
], | ||
"object-curly-spacing": [ | ||
@@ -100,2 +104,3 @@ "error", | ||
"useBuiltIns": "usage", | ||
"corejs": "2", | ||
"exclude": [ | ||
@@ -102,0 +107,0 @@ "es6.promise" |
@@ -906,3 +906,3 @@ ![cote](https://user-images.githubusercontent.com/698308/32996603-1517088a-cd85-11e7-85c5-8ef9b3ae2e49.png) | ||
To connect responder and sockend, you need to add `respondsTo:` parameter to your options. | ||
``` | ||
```js | ||
const randomResponder = new Responder({ | ||
@@ -916,3 +916,3 @@ name: 'randomRep', | ||
``` | ||
```js | ||
let randomPublisher = new Publisher({ | ||
@@ -928,7 +928,7 @@ name: 'randomPub', | ||
socket.io-client | ||
``` | ||
```js | ||
io.connect('/rnd'); // namespace in socket.io is declared as '/rnd' | ||
``` | ||
sockend component | ||
``` | ||
```js | ||
const randomResponder = new Responder({ | ||
@@ -1345,6 +1345,6 @@ name: 'randomRep', | ||
``` | ||
```js | ||
// In thise case, we choose only the third app instance (2 because it is zero based) to instantiate a "SERVER" | ||
// any number from 0 through 9 can be used, instead of 2 | ||
if(process.env.pm_id == 2) { | ||
if (process.env.pm_id == 2) { | ||
const cote = require('cote'); | ||
@@ -1351,0 +1351,0 @@ const timeService = new cote.Responder({ |
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
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
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 3 instances in 1 package
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
194385
1004
9
+ Addedcolors@1.3.3(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addeddebug@4.1.1(transitive)
+ Addedengine.io@3.3.2(transitive)
+ Addedengine.io-client@3.3.3(transitive)
+ Addedportfinder@1.0.20(transitive)
+ Addedsocket.io@2.2.0(transitive)
+ Addedsocket.io-client@2.2.0(transitive)
+ Addedsocket.io-parser@3.3.3(transitive)
+ Addedws@6.1.4(transitive)
+ Addedxmlhttprequest-ssl@1.6.3(transitive)
- Removedcolors@1.3.0(transitive)
- Removedengine.io@3.2.1(transitive)
- Removedengine.io-client@3.2.1(transitive)
- Removedportfinder@1.0.13(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsocket.io@2.1.1(transitive)
- Removedsocket.io-client@2.1.1(transitive)
- Removedsocket.io-parser@3.2.0(transitive)
- Removedultron@1.1.1(transitive)
- Removedws@3.3.3(transitive)
- Removedxmlhttprequest-ssl@1.5.5(transitive)
Updatedcolors@1.3.3
Updatedcore-js@^2.6.5
Updatedportfinder@1.0.20
Updatedsocket.io@2.2.0
Updateduuid@^3.3.2