@messagebird/client
Advanced tools
Comparing version 1.0.0-next-rc.7 to 1.0.0-next-rc.8
@@ -0,1 +1,8 @@ | ||
# [1.0.0-next-rc.7](https://git.messagebird.io/frontend/javascript-webrtc-sdk/compare/v1.0.0-next-rc.6...v1.0.0-next-rc.7) (2020-05-08) | ||
### Bug Fixes | ||
* typo in CallStatus enum value ([4b77b9c](https://git.messagebird.io/frontend/javascript-webrtc-sdk/commit/4b77b9cb7bb97e9df32167201bcc2b4df5b96cbb)) | ||
# [1.0.0-next-rc.6](https://git.messagebird.io/frontend/javascript-webrtc-sdk/compare/v1.0.0-next-rc.5...v1.0.0-next-rc.6) (2020-05-06) | ||
@@ -2,0 +9,0 @@ |
@@ -81,3 +81,3 @@ 'use strict'; | ||
function getSDKVersionHeader() { | ||
var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "4b77b9cb" ; | ||
var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "93ee7610" ; | ||
return "SDK-Version: ".concat(version); | ||
@@ -1123,3 +1123,3 @@ } | ||
_defineProperty(this, "handleMuteUnmute", function () { | ||
_this.eventEmitter.emit('mutedchange', _this.isMuted); | ||
_this.eventEmitter.emit('muted', _this.isMuted); | ||
}); | ||
@@ -1202,14 +1202,15 @@ | ||
case 2: | ||
// Get the A/V track senders | ||
_context.prev = 2; // Get the A/V track senders | ||
senders = this.rtcSession.connection.getSenders(); // Apply the desired media constraints | ||
_context.next = 5; | ||
_context.next = 6; | ||
return navigator.mediaDevices.getUserMedia(constraints); | ||
case 5: | ||
case 6: | ||
nextStream = _context.sent; | ||
_context.next = 8; | ||
_context.next = 9; | ||
return nextStream.getTracks(); | ||
case 8: | ||
case 9: | ||
nextTracks = _context.sent; // Iterate through the list of track senders | ||
@@ -1220,8 +1221,8 @@ | ||
_iteratorError = undefined; | ||
_context.prev = 12; | ||
_context.prev = 13; | ||
_iterator = senders[Symbol.iterator](); | ||
case 14: | ||
case 15: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 46; | ||
_context.next = 47; | ||
break; | ||
@@ -1238,8 +1239,8 @@ } | ||
_iteratorError2 = undefined; | ||
_context.prev = 20; | ||
_context.prev = 21; | ||
_iterator2 = nextTracks[Symbol.iterator](); | ||
case 22: | ||
case 23: | ||
if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { | ||
_context.next = 29; | ||
_context.next = 30; | ||
break; | ||
@@ -1249,23 +1250,23 @@ } | ||
track = _step2.value; | ||
_context.next = 26; | ||
_context.next = 27; | ||
return sender.replaceTrack(track); | ||
case 26: | ||
case 27: | ||
_iteratorNormalCompletion2 = true; | ||
_context.next = 22; | ||
_context.next = 23; | ||
break; | ||
case 29: | ||
_context.next = 35; | ||
case 30: | ||
_context.next = 36; | ||
break; | ||
case 31: | ||
_context.prev = 31; | ||
_context.t0 = _context["catch"](20); | ||
case 32: | ||
_context.prev = 32; | ||
_context.t0 = _context["catch"](21); | ||
_didIteratorError2 = true; | ||
_iteratorError2 = _context.t0; | ||
case 35: | ||
_context.prev = 35; | ||
case 36: | ||
_context.prev = 36; | ||
_context.prev = 37; | ||
@@ -1276,7 +1277,7 @@ if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { | ||
case 38: | ||
_context.prev = 38; | ||
case 39: | ||
_context.prev = 39; | ||
if (!_didIteratorError2) { | ||
_context.next = 41; | ||
_context.next = 42; | ||
break; | ||
@@ -1287,26 +1288,26 @@ } | ||
case 41: | ||
return _context.finish(38); | ||
case 42: | ||
return _context.finish(35); | ||
return _context.finish(39); | ||
case 43: | ||
return _context.finish(36); | ||
case 44: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 14; | ||
_context.next = 15; | ||
break; | ||
case 46: | ||
_context.next = 52; | ||
case 47: | ||
_context.next = 53; | ||
break; | ||
case 48: | ||
_context.prev = 48; | ||
_context.t1 = _context["catch"](12); | ||
case 49: | ||
_context.prev = 49; | ||
_context.t1 = _context["catch"](13); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t1; | ||
case 52: | ||
_context.prev = 52; | ||
case 53: | ||
_context.prev = 53; | ||
_context.prev = 54; | ||
@@ -1317,7 +1318,7 @@ if (!_iteratorNormalCompletion && _iterator["return"] != null) { | ||
case 55: | ||
_context.prev = 55; | ||
case 56: | ||
_context.prev = 56; | ||
if (!_didIteratorError) { | ||
_context.next = 58; | ||
_context.next = 59; | ||
break; | ||
@@ -1328,9 +1329,18 @@ } | ||
case 58: | ||
return _context.finish(55); | ||
case 59: | ||
return _context.finish(52); | ||
return _context.finish(56); | ||
case 60: | ||
return _context.finish(53); | ||
case 61: | ||
_context.next = 66; | ||
break; | ||
case 63: | ||
_context.prev = 63; | ||
_context.t2 = _context["catch"](2); | ||
throw new Error("Could not set media sources. Received: ".concat(_context.t2.message)); | ||
case 66: | ||
case "end": | ||
@@ -1340,3 +1350,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[12, 48, 52, 60], [20, 31, 35, 43], [36,, 38, 42], [53,, 55, 59]]); | ||
}, _callee, this, [[2, 63], [13, 49, 53, 61], [21, 32, 36, 44], [37,, 39, 43], [54,, 56, 60]]); | ||
})); | ||
@@ -1351,2 +1361,55 @@ | ||
}, { | ||
key: "setOutputSource", | ||
value: function () { | ||
var _setOutputSource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(deviceId) { | ||
var _this$streamTargets$; | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
if (this.rtcSession.connection) { | ||
_context2.next = 2; | ||
break; | ||
} | ||
throw new Error('Could not set media sources. No active call ongoing.'); | ||
case 2: | ||
if ((_this$streamTargets$ = this.streamTargets[0]) === null || _this$streamTargets$ === void 0 ? void 0 : _this$streamTargets$.setSinkId) { | ||
_context2.next = 4; | ||
break; | ||
} | ||
throw new Error('Could not set media sources. Property setSinkId is not supported.'); | ||
case 4: | ||
_context2.prev = 4; | ||
this.streamTargets.forEach(function (target) { | ||
//@ts-ignore experimental tech | ||
target.setSinkId(deviceId); | ||
}); | ||
_context2.next = 11; | ||
break; | ||
case 8: | ||
_context2.prev = 8; | ||
_context2.t0 = _context2["catch"](4); | ||
throw new Error("Could not set media sources. setSinkId failed: ".concat(_context2.t0.message)); | ||
case 11: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this, [[4, 8]]); | ||
})); | ||
function setOutputSource(_x2) { | ||
return _setOutputSource.apply(this, arguments); | ||
} | ||
return setOutputSource; | ||
}() | ||
}, { | ||
key: "status", | ||
@@ -1589,2 +1652,7 @@ get: function get() { | ||
this.userAgent = new UserAgent(options); | ||
if (!options.refreshToken || typeof options.refreshToken !== 'function') { | ||
throw new Error('No `refreshToken` function passed to MessageBirdClient. This option is required to keep a connection to our platform in case the JWT expires.'); | ||
} | ||
this.userAgent.on('session', this.handleNewSession); | ||
@@ -1591,0 +1659,0 @@ } |
@@ -122,3 +122,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
_defineProperty(this, "handleMuteUnmute", function () { | ||
_this.eventEmitter.emit('mutedchange', _this.isMuted); | ||
_this.eventEmitter.emit('muted', _this.isMuted); | ||
}); | ||
@@ -201,14 +201,15 @@ | ||
case 2: | ||
_context.prev = 2; | ||
// Get the A/V track senders | ||
senders = this.rtcSession.connection.getSenders(); // Apply the desired media constraints | ||
_context.next = 5; | ||
_context.next = 6; | ||
return navigator.mediaDevices.getUserMedia(constraints); | ||
case 5: | ||
case 6: | ||
nextStream = _context.sent; | ||
_context.next = 8; | ||
_context.next = 9; | ||
return nextStream.getTracks(); | ||
case 8: | ||
case 9: | ||
nextTracks = _context.sent; | ||
@@ -219,8 +220,8 @@ // Iterate through the list of track senders | ||
_iteratorError = undefined; | ||
_context.prev = 12; | ||
_context.prev = 13; | ||
_iterator = senders[Symbol.iterator](); | ||
case 14: | ||
case 15: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 46; | ||
_context.next = 47; | ||
break; | ||
@@ -237,8 +238,8 @@ } | ||
_iteratorError2 = undefined; | ||
_context.prev = 20; | ||
_context.prev = 21; | ||
_iterator2 = nextTracks[Symbol.iterator](); | ||
case 22: | ||
case 23: | ||
if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { | ||
_context.next = 29; | ||
_context.next = 30; | ||
break; | ||
@@ -248,23 +249,23 @@ } | ||
track = _step2.value; | ||
_context.next = 26; | ||
_context.next = 27; | ||
return sender.replaceTrack(track); | ||
case 26: | ||
case 27: | ||
_iteratorNormalCompletion2 = true; | ||
_context.next = 22; | ||
_context.next = 23; | ||
break; | ||
case 29: | ||
_context.next = 35; | ||
case 30: | ||
_context.next = 36; | ||
break; | ||
case 31: | ||
_context.prev = 31; | ||
_context.t0 = _context["catch"](20); | ||
case 32: | ||
_context.prev = 32; | ||
_context.t0 = _context["catch"](21); | ||
_didIteratorError2 = true; | ||
_iteratorError2 = _context.t0; | ||
case 35: | ||
_context.prev = 35; | ||
case 36: | ||
_context.prev = 36; | ||
_context.prev = 37; | ||
@@ -275,7 +276,7 @@ if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { | ||
case 38: | ||
_context.prev = 38; | ||
case 39: | ||
_context.prev = 39; | ||
if (!_didIteratorError2) { | ||
_context.next = 41; | ||
_context.next = 42; | ||
break; | ||
@@ -286,26 +287,26 @@ } | ||
case 41: | ||
return _context.finish(38); | ||
case 42: | ||
return _context.finish(35); | ||
return _context.finish(39); | ||
case 43: | ||
return _context.finish(36); | ||
case 44: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 14; | ||
_context.next = 15; | ||
break; | ||
case 46: | ||
_context.next = 52; | ||
case 47: | ||
_context.next = 53; | ||
break; | ||
case 48: | ||
_context.prev = 48; | ||
_context.t1 = _context["catch"](12); | ||
case 49: | ||
_context.prev = 49; | ||
_context.t1 = _context["catch"](13); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t1; | ||
case 52: | ||
_context.prev = 52; | ||
case 53: | ||
_context.prev = 53; | ||
_context.prev = 54; | ||
@@ -316,7 +317,7 @@ if (!_iteratorNormalCompletion && _iterator["return"] != null) { | ||
case 55: | ||
_context.prev = 55; | ||
case 56: | ||
_context.prev = 56; | ||
if (!_didIteratorError) { | ||
_context.next = 58; | ||
_context.next = 59; | ||
break; | ||
@@ -327,9 +328,18 @@ } | ||
case 58: | ||
return _context.finish(55); | ||
case 59: | ||
return _context.finish(52); | ||
return _context.finish(56); | ||
case 60: | ||
return _context.finish(53); | ||
case 61: | ||
_context.next = 66; | ||
break; | ||
case 63: | ||
_context.prev = 63; | ||
_context.t2 = _context["catch"](2); | ||
throw new Error("Could not set media sources. Received: ".concat(_context.t2.message)); | ||
case 66: | ||
case "end": | ||
@@ -339,3 +349,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[12, 48, 52, 60], [20, 31, 35, 43], [36,, 38, 42], [53,, 55, 59]]); | ||
}, _callee, this, [[2, 63], [13, 49, 53, 61], [21, 32, 36, 44], [37,, 39, 43], [54,, 56, 60]]); | ||
})); | ||
@@ -350,2 +360,55 @@ | ||
}, { | ||
key: "setOutputSource", | ||
value: function () { | ||
var _setOutputSource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(deviceId) { | ||
var _this$streamTargets$; | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
if (this.rtcSession.connection) { | ||
_context2.next = 2; | ||
break; | ||
} | ||
throw new Error('Could not set media sources. No active call ongoing.'); | ||
case 2: | ||
if ((_this$streamTargets$ = this.streamTargets[0]) === null || _this$streamTargets$ === void 0 ? void 0 : _this$streamTargets$.setSinkId) { | ||
_context2.next = 4; | ||
break; | ||
} | ||
throw new Error('Could not set media sources. Property setSinkId is not supported.'); | ||
case 4: | ||
_context2.prev = 4; | ||
this.streamTargets.forEach(function (target) { | ||
//@ts-ignore experimental tech | ||
target.setSinkId(deviceId); | ||
}); | ||
_context2.next = 11; | ||
break; | ||
case 8: | ||
_context2.prev = 8; | ||
_context2.t0 = _context2["catch"](4); | ||
throw new Error("Could not set media sources. setSinkId failed: ".concat(_context2.t0.message)); | ||
case 11: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this, [[4, 8]]); | ||
})); | ||
function setOutputSource(_x2) { | ||
return _setOutputSource.apply(this, arguments); | ||
} | ||
return setOutputSource; | ||
}() | ||
}, { | ||
key: "status", | ||
@@ -352,0 +415,0 @@ get: function get() { |
@@ -19,3 +19,3 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
export function getSDKVersionHeader() { | ||
var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "4b77b9cb" || 'HEAD'; | ||
var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "93ee7610" || 'HEAD'; | ||
return "SDK-Version: ".concat(version); | ||
@@ -22,0 +22,0 @@ } |
@@ -37,2 +37,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
this.userAgent = new UserAgent(options); | ||
if (!options.refreshToken || typeof options.refreshToken !== 'function') { | ||
throw new Error('No `refreshToken` function passed to MessageBirdClient. This option is required to keep a connection to our platform in case the JWT expires.'); | ||
} | ||
this.userAgent.on('session', this.handleNewSession); | ||
@@ -39,0 +44,0 @@ } |
@@ -16,3 +16,3 @@ import { RTCSession as SipRTCSession, AnswerOptions } from 'jssip'; | ||
on(name: 'error', cb: (data: CallError) => void): void; | ||
on(name: 'mutedchange', cb: (muted: boolean) => void): void; | ||
on(name: 'muted', cb: (muted: boolean) => void): void; | ||
removeEventlistener(name: string, cb: (...args: any) => void): void; | ||
@@ -40,2 +40,3 @@ addTrackListener: () => void; | ||
setInputSource(constraints: MediaStreamConstraints): Promise<void>; | ||
setOutputSource(deviceId: string): Promise<void>; | ||
} |
@@ -55,3 +55,3 @@ export interface TurnConfig { | ||
} | ||
export declare type StreamTargets = HTMLVideoElement[]; | ||
export declare type StreamTargets = HTMLAudioElement[]; | ||
export {}; |
export declare function createStreamTarget(stream: MediaStream): HTMLVideoElement; | ||
export declare function removeStreamTarget(target: HTMLVideoElement): void; | ||
export declare function removeStreamTarget(target: HTMLAudioElement): void; |
@@ -45,3 +45,3 @@ import { UA, WebSocketInterface, debug } from 'jssip'; | ||
function getSDKVersionHeader() { | ||
var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "4b77b9cb" ; | ||
var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "93ee7610" ; | ||
return "SDK-Version: ".concat(version); | ||
@@ -1095,3 +1095,3 @@ } | ||
_defineProperty(this, "handleMuteUnmute", function () { | ||
_this.eventEmitter.emit('mutedchange', _this.isMuted); | ||
_this.eventEmitter.emit('muted', _this.isMuted); | ||
}); | ||
@@ -1174,14 +1174,15 @@ | ||
case 2: | ||
_context.prev = 2; | ||
// Get the A/V track senders | ||
senders = this.rtcSession.connection.getSenders(); // Apply the desired media constraints | ||
_context.next = 5; | ||
_context.next = 6; | ||
return navigator.mediaDevices.getUserMedia(constraints); | ||
case 5: | ||
case 6: | ||
nextStream = _context.sent; | ||
_context.next = 8; | ||
_context.next = 9; | ||
return nextStream.getTracks(); | ||
case 8: | ||
case 9: | ||
nextTracks = _context.sent; | ||
@@ -1192,8 +1193,8 @@ // Iterate through the list of track senders | ||
_iteratorError = undefined; | ||
_context.prev = 12; | ||
_context.prev = 13; | ||
_iterator = senders[Symbol.iterator](); | ||
case 14: | ||
case 15: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 46; | ||
_context.next = 47; | ||
break; | ||
@@ -1210,8 +1211,8 @@ } | ||
_iteratorError2 = undefined; | ||
_context.prev = 20; | ||
_context.prev = 21; | ||
_iterator2 = nextTracks[Symbol.iterator](); | ||
case 22: | ||
case 23: | ||
if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { | ||
_context.next = 29; | ||
_context.next = 30; | ||
break; | ||
@@ -1221,23 +1222,23 @@ } | ||
track = _step2.value; | ||
_context.next = 26; | ||
_context.next = 27; | ||
return sender.replaceTrack(track); | ||
case 26: | ||
case 27: | ||
_iteratorNormalCompletion2 = true; | ||
_context.next = 22; | ||
_context.next = 23; | ||
break; | ||
case 29: | ||
_context.next = 35; | ||
case 30: | ||
_context.next = 36; | ||
break; | ||
case 31: | ||
_context.prev = 31; | ||
_context.t0 = _context["catch"](20); | ||
case 32: | ||
_context.prev = 32; | ||
_context.t0 = _context["catch"](21); | ||
_didIteratorError2 = true; | ||
_iteratorError2 = _context.t0; | ||
case 35: | ||
_context.prev = 35; | ||
case 36: | ||
_context.prev = 36; | ||
_context.prev = 37; | ||
@@ -1248,7 +1249,7 @@ if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { | ||
case 38: | ||
_context.prev = 38; | ||
case 39: | ||
_context.prev = 39; | ||
if (!_didIteratorError2) { | ||
_context.next = 41; | ||
_context.next = 42; | ||
break; | ||
@@ -1259,26 +1260,26 @@ } | ||
case 41: | ||
return _context.finish(38); | ||
case 42: | ||
return _context.finish(35); | ||
return _context.finish(39); | ||
case 43: | ||
return _context.finish(36); | ||
case 44: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 14; | ||
_context.next = 15; | ||
break; | ||
case 46: | ||
_context.next = 52; | ||
case 47: | ||
_context.next = 53; | ||
break; | ||
case 48: | ||
_context.prev = 48; | ||
_context.t1 = _context["catch"](12); | ||
case 49: | ||
_context.prev = 49; | ||
_context.t1 = _context["catch"](13); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t1; | ||
case 52: | ||
_context.prev = 52; | ||
case 53: | ||
_context.prev = 53; | ||
_context.prev = 54; | ||
@@ -1289,7 +1290,7 @@ if (!_iteratorNormalCompletion && _iterator["return"] != null) { | ||
case 55: | ||
_context.prev = 55; | ||
case 56: | ||
_context.prev = 56; | ||
if (!_didIteratorError) { | ||
_context.next = 58; | ||
_context.next = 59; | ||
break; | ||
@@ -1300,9 +1301,18 @@ } | ||
case 58: | ||
return _context.finish(55); | ||
case 59: | ||
return _context.finish(52); | ||
return _context.finish(56); | ||
case 60: | ||
return _context.finish(53); | ||
case 61: | ||
_context.next = 66; | ||
break; | ||
case 63: | ||
_context.prev = 63; | ||
_context.t2 = _context["catch"](2); | ||
throw new Error("Could not set media sources. Received: ".concat(_context.t2.message)); | ||
case 66: | ||
case "end": | ||
@@ -1312,3 +1322,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[12, 48, 52, 60], [20, 31, 35, 43], [36,, 38, 42], [53,, 55, 59]]); | ||
}, _callee, this, [[2, 63], [13, 49, 53, 61], [21, 32, 36, 44], [37,, 39, 43], [54,, 56, 60]]); | ||
})); | ||
@@ -1323,2 +1333,55 @@ | ||
}, { | ||
key: "setOutputSource", | ||
value: function () { | ||
var _setOutputSource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(deviceId) { | ||
var _this$streamTargets$; | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
if (this.rtcSession.connection) { | ||
_context2.next = 2; | ||
break; | ||
} | ||
throw new Error('Could not set media sources. No active call ongoing.'); | ||
case 2: | ||
if ((_this$streamTargets$ = this.streamTargets[0]) === null || _this$streamTargets$ === void 0 ? void 0 : _this$streamTargets$.setSinkId) { | ||
_context2.next = 4; | ||
break; | ||
} | ||
throw new Error('Could not set media sources. Property setSinkId is not supported.'); | ||
case 4: | ||
_context2.prev = 4; | ||
this.streamTargets.forEach(function (target) { | ||
//@ts-ignore experimental tech | ||
target.setSinkId(deviceId); | ||
}); | ||
_context2.next = 11; | ||
break; | ||
case 8: | ||
_context2.prev = 8; | ||
_context2.t0 = _context2["catch"](4); | ||
throw new Error("Could not set media sources. setSinkId failed: ".concat(_context2.t0.message)); | ||
case 11: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this, [[4, 8]]); | ||
})); | ||
function setOutputSource(_x2) { | ||
return _setOutputSource.apply(this, arguments); | ||
} | ||
return setOutputSource; | ||
}() | ||
}, { | ||
key: "status", | ||
@@ -1561,2 +1624,7 @@ get: function get() { | ||
this.userAgent = new UserAgent(options); | ||
if (!options.refreshToken || typeof options.refreshToken !== 'function') { | ||
throw new Error('No `refreshToken` function passed to MessageBirdClient. This option is required to keep a connection to our platform in case the JWT expires.'); | ||
} | ||
this.userAgent.on('session', this.handleNewSession); | ||
@@ -1563,0 +1631,0 @@ } |
{ | ||
"name": "@messagebird/client", | ||
"version": "1.0.0-next-rc.7", | ||
"version": "1.0.0-next-rc.8", | ||
"license": "UNLICENSED", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
472557
5098