Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elarian

Package Overview
Dependencies
Maintainers
2
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elarian - npm Package Compare versions

Comparing version 0.1.10 to 0.1.12

docs/authentication.js.html

7

docs/README.md

@@ -24,2 +24,3 @@ ## Classes

* [.connect()](#Elarian+connect)
* [.isConnected()](#Elarian+isConnected)
* [.disconnect()](#Elarian+disconnect)

@@ -86,2 +87,8 @@ * [.sendMessage(customer, channelNumber, message)](#Elarian+sendMessage) ⇒ <code>MessageStatus</code>

**Kind**: instance method of [<code>Elarian</code>](#Elarian)
<a name="Elarian+isConnected"></a>
### elarian.isConnected()
<p>Check if client is connected</p>
**Kind**: instance method of [<code>Elarian</code>](#Elarian)
<a name="Elarian+disconnect"></a>

@@ -88,0 +95,0 @@

@@ -61,2 +61,6 @@ /* global window */

if (!opts.apiKey && !opts.authToken) {
throw new Error('Either one of apiKey or authToken is required');
}
const error = validate(opts, constraints);

@@ -78,2 +82,5 @@ if (error) {

data: null,
connection: null,
// eslint-disable-next-line no-console
error: (err) => this.platform.log.error('Elarian Client Error: ', err),

@@ -122,2 +129,11 @@ // Simulator

platform: this.platform,
errorHandler: this.eventListeners.error,
connectionHandler: (status, err) => {
if (['CLOSED', 'ERROR'].includes(status) && this._socket) {
this.disconnect();
}
if (this.eventListeners.connection) {
this.eventListeners.connection(status, err);
}
},
notificationHandler: this.notificationHandler(this),

@@ -137,2 +153,9 @@ });

/**
* Check if client is connected
*/
this.isConnected = function isConnected() {
return this._client && this._socket;
};
/**
* Disconnect from the elarian server

@@ -144,2 +167,4 @@ */

}
this._client = null;
this._socket = null;
};

@@ -146,0 +171,0 @@

2

lib/notification.js

@@ -305,3 +305,3 @@ /* eslint-disable max-len */

} catch (error) {
log.error(`NotificationError::${event}: `, error.message || error);
log.error(`NotificationReplyError::${event}: `, error.message || error);
}

@@ -308,0 +308,0 @@ })

@@ -912,3 +912,3 @@ const Elarian = require('./client');

resolve(result.value);
resolve(result.value || {});
} catch (ex) {

@@ -915,0 +915,0 @@ reject(ex);

@@ -495,2 +495,4 @@ const { RSocketClient } = require('rsocket-core');

keepAlive,
errorHandler,
connectionHandler,
notificationHandler,

@@ -517,4 +519,6 @@ } = connectionOptions;

const transport = getTransport({
/* FIXME: This disables resumable transport
resumeToken: Buffer.from(appId),
sessionDurationSeconds: lifetime / 1000,
*/
});

@@ -554,2 +558,5 @@ const client = new RSocketClient({

log.debug(`Transport status changed: ${status.kind}`);
if (connectionHandler) {
connectionHandler(status.kind, status.error);
}
if (status.kind === 'NOT_CONNECTED') {

@@ -564,5 +571,16 @@ if (!started) {

},
onError: (error) => {
log.debug(`Transport error: ${error}`);
if (errorHandler) {
errorHandler(error);
}
},
onSubscribe: (subscription) => {
log.debug('Transport subscribed');
subscription.request(Number.MAX_SAFE_INTEGER);
},
onComplete: (signal) => {
log.debug(`Transport closed: ${signal}`);
},
});

@@ -569,0 +587,0 @@

{
"name": "elarian",
"version": "0.1.10",
"version": "0.1.12",
"description": "Elrian JavaScript SDK",

@@ -11,3 +11,6 @@ "main": "index.js",

"lint": "eslint .",
"build": "rm -rf docs/ dist/ && jsdoc -t node_modules/tsd-jsdoc/dist -c .jsdoc -R README.md -r lib/ && mv docs/types.d.ts ./ && jsdoc2md -c .jsdoc --files lib/** > docs/README.md && webpack",
"build": "rm -rf docs/ dist/ && npm run build:types && npm run build:docs && npm run build:web",
"build:types": "jsdoc -t node_modules/tsd-jsdoc/dist -c .jsdoc -r lib/ && mv docs/types.d.ts ./ ",
"build:docs": "jsdoc -c .jsdoc -R README.md -r lib/ && jsdoc2md -c .jsdoc --files lib/** > docs/README.md",
"build:web": "webpack",
"prepublish": "npm run build"

@@ -14,0 +17,0 @@ },

@@ -15,2 +15,6 @@ /**

/**
* <p>Check if client is connected</p>
*/
isConnected(): void;
/**
* <p>Disconnect from the elarian server</p>

@@ -17,0 +21,0 @@ */

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc