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

nexmo-stitch

Package Overview
Dependencies
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nexmo-stitch - npm Package Compare versions

Comparing version 3.0.2-beta.1 to 3.0.2-beta.2

49

CHANGELOG.md
# Changelog
## 3.0.1 (latest)
## 3.0.2
### New
- Get local stream details under member object on `media:stream:on` for audio
```javascript
call.conversation.me.on("media:stream:on",(stream_details)=>{
stream_details.rtc_id // my member's call id / leg id
stream_details.pc // the PeerConnection object of the instance
stream_details.stream: // the local stream object,
stream_details.type: 'audio', // the stream type
stream_details.index: streamIndex // the stream index
});
```
```text
* @event Member#media:stream:on
*
* @property {number} payload.index the index number of this stream
* @property {number} [payload.rtc_id] the rtc_id / leg_id
* @property {string} [payload.remote_member_id] the id of the Member the stream belongs to
* @property {string} [payload.name] the stream's display name
* @property {MediaStream} payload.stream the stream that is activated
* @property {boolean} [payload.video_mute] if the video is hidden
* @property {boolean} [payload.audio_mute] if the audio is muted
```
### Changes
- update default socket.io `reconnectionAttempts` from `infinity` to `5`
### Breaking changes
- group socket.io configuration params
e.g. to disable auto-reconnect: new ConversationClient({socket_io:{
reconnection:false
}})
---
## 3.0.1
### New
- handle call transfer events `rtc:transfer`

@@ -38,3 +81,5 @@ - attach `member.transferred_from = old_conversation` to know that the member has been transferred from another conversation

```javascript
conversation.members.get(member_id);
```

@@ -45,3 +90,5 @@

```javascript
for (const member of conversation.members.values()) { ... }
```

@@ -48,0 +95,0 @@

4

dist/conversationClientErrorTypes.js

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

},
"error:media:not-enabled": {
type: "error:media:not-enabled",
description: "Media is not enabled"
},
"error:media:unsupported-browser": {

@@ -87,0 +83,0 @@ type: "error:media:unsupported-browser",

@@ -66,2 +66,6 @@ const Event = require('../events/event');

_processMemberInvited(conversation, event) {
if (!conversation) {
this.log.warn(`no conversation object for ${event.type}`);
return event;
}
// no need to process the event if it's not media related invite, or the member is us

@@ -68,0 +72,0 @@ if ((conversation.me && (conversation.me.user.name === event.body.invited_by))

@@ -37,3 +37,3 @@ /*

/**
* Application listening for calls.
* Member listening for audio stream on.
*

@@ -43,8 +43,8 @@ * @event Member#media:stream:on

* @property {number} payload.index the index number of this stream
* @property {string} payload.remote_member_id the id of the Member the stream belongs to
* @property {string} payload.name the stream's display name
* @property {number} [payload.rtc_id] the rtc_id / leg_id
* @property {string} [payload.remote_member_id] the id of the Member the stream belongs to
* @property {string} [payload.name] the stream's display name
* @property {MediaStream} payload.stream the stream that is activated
* @property {boolean} payload.video_mute if the video is hidden
* @property {boolean} payload.audio_mute if the audio is muted
*
* @property {boolean} [payload.video_mute] if the video is hidden
* @property {boolean} [payload.audio_mute] if the audio is muted
*/

@@ -74,3 +74,3 @@

}
if (this.application.session.config && this.application.session.config.screenShareExtensionId !== '') {
if (this.application.session.config && this.application.session.config.screenShareExtensionId && this.application.session.config.screenShareExtensionId !== '') {
this.rtcHelper._setScreenShareExtensionId(this.application.session.config.screenShareExtensionId);

@@ -299,8 +299,9 @@ }

this.rtcObjects[rtc_id] = {
id: rtc_id,
rtc_id: rtc_id,
pc: pc,
localStream: localStream,
// type: 'audio,
streamIndex: streamIndex
stream: localStream,
type: 'audio',
index: streamIndex
};
this.parentConversation.me.emit("media:stream:on", this.rtcObjects[rtc_id]);
} else {

@@ -585,6 +586,6 @@ reject(new NexmoApiError(response));

this.parentConversation.me.emit("media:stream:on", {
type,
type: type,
name: name,
index: index,
localStream
stream: localStream
});

@@ -728,2 +729,3 @@ const promisesArray = [];

index: remoteMemberObject.streamIndex,
rtc_id: remoteMemberObject.local_leg_id,
remote_member_id: remoteMemberObject.remote_member_id,

@@ -1198,3 +1200,3 @@ name: remoteMemberObject.name,

let promises = [];
promises.push(this._cleanConversationProperties());
// promises.push(this._cleanConversationProperties());

@@ -1204,3 +1206,3 @@ for (const leg_id in this.rtcObjects) {

}
return Promise.all(promises);
return Promise.all(promises).then(this._cleanConversationProperties);
}

@@ -1207,0 +1209,0 @@

@@ -211,3 +211,3 @@ (function() { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" === typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function(r) { var n = e[i][1][r]; return o(n || r) }, p, p.exports, r, e, n, t) } return n[i].exports } for (var u = "function" === typeof require && require, i = 0; i < t.length; i++)o(t[i]); return o } return r }())({

}, function(err) {
console.log(err);
// console.log(err);
});

@@ -406,3 +406,3 @@ }

connection.onerror = function(e) {
console.log('WS ERROR', e);
// console.log('WS ERROR', e);
};

@@ -409,0 +409,0 @@

@@ -6,3 +6,3 @@ var PROTOCOL_VERSION = '1.0';

connection.onerror = function(e) {
console.log('WS ERROR', e);
// console.log('WS ERROR', e);
};

@@ -9,0 +9,0 @@

@@ -48,8 +48,13 @@ /*

* @param {string} params.path=/rtc Nexmo Conversation Websocket url path suffix
* @param {Boolean} params.reconnection=true socket.io reconnection attribute
* @param {object} params.rtcstats set reporting for stream statistics (Websocket or internal event emit)
* @param {string} params.rtcstats.ws_url='' endpoint (weboscket) to send rtc stats.
* @param {Boolean} params.rtcstats.emit_events=false receive rtcstats:report event
* @param {Boolean} params.forceNew=true socket.io forceNew attribute
* @param {Boolean} params.autoConnect=true socket.io autoConnect attribute
* @param {object} params.socket_io configure socket.io
* @param {Boolean} params.socket_io.forceNew=true configure socket.io forceNew attribute
* @param {Boolean} params.socket_io.autoConnect=true socket.io autoConnect attribute
* @param {Boolean} params.socket_io.reconnection=true socket.io reconnection attribute
* @param {number} params.socket_io.reconnectionAttempts=5 socket.io reconnectionAttempts attribute
* @param {string[]} params.socket_io.transports=['websocket] socket.io transports protocols
* @param {string} params.ips_url=ips_url Nexmo IPS url for image upload

@@ -72,3 +77,2 @@ * @param {string} params.environment='production' development / production environment

const config = this.config = {
autoConnect: true,
cache: true,

@@ -78,9 +82,14 @@ debug: false,

environment: 'production',
forceNew: true,
ips_url: 'https://api.nexmo.com/v1/image',
path: '/rtc',
reconnection: true,
socket_io: {
reconnection: true,
reconnectionAttempts: 5,
forceNew: true,
autoConnect: true,
transports: ['websocket']
},
repository: 'https://github.com/Nexmo/conversation-js-sdk',
screenShareExtensionId: '',
SDK_version: '3.0.2-beta.1',
SDK_version: '3.0.2-beta.2',
url: 'https://ws.nexmo.com',

@@ -95,2 +104,3 @@ iceServers: [{

};
let connection;

@@ -140,9 +150,4 @@ this.sessionReady = false;

// Create the socket.io connection and allow multiple instances
connection = socket_io.connect(config.url, {
path: config.path,
forceNew: config.forceNew,
reconnection: config.reconnection,
autoConnect: config.autoConnect,
transports: ['websocket']
});
let socket_io_config = Object.assign({ path: config.path }, config.socket_io);
connection = socket_io.connect(config.url, socket_io_config);

@@ -217,2 +222,4 @@ this.connection = connection;

});
}).catch((error) => {
this.log.error(error);
});

@@ -219,0 +226,0 @@ this.log.info('websocket reconnect');

@@ -5,3 +5,3 @@ {

"repository": "https://github.com/Nexmo/conversation-js-sdk",
"version": "3.0.2-beta.1",
"version": "3.0.2-beta.2",
"keywords": [

@@ -22,7 +22,7 @@ "nexmo",

"loglevel-plugin-prefix": "^0.8.4",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"socketio-wildcard": "^2.0.0",
"uuid": "^3.3.2",
"webrtc-adapter": "^6.4.0",
"webrtc-adapter": "^6.4.8",
"wildemitter": "1.x"

@@ -36,9 +36,9 @@ },

"chai-as-promised": "^7.1.1",
"concurrently": "^4.0.1",
"eslint": "^5.6.1",
"eslint-config-google": "^0.10.0",
"concurrently": "^4.1.0",
"eslint": "^5.10.0",
"eslint-config-google": "^0.11.0",
"eslint-plugin-import": "^2.14.0",
"grunt": "^1.0.3",
"grunt-browserify": "^5.3.0",
"grunt-cli": "^1.3.1",
"grunt-cli": "^1.3.2",
"grunt-config": "^1.0.0",

@@ -49,8 +49,8 @@ "grunt-contrib-clean": "^2.0.0",

"grunt-jsdoc": "^2.3.0",
"grunt-karma": "^3.0.0",
"grunt-karma": "^3.0.1",
"grunt-string-replace": "^1.3.1",
"grunt-umd": "^3.0.0",
"jsdoc": "latest",
"karma": "^3.0.0",
"karma-browserify": "^5.3.0",
"karma": "^3.1.3",
"karma-browserify": "^6.0.0",
"karma-chrome-launcher": "^2.2.0",

@@ -64,4 +64,4 @@ "karma-coverage": "^1.1.2",

"mocha": "^5.2.0",
"sinon": "^6.3.4",
"sinon-chai": "^3.2.0"
"sinon": "^7.2.0",
"sinon-chai": "^3.3.0"
},

@@ -68,0 +68,0 @@ "license": "To Be Decided",

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

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

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