@whereby.com/assistant-sdk 1.2.109 → 1.2.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,6 +120,9 @@ global.RTCRtpSender = wrtc.RTCRtpSender;
120
120
  global.RTCRtpTransceiver = wrtc.RTCRtpTransceiver;
121
121
  global.RTCSctpTransport = wrtc.RTCSctpTransport;
122
122
  global.RTCSessionDescription = wrtc.RTCSessionDescription;
123
- global.window = Object.assign(Object.assign({}, global), { location: { pathname: "" }, screen: { width: 0 }, setInterval: global.setInterval }); // make sure all the classes / setInterval are available on window for rtcstats
123
+ // Node's `global` is not an EventTarget, so the spread below copies no event methods. Back them
124
+ // with one so window listeners (e.g. "offline") attach instead of throwing; nothing fires in Node.
125
+ const windowEventTarget = new EventTarget();
126
+ global.window = Object.assign(Object.assign({}, global), { location: { pathname: "" }, screen: { width: 0 }, setInterval: global.setInterval, addEventListener: windowEventTarget.addEventListener.bind(windowEventTarget), removeEventListener: windowEventTarget.removeEventListener.bind(windowEventTarget), dispatchEvent: windowEventTarget.dispatchEvent.bind(windowEventTarget) }); // make sure all the classes / setInterval are available on window for rtcstats
124
127
 
125
128
  exports.setWebsocketOrigin = setWebsocketOrigin;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@whereby.com/assistant-sdk",
3
3
  "description": "Assistant SDK for whereby.com",
4
4
  "author": "Whereby AS",
5
- "version": "1.2.109",
5
+ "version": "1.2.111",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "dist",
@@ -64,7 +64,7 @@
64
64
  "express": "5.1.0",
65
65
  "uuid": "^11.0.3",
66
66
  "ws": "^8.18.0",
67
- "@whereby.com/core": "1.20.2"
67
+ "@whereby.com/core": "1.20.3"
68
68
  },
69
69
  "prettier": "@whereby.com/prettier-config",
70
70
  "scripts": {