New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@openreplay/tracker-assist

Package Overview
Dependencies
Maintainers
3
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openreplay/tracker-assist - npm Package Compare versions

Comparing version 3.4.10 to 3.4.11

3

cjs/index.d.ts
import './_slim.js';
import { App } from '@openreplay/tracker/cjs';
export interface Options {
onAgentConnect?: () => (() => {} | undefined);
onAgentConnect: () => (() => {} | void);
onCallStart: () => (() => {} | void);
confirmText: string;

@@ -6,0 +7,0 @@ confirmStyle: Object;

@@ -30,2 +30,4 @@ "use strict";

config: null,
onCallStart: () => { },
onAgentConnect: () => { },
}, opts);

@@ -83,3 +85,2 @@ return function (app, appOptions = {}) {

conn.on('open', function () {
var _a;
log('Connection opened.');

@@ -89,3 +90,3 @@ assistDemandedRestart = true;

openDataConnections[conn.peer] = new BufferingConnection_js_1.default(conn, options.__messages_per_send);
const onAgentDisconnect = (_a = options.onAgentConnect) === null || _a === void 0 ? void 0 : _a.call(options);
const onAgentDisconnect = options.onAgentConnect();
conn.on('close', () => {

@@ -125,4 +126,4 @@ onAgentDisconnect === null || onAgentDisconnect === void 0 ? void 0 : onAgentDisconnect();

let confirmAnswer;
const peerOnCall = sessionStorage.getItem(options.session_calling_peer_key);
if (peerOnCall === call.peer) {
const callingPeer = sessionStorage.getItem(options.session_calling_peer_key);
if (callingPeer === call.peer) {
confirmAnswer = Promise.resolve(true);

@@ -150,5 +151,7 @@ }

}
const onCallEnd = options.onCallStart();
const mouse = new Mouse_js_1.default();
let callUI = new CallWindow_js_1.default();
const onCallEnd = () => {
const handleCallEnd = () => {
onCallEnd === null || onCallEnd === void 0 ? void 0 : onCallEnd();
mouse.remove();

@@ -162,6 +165,6 @@ callUI.remove();

notifyCallEnd();
onCallEnd();
handleCallEnd();
};
(0, LocalStream_js_1.default)().then(lStream => {
dataConn.on("close", onCallEnd); // For what case?
dataConn.on("close", handleCallEnd); // For what case?
//call.on('close', onClose); // Works from time to time (peerjs bug)

@@ -174,3 +177,3 @@ const checkConnInterval = setInterval(() => {

if (!call.open) {
onCallEnd();
handleCallEnd();
clearInterval(checkConnInterval);

@@ -197,3 +200,3 @@ }

log('"call_end" received');
onCallEnd();
handleCallEnd();
return;

@@ -253,3 +256,3 @@ }

warn("Audio mediadevice request error:", e);
onCallEnd();
handleCallEnd();
});

@@ -256,0 +259,0 @@ }).catch(); // in case of Confirm.remove() without any confirmation

import './_slim.js';
import { App } from '@openreplay/tracker';
export interface Options {
onAgentConnect?: () => (() => {} | undefined);
onAgentConnect: () => (() => {} | void);
onCallStart: () => (() => {} | void);
confirmText: string;

@@ -6,0 +7,0 @@ confirmStyle: Object;

@@ -28,2 +28,4 @@ import './_slim.js';

config: null,
onCallStart: () => { },
onAgentConnect: () => { },
}, opts);

@@ -81,3 +83,2 @@ return function (app, appOptions = {}) {

conn.on('open', function () {
var _a;
log('Connection opened.');

@@ -87,3 +88,3 @@ assistDemandedRestart = true;

openDataConnections[conn.peer] = new BufferingConnection(conn, options.__messages_per_send);
const onAgentDisconnect = (_a = options.onAgentConnect) === null || _a === void 0 ? void 0 : _a.call(options);
const onAgentDisconnect = options.onAgentConnect();
conn.on('close', () => {

@@ -123,4 +124,4 @@ onAgentDisconnect === null || onAgentDisconnect === void 0 ? void 0 : onAgentDisconnect();

let confirmAnswer;
const peerOnCall = sessionStorage.getItem(options.session_calling_peer_key);
if (peerOnCall === call.peer) {
const callingPeer = sessionStorage.getItem(options.session_calling_peer_key);
if (callingPeer === call.peer) {
confirmAnswer = Promise.resolve(true);

@@ -148,5 +149,7 @@ }

}
const onCallEnd = options.onCallStart();
const mouse = new Mouse();
let callUI = new CallWindow();
const onCallEnd = () => {
const handleCallEnd = () => {
onCallEnd === null || onCallEnd === void 0 ? void 0 : onCallEnd();
mouse.remove();

@@ -160,6 +163,6 @@ callUI.remove();

notifyCallEnd();
onCallEnd();
handleCallEnd();
};
RequestLocalStream().then(lStream => {
dataConn.on("close", onCallEnd); // For what case?
dataConn.on("close", handleCallEnd); // For what case?
//call.on('close', onClose); // Works from time to time (peerjs bug)

@@ -172,3 +175,3 @@ const checkConnInterval = setInterval(() => {

if (!call.open) {
onCallEnd();
handleCallEnd();
clearInterval(checkConnInterval);

@@ -195,3 +198,3 @@ }

log('"call_end" received');
onCallEnd();
handleCallEnd();
return;

@@ -251,3 +254,3 @@ }

warn("Audio mediadevice request error:", e);
onCallEnd();
handleCallEnd();
});

@@ -254,0 +257,0 @@ }).catch(); // in case of Confirm.remove() without any confirmation

{
"name": "@openreplay/tracker-assist",
"description": "Tracker plugin for screen assistance through the WebRTC",
"version": "3.4.10",
"version": "3.4.11",
"keywords": [

@@ -6,0 +6,0 @@ "WebRTC",

@@ -33,2 +33,5 @@ # OpenReplay Tracker Assist plugin

confirmStyle: Object,
config: RTCConfiguration,
onAgentConnect: () => (()=>void | void),
onCallStart: () => (()=>void | void),
}

@@ -45,2 +48,41 @@ ```

```
```
It is possible to pass `config` RTCConfiguration object in order to configure TURN server or other parameters.
```ts
config: {
iceServers: [{
urls: "stun:stun.services.mozilla.com",
username: "louis@mozilla.com",
credential: "webrtcdemo"
}, {
urls: ["stun:stun.example.com", "stun:stun-1.example.com"]
}]
}
```
You can pass `onAgentConnect` callback. It will be called when someone from OpenReplay UI connects to the current live session. It can return another function. In this case, returned callback will be called when the same agent connection gets closed.
```ts
onAgentConnect: () => {
console.log("Hello!")
const onAgentDisconnect = () => console.log("Bye!")
return onAgentDisconnect
}
```
Warning: it is possible for the same agent to be connected/disconnected several times during one session due to a bad network. Several agents may connect simultaneously.
A callback `onCallStart` will be fired when the end-user accepts the call. It can return another callback that will be called on call end.
```ts
onCallStart: () => {
console.log("Allo!")
const onCallEnd = () => console.log("short beeps...")
return onCallEnd
}
```
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