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

twilio-notifications

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twilio-notifications - npm Package Compare versions

Comparing version 0.2.0-alpha.8 to 0.2.0-alpha.9

44

lib/client.js

@@ -33,9 +33,10 @@ 'use strict';

* @constructor
* @param {string} productId id of a product, which uses notification library
* @param {string} token - Twilio access token
* @param {Notifications#ClientOptions} options - Options to customize client behavior
*/
function NotificationsClient(productId, token, options) {
function NotificationsClient(token, options) {
if (!token) {
throw new Error('Token is required for Notifications client');
}
EventEmitter.call(this);

@@ -48,2 +49,3 @@ options = options || {};

const minTokenRefreshInterval = options.minTokenRefreshInterval || 10000;
const productId = options.productId || 'notifications';

@@ -69,20 +71,21 @@ options.twilsockClient = options.twilsockClient || new Twilsock(token, options);

connectionState: { get: () => {
if (this._twilsock.state === 'disconnected') {
return 'disconnected';
} else if (this._twilsock.state === 'disconnecting') {
return 'disconnecting';
} else if (this._twilsock.state === 'connected' && this._reliableTransportState.registration) {
return 'connected';
} else if (this._twilsock.state === 'rejected') {
return 'denied';
updateToken: { value: limit(this._updateToken.bind(this), 1, minTokenRefreshInterval), enumerable: true },
connectionState: {
get: () => {
if (this._twilsock.state === 'disconnected') {
return 'disconnected';
} else if (this._twilsock.state === 'disconnecting') {
return 'disconnecting';
} else if (this._twilsock.state === 'connected' && this._reliableTransportState.registration) {
return 'connected';
} else if (this._twilsock.state === 'rejected') {
return 'denied';
}
return 'connecting';
}
return 'connecting';
} },
updateToken: { value: limit(this._updateToken.bind(this), 1, minTokenRefreshInterval), enumerable: true }
}
});
EventEmitter.call(this);
this._onTransportStateChange(this._twilsock.connected);

@@ -224,3 +227,10 @@ this._registrar.on('transportReady', state => { this._onRegistrationStateChange(state ? 'registered' : ''); });

/**
* These options can be passed to Client constructor
* @typedef {Object} Notifications#ClientOptions
* @property {String} [logLevel='error'] - The level of logging to enable. Valid options
* (from strictest to broadest): ['silent', 'error', 'warn', 'info', 'debug', 'trace']
*/
module.exports = NotificationsClient;
{
"name": "twilio-notifications",
"version": "0.2.0-alpha.8",
"version": "0.2.0-alpha.9",
"description": "Client library for Twilio Notifications service",

@@ -17,12 +17,12 @@ "main": "lib/client.js",

"backoff": "^2.5.0",
"bottleneck": "^1.14.0",
"bottleneck": "^1.15.0",
"javascript-state-machine": "^2.3.5",
"loglevel": "^1.4.1",
"twilio-transport": "^0.0.8",
"twilsock": "^0.2.0-alpha.1",
"uuid": "^2.0.3"
"twilsock": "^0.2.0-alpha",
"uuid": "^3.0.0"
},
"devDependencies": {
"async": "^2.1.2",
"babel-eslint": "^7.0.0",
"babel-eslint": "^7.1.1",
"chai": "^3.5.0",

@@ -38,3 +38,3 @@ "chai-as-promised": "^6.0.0",

"ink-docstrap": "^1.3.0",
"jsdoc": "^3.4.2",
"jsdoc": "^3.4.3",
"proxyquire": "^1.7.10",

@@ -45,4 +45,4 @@ "run-sequence": "^1.2.2",

"sinon-chai": "^2.8.0",
"twilio": "^2.11.0"
"twilio": "^2.11.1"
}
}

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

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

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