Comparing version 0.11.0 to 0.12.0
@@ -11,16 +11,14 @@ // Generated by LiveScript 1.4.0 | ||
var prototype = extend$((import$(ExoRelay, superclass).displayName = 'ExoRelay', ExoRelay), superclass).prototype, constructor = ExoRelay; | ||
function ExoRelay(arg$){ | ||
var exocommPort, x$; | ||
exocommPort = (arg$ != null | ||
? arg$ | ||
: {}).exocommPort; | ||
function ExoRelay(config){ | ||
var x$; | ||
this._onIncomingMessage = bind$(this, '_onIncomingMessage', prototype); | ||
this.send = bind$(this, 'send', prototype); | ||
exocommPort || (function(){ | ||
(config != null && config.exocommPort) || (function(){ | ||
throw new Error('exocommPort not provided'); | ||
}()); | ||
(config != null && config.serviceName) || (function(){ | ||
throw new Error('serviceName not provided'); | ||
}()); | ||
this.messageHandler = new HandlerManager(); | ||
this.messageSender = new MessageSender({ | ||
exocommPort: exocommPort | ||
}); | ||
this.messageSender = new MessageSender(config); | ||
x$ = this.httpListener = new HttpListener(); | ||
@@ -27,0 +25,0 @@ x$.on('message', this._onIncomingMessage); |
@@ -11,5 +11,6 @@ // Generated by LiveScript 1.4.0 | ||
function MessageSender(arg$){ | ||
this.exocommPort = (arg$ != null | ||
var ref$; | ||
ref$ = arg$ != null | ||
? arg$ | ||
: {}).exocommPort; | ||
: {}, this.serviceName = ref$.serviceName, this.exocommPort = ref$.exocommPort; | ||
this.exocommPort = +this.exocommPort; | ||
@@ -49,2 +50,3 @@ this.lastSentRequestId = null; | ||
body: { | ||
sender: this.serviceName, | ||
requestId: uuid.v1() | ||
@@ -51,0 +53,0 @@ } |
{ | ||
"name": "exorelay", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Communication relay between JavaScript code bases and the Exosphere environment", | ||
@@ -37,3 +37,3 @@ "main": "dist/exorelay.js", | ||
"david": "^7.0.0", | ||
"diff": "^2.2.1", | ||
"jsdiff-console": "^1.3.0", | ||
"livescript": "^1.4.0", | ||
@@ -43,2 +43,3 @@ "lodash.isequal": "^4.0.0", | ||
"nitroglycerin": "^1.0.3", | ||
"portfinder": "^1.0.1", | ||
"record-http": "^0.6.0", | ||
@@ -45,0 +46,0 @@ "sinon": "^1.17.2", |
@@ -26,3 +26,3 @@ # Exosphere Communication Relay for JavaScript | ||
exoRelay = new ExoRelay exocommPort: <port> | ||
exoRelay = new ExoRelay exocommPort: <port>, serviceName: <name of the service using ExoRelay> | ||
exoRelay.on 'online', (port) -> # yay, we are online! | ||
@@ -29,0 +29,0 @@ exoRelay.on 'error', (err) -> # examine, print, or log the error here |
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
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
18669
13