@openreplay/tracker-assist
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -0,1 +1,9 @@ | ||
## 5.0.2 | ||
- Added `onCallDeny`, `onRemoteControlDeny` and `onRecordingDeny` callbacks to signal denial of user's consent to call/control/recording | ||
## 5.0.1 | ||
- dependency updates | ||
## 5.0.0 | ||
@@ -2,0 +10,0 @@ |
@@ -10,2 +10,5 @@ import type { Properties } from 'csstype'; | ||
onRecordingRequest?: (agentInfo: Record<string, any>) => any; | ||
onCallDeny?: () => any; | ||
onRemoteControlDeny?: (agentInfo: Record<string, any>) => any; | ||
onRecordingDeny?: (agentInfo: Record<string, any>) => any; | ||
session_calling_peer_key: string; | ||
@@ -25,3 +28,3 @@ session_control_peer_key: string; | ||
private readonly noSecureMode; | ||
readonly version = "5.0.1"; | ||
readonly version = "5.0.2"; | ||
private socket; | ||
@@ -28,0 +31,0 @@ private peer; |
@@ -21,3 +21,2 @@ "use strict"; | ||
})(CallingState || (CallingState = {})); | ||
; | ||
class Assist { | ||
@@ -27,3 +26,3 @@ constructor(app, options, noSecureMode = false) { | ||
this.noSecureMode = noSecureMode; | ||
this.version = '5.0.1'; | ||
this.version = '5.0.2'; | ||
this.socket = null; | ||
@@ -139,3 +138,4 @@ this.peer = null; | ||
return callingAgents.get(id); | ||
}, id => { | ||
}, (id, isDenied) => { | ||
var _a, _b, _c; | ||
if (id) { | ||
@@ -156,2 +156,6 @@ const cb = this.agents[id].onControlReleased; | ||
} | ||
if (isDenied) { | ||
const info = id ? (_a = this.agents[id]) === null || _a === void 0 ? void 0 : _a.agentInfo : {}; | ||
(_c = (_b = this.options).onRemoteControlDeny) === null || _c === void 0 ? void 0 : _c.call(_b, info || {}); | ||
} | ||
}); | ||
@@ -161,4 +165,6 @@ const onAcceptRecording = () => { | ||
}; | ||
const onRejectRecording = () => { | ||
const onRejectRecording = (agentData) => { | ||
var _a, _b; | ||
socket.emit('recording_rejected'); | ||
(_b = (_a = this.options).onRecordingDeny) === null || _b === void 0 ? void 0 : _b.call(_a, agentData || {}); | ||
}; | ||
@@ -239,3 +245,3 @@ const recordingState = new ScreenRecordingState_js_1.default(this.options.recordingConfirm); | ||
(_b = (_a = this.options).onRecordingRequest) === null || _b === void 0 ? void 0 : _b.call(_a, JSON.parse(agentData)); | ||
recordingState.requestRecording(id, onAcceptRecording, onRejectRecording); | ||
recordingState.requestRecording(id, onAcceptRecording, () => onRejectRecording(agentData)); | ||
} | ||
@@ -354,5 +360,6 @@ else { | ||
confirmAnswer.then(async (agreed) => { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
if (!agreed) { | ||
initiateCallEnd(); | ||
(_b = (_a = this.options).onCallDeny) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
return; | ||
@@ -370,3 +377,3 @@ } | ||
catch (e) { | ||
app.debug.error('Audio mediadevice request error:', e); | ||
app.debug.error('Audio media device request error:', e); | ||
initiateCallEnd(); | ||
@@ -412,3 +419,3 @@ return; | ||
if (!callEndCallback) { | ||
callEndCallback = (_b = (_a = this.options).onCallStart) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
callEndCallback = (_d = (_c = this.options).onCallStart) === null || _d === void 0 ? void 0 : _d.call(_c); | ||
} | ||
@@ -415,0 +422,0 @@ const callingPeerIds = Object.keys(calls); |
@@ -14,7 +14,7 @@ import type { Options as AssistOptions } from './Assist'; | ||
private agentID; | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null) => void); | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null, isDenied?: boolean) => void); | ||
reconnect(ids: string[]): void; | ||
private confirm; | ||
requestControl: (id: string) => void; | ||
releaseControl: () => void; | ||
releaseControl: (isDenied?: boolean) => void; | ||
grantControl: (id: string) => void; | ||
@@ -21,0 +21,0 @@ resetMouse: () => void; |
@@ -46,3 +46,3 @@ "use strict"; | ||
(_a = this.confirm) === null || _a === void 0 ? void 0 : _a.remove(); | ||
this.releaseControl(); | ||
this.releaseControl(true); | ||
} | ||
@@ -60,3 +60,3 @@ }) | ||
}; | ||
this.releaseControl = () => { | ||
this.releaseControl = (isDenied) => { | ||
if (this.confirm) { | ||
@@ -69,3 +69,3 @@ this.confirm.remove(); | ||
sessionStorage.removeItem(this.options.session_control_peer_key); | ||
this.onRelease(this.agentID); | ||
this.onRelease(this.agentID, isDenied); | ||
this.agentID = null; | ||
@@ -72,0 +72,0 @@ }; |
@@ -91,7 +91,7 @@ "use strict"; | ||
this.rejectRecording = () => { | ||
var _a; | ||
var _a, _b; | ||
(_a = this.confirm) === null || _a === void 0 ? void 0 : _a.remove(); | ||
this.status = RecordingState.Off; | ||
this.overlayAdded = false; | ||
this.uiComponents.forEach((el) => { var _a; return (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(el); }); | ||
(_b = this.uiComponents) === null || _b === void 0 ? void 0 : _b.forEach((el) => { var _a; return (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(el); }); | ||
}; | ||
@@ -98,0 +98,0 @@ } |
@@ -10,2 +10,5 @@ import type { Properties } from 'csstype'; | ||
onRecordingRequest?: (agentInfo: Record<string, any>) => any; | ||
onCallDeny?: () => any; | ||
onRemoteControlDeny?: (agentInfo: Record<string, any>) => any; | ||
onRecordingDeny?: (agentInfo: Record<string, any>) => any; | ||
session_calling_peer_key: string; | ||
@@ -25,3 +28,3 @@ session_control_peer_key: string; | ||
private readonly noSecureMode; | ||
readonly version = "5.0.1"; | ||
readonly version = "5.0.2"; | ||
private socket; | ||
@@ -28,0 +31,0 @@ private peer; |
@@ -19,3 +19,2 @@ import { connect, } from 'socket.io-client'; | ||
})(CallingState || (CallingState = {})); | ||
; | ||
export default class Assist { | ||
@@ -25,3 +24,3 @@ constructor(app, options, noSecureMode = false) { | ||
this.noSecureMode = noSecureMode; | ||
this.version = '5.0.1'; | ||
this.version = '5.0.2'; | ||
this.socket = null; | ||
@@ -137,3 +136,4 @@ this.peer = null; | ||
return callingAgents.get(id); | ||
}, id => { | ||
}, (id, isDenied) => { | ||
var _a, _b, _c; | ||
if (id) { | ||
@@ -154,2 +154,6 @@ const cb = this.agents[id].onControlReleased; | ||
} | ||
if (isDenied) { | ||
const info = id ? (_a = this.agents[id]) === null || _a === void 0 ? void 0 : _a.agentInfo : {}; | ||
(_c = (_b = this.options).onRemoteControlDeny) === null || _c === void 0 ? void 0 : _c.call(_b, info || {}); | ||
} | ||
}); | ||
@@ -159,4 +163,6 @@ const onAcceptRecording = () => { | ||
}; | ||
const onRejectRecording = () => { | ||
const onRejectRecording = (agentData) => { | ||
var _a, _b; | ||
socket.emit('recording_rejected'); | ||
(_b = (_a = this.options).onRecordingDeny) === null || _b === void 0 ? void 0 : _b.call(_a, agentData || {}); | ||
}; | ||
@@ -237,3 +243,3 @@ const recordingState = new ScreenRecordingState(this.options.recordingConfirm); | ||
(_b = (_a = this.options).onRecordingRequest) === null || _b === void 0 ? void 0 : _b.call(_a, JSON.parse(agentData)); | ||
recordingState.requestRecording(id, onAcceptRecording, onRejectRecording); | ||
recordingState.requestRecording(id, onAcceptRecording, () => onRejectRecording(agentData)); | ||
} | ||
@@ -352,5 +358,6 @@ else { | ||
confirmAnswer.then(async (agreed) => { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
if (!agreed) { | ||
initiateCallEnd(); | ||
(_b = (_a = this.options).onCallDeny) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
return; | ||
@@ -368,3 +375,3 @@ } | ||
catch (e) { | ||
app.debug.error('Audio mediadevice request error:', e); | ||
app.debug.error('Audio media device request error:', e); | ||
initiateCallEnd(); | ||
@@ -410,3 +417,3 @@ return; | ||
if (!callEndCallback) { | ||
callEndCallback = (_b = (_a = this.options).onCallStart) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
callEndCallback = (_d = (_c = this.options).onCallStart) === null || _d === void 0 ? void 0 : _d.call(_c); | ||
} | ||
@@ -413,0 +420,0 @@ const callingPeerIds = Object.keys(calls); |
@@ -14,7 +14,7 @@ import type { Options as AssistOptions } from './Assist'; | ||
private agentID; | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null) => void); | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null, isDenied?: boolean) => void); | ||
reconnect(ids: string[]): void; | ||
private confirm; | ||
requestControl: (id: string) => void; | ||
releaseControl: () => void; | ||
releaseControl: (isDenied?: boolean) => void; | ||
grantControl: (id: string) => void; | ||
@@ -21,0 +21,0 @@ resetMouse: () => void; |
@@ -43,3 +43,3 @@ import Mouse from './Mouse.js'; | ||
(_a = this.confirm) === null || _a === void 0 ? void 0 : _a.remove(); | ||
this.releaseControl(); | ||
this.releaseControl(true); | ||
} | ||
@@ -57,3 +57,3 @@ }) | ||
}; | ||
this.releaseControl = () => { | ||
this.releaseControl = (isDenied) => { | ||
if (this.confirm) { | ||
@@ -66,3 +66,3 @@ this.confirm.remove(); | ||
sessionStorage.removeItem(this.options.session_control_peer_key); | ||
this.onRelease(this.agentID); | ||
this.onRelease(this.agentID, isDenied); | ||
this.agentID = null; | ||
@@ -69,0 +69,0 @@ }; |
@@ -88,7 +88,7 @@ import ConfirmWindow from './ConfirmWindow/ConfirmWindow.js'; | ||
this.rejectRecording = () => { | ||
var _a; | ||
var _a, _b; | ||
(_a = this.confirm) === null || _a === void 0 ? void 0 : _a.remove(); | ||
this.status = RecordingState.Off; | ||
this.overlayAdded = false; | ||
this.uiComponents.forEach((el) => { var _a; return (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(el); }); | ||
(_b = this.uiComponents) === null || _b === void 0 ? void 0 : _b.forEach((el) => { var _a; return (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(el); }); | ||
}; | ||
@@ -95,0 +95,0 @@ } |
{ | ||
"name": "@openreplay/tracker-assist", | ||
"description": "Tracker plugin for screen assistance through the WebRTC", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"keywords": [ | ||
@@ -34,3 +34,3 @@ "WebRTC", | ||
"peerDependencies": { | ||
"@openreplay/tracker": ">=3.6.0" | ||
"@openreplay/tracker": ">=5.0.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
152987
3436