@webex/calling 3.8.1 → 3.9.0-multi-llms.2
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.
- package/dist/CallHistory/CallHistory.js +51 -46
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +146 -147
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +8 -8
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +1 -1
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +12 -11
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +9 -10
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +68 -61
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +168 -102
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallSettings/testFixtures.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +530 -219
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +500 -291
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/callRecordFixtures.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
- package/dist/CallingClient/calling/call.js +369 -333
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +411 -410
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +3 -4
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +67 -68
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/index.js.map +1 -1
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +11 -8
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +10 -11
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +12 -17
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/index.js.map +1 -1
- package/dist/CallingClient/registration/register.js +557 -442
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +526 -395
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +116 -0
- package/dist/CallingClient/registration/webWorker.js.map +1 -0
- package/dist/CallingClient/registration/webWorker.test.js +256 -0
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -0
- package/dist/CallingClient/registration/webWorkerStr.js +15 -0
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -0
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +142 -0
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +244 -238
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +89 -90
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/constants.js +2 -2
- package/dist/Contacts/constants.js.map +1 -1
- package/dist/Contacts/contactFixtures.js.map +1 -1
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +2 -2
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +3 -3
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +2 -2
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Errors/index.js.map +1 -1
- package/dist/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/impl/index.js +2 -2
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Logger/index.js.map +1 -1
- package/dist/Logger/index.test.js.map +1 -1
- package/dist/Logger/types.js.map +1 -1
- package/dist/Metrics/index.js +175 -86
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +70 -4
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +15 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/index.js +0 -1
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/index.test.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/SDKConnector/utils.js.map +1 -1
- package/dist/SDKConnector/utils.test.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +54 -47
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +12 -11
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +2 -2
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +78 -70
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/constants.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/Voicemail/voicemailFixture.js.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +125 -99
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +283 -143
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +1 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +8 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +4 -0
- package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
- package/dist/module/CallSettings/WxCallBackendConnector.js +8 -1
- package/dist/module/CallingClient/CallingClient.js +199 -42
- package/dist/module/CallingClient/calling/call.js +79 -43
- package/dist/module/CallingClient/constants.js +10 -6
- package/dist/module/CallingClient/line/index.js +3 -3
- package/dist/module/CallingClient/registration/register.js +111 -72
- package/dist/module/CallingClient/registration/webWorker.js +60 -0
- package/dist/module/CallingClient/registration/webWorkerStr.js +93 -0
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
- package/dist/module/Contacts/ContactsClient.js +23 -17
- package/dist/module/Contacts/constants.js +1 -1
- package/dist/module/Errors/types.js +2 -0
- package/dist/module/Metrics/index.js +94 -33
- package/dist/module/Metrics/types.js +14 -0
- package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
- package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
- package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
- package/dist/module/common/Utils.js +37 -12
- package/dist/module/common/types.js +7 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/types.d.ts +1 -1
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +12 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +2 -1
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +10 -6
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +2 -2
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts +3 -0
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -0
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts +3 -0
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -0
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/constants.d.ts +1 -1
- package/dist/types/Contacts/constants.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +20 -4
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +13 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +10 -8
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
11
|
+
var _uuid = require("uuid");
|
|
12
|
+
var _types = require("../../common/types");
|
|
13
|
+
/* eslint-env worker */
|
|
14
|
+
|
|
15
|
+
var keepaliveTimer;
|
|
16
|
+
var messageHandler = function messageHandler(event) {
|
|
17
|
+
var type = event.data.type;
|
|
18
|
+
var postKeepAlive = /*#__PURE__*/function () {
|
|
19
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(accessToken, deviceUrl, url) {
|
|
20
|
+
var response;
|
|
21
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
_context.next = 2;
|
|
25
|
+
return fetch("".concat(url, "/status"), {
|
|
26
|
+
method: _types.HTTP_METHODS.POST,
|
|
27
|
+
headers: {
|
|
28
|
+
'cisco-device-url': deviceUrl,
|
|
29
|
+
'spark-user-agent': 'webex-calling/beta',
|
|
30
|
+
Authorization: "".concat(accessToken),
|
|
31
|
+
trackingId: "web_worker_".concat((0, _uuid.v4)())
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
case 2:
|
|
35
|
+
response = _context.sent;
|
|
36
|
+
if (response.ok) {
|
|
37
|
+
_context.next = 5;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
throw new Error("Keepalive failed with status: ".concat(response.status));
|
|
41
|
+
case 5:
|
|
42
|
+
return _context.abrupt("return", response);
|
|
43
|
+
case 6:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context.stop();
|
|
46
|
+
}
|
|
47
|
+
}, _callee);
|
|
48
|
+
}));
|
|
49
|
+
return function postKeepAlive(_x, _x2, _x3) {
|
|
50
|
+
return _ref.apply(this, arguments);
|
|
51
|
+
};
|
|
52
|
+
}();
|
|
53
|
+
if (type === _types.WorkerMessageType.START_KEEPALIVE) {
|
|
54
|
+
var keepAliveRetryCount = 0;
|
|
55
|
+
var _event$data = event.data,
|
|
56
|
+
accessToken = _event$data.accessToken,
|
|
57
|
+
deviceUrl = _event$data.deviceUrl,
|
|
58
|
+
interval = _event$data.interval,
|
|
59
|
+
retryCountThreshold = _event$data.retryCountThreshold,
|
|
60
|
+
url = _event$data.url;
|
|
61
|
+
if (keepaliveTimer) {
|
|
62
|
+
clearInterval(keepaliveTimer);
|
|
63
|
+
keepaliveTimer = undefined;
|
|
64
|
+
}
|
|
65
|
+
keepaliveTimer = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
66
|
+
var res, statusCode;
|
|
67
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
68
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
if (!(keepAliveRetryCount < retryCountThreshold)) {
|
|
71
|
+
_context2.next = 14;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
_context2.prev = 1;
|
|
75
|
+
_context2.next = 4;
|
|
76
|
+
return postKeepAlive(accessToken, deviceUrl, url);
|
|
77
|
+
case 4:
|
|
78
|
+
res = _context2.sent;
|
|
79
|
+
statusCode = res.status;
|
|
80
|
+
if (keepAliveRetryCount > 0) {
|
|
81
|
+
postMessage({
|
|
82
|
+
type: _types.WorkerMessageType.KEEPALIVE_SUCCESS,
|
|
83
|
+
statusCode: statusCode
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
keepAliveRetryCount = 0;
|
|
87
|
+
_context2.next = 14;
|
|
88
|
+
break;
|
|
89
|
+
case 10:
|
|
90
|
+
_context2.prev = 10;
|
|
91
|
+
_context2.t0 = _context2["catch"](1);
|
|
92
|
+
keepAliveRetryCount += 1;
|
|
93
|
+
postMessage({
|
|
94
|
+
type: _types.WorkerMessageType.KEEPALIVE_FAILURE,
|
|
95
|
+
err: _context2.t0,
|
|
96
|
+
keepAliveRetryCount: keepAliveRetryCount
|
|
97
|
+
});
|
|
98
|
+
case 14:
|
|
99
|
+
case "end":
|
|
100
|
+
return _context2.stop();
|
|
101
|
+
}
|
|
102
|
+
}, _callee2, null, [[1, 10]]);
|
|
103
|
+
})), interval * 1000);
|
|
104
|
+
}
|
|
105
|
+
if (type === _types.WorkerMessageType.CLEAR_KEEPALIVE) {
|
|
106
|
+
if (keepaliveTimer) {
|
|
107
|
+
clearInterval(keepaliveTimer);
|
|
108
|
+
keepaliveTimer = undefined;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// eslint-disable-next-line no-restricted-globals
|
|
114
|
+
self.addEventListener('message', messageHandler);
|
|
115
|
+
var _default = exports.default = messageHandler;
|
|
116
|
+
//# sourceMappingURL=webWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_uuid","require","_types","keepaliveTimer","messageHandler","event","type","data","postKeepAlive","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","accessToken","deviceUrl","url","response","wrap","_callee$","_context","prev","next","fetch","concat","method","HTTP_METHODS","POST","headers","Authorization","trackingId","uuid","sent","ok","Error","status","abrupt","stop","_x","_x2","_x3","apply","arguments","WorkerMessageType","START_KEEPALIVE","keepAliveRetryCount","_event$data","interval","retryCountThreshold","clearInterval","undefined","setInterval","_callee2","res","statusCode","_callee2$","_context2","postMessage","KEEPALIVE_SUCCESS","t0","KEEPALIVE_FAILURE","err","CLEAR_KEEPALIVE","self","addEventListener","_default","exports"],"sources":["webWorker.ts"],"sourcesContent":["/* eslint-env worker */\nimport {v4 as uuid} from 'uuid';\nimport {HTTP_METHODS, KeepaliveStatusMessage, WorkerMessageType} from '../../common/types';\n\nlet keepaliveTimer: NodeJS.Timeout | undefined;\n\nconst messageHandler = (event: MessageEvent) => {\n const {type} = event.data;\n\n const postKeepAlive = async (accessToken: string, deviceUrl: string, url: string) => {\n const response = await fetch(`${url}/status`, {\n method: HTTP_METHODS.POST,\n headers: {\n 'cisco-device-url': deviceUrl,\n 'spark-user-agent': 'webex-calling/beta',\n Authorization: `${accessToken}`,\n trackingId: `web_worker_${uuid()}`,\n },\n });\n\n if (!response.ok) {\n throw new Error(`Keepalive failed with status: ${response.status}`);\n }\n\n return response;\n };\n\n if (type === WorkerMessageType.START_KEEPALIVE) {\n let keepAliveRetryCount = 0;\n const {accessToken, deviceUrl, interval, retryCountThreshold, url} = event.data;\n\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n\n keepaliveTimer = setInterval(async () => {\n if (keepAliveRetryCount < retryCountThreshold) {\n try {\n const res = await postKeepAlive(accessToken, deviceUrl, url);\n const statusCode = res.status;\n if (keepAliveRetryCount > 0) {\n postMessage({\n type: WorkerMessageType.KEEPALIVE_SUCCESS,\n statusCode,\n } as KeepaliveStatusMessage);\n }\n keepAliveRetryCount = 0;\n } catch (err: unknown) {\n keepAliveRetryCount += 1;\n postMessage({\n type: WorkerMessageType.KEEPALIVE_FAILURE,\n err,\n keepAliveRetryCount,\n } as KeepaliveStatusMessage);\n }\n }\n }, interval * 1000);\n }\n\n if (type === WorkerMessageType.CLEAR_KEEPALIVE) {\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n }\n};\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('message', messageHandler);\nexport default messageHandler;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAFA;;AAIA,IAAIE,cAA0C;AAE9C,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,KAAmB,EAAK;EAC9C,IAAOC,IAAI,GAAID,KAAK,CAACE,IAAI,CAAlBD,IAAI;EAEX,IAAME,aAAa;IAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,eAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAG,SAAAC,QAAOC,WAAmB,EAAEC,SAAiB,EAAEC,GAAW;MAAA,IAAAC,QAAA;MAAA,OAAAN,YAAA,CAAAD,OAAA,CAAAQ,IAAA,UAAAC,SAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;UAAA;YAAAF,QAAA,CAAAE,IAAA;YAAA,OACvDC,KAAK,IAAAC,MAAA,CAAIR,GAAG,cAAW;cAC5CS,MAAM,EAAEC,mBAAY,CAACC,IAAI;cACzBC,OAAO,EAAE;gBACP,kBAAkB,EAAEb,SAAS;gBAC7B,kBAAkB,EAAE,oBAAoB;gBACxCc,aAAa,KAAAL,MAAA,CAAKV,WAAW,CAAE;gBAC/BgB,UAAU,gBAAAN,MAAA,CAAgB,IAAAO,QAAI,EAAC,CAAC;cAClC;YACF,CAAC,CAAC;UAAA;YARId,QAAQ,GAAAG,QAAA,CAAAY,IAAA;YAAA,IAUTf,QAAQ,CAACgB,EAAE;cAAAb,QAAA,CAAAE,IAA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CAAAlC,IAAA;YAAA,OAEvBf,aAAa,CAACO,WAAW,EAAEC,SAAS,EAAEC,GAAG,CAAC;UAAA;YAAtDqC,GAAG,GAAAG,SAAA,CAAAxB,IAAA;YACHsB,UAAU,GAAGD,GAAG,CAAClB,MAAM;YAC7B,IAAIU,mBAAmB,GAAG,CAAC,EAAE;cAC3BY,WAAW,CAAC;gBACVpD,IAAI,EAAEsC,wBAAiB,CAACe,iBAAiB;gBACzCJ,UAAU,EAAVA;cACF,CAA2B,CAAC;YAC9B;YACAT,mBAAmB,GAAG,CAAC;YAACW,SAAA,CAAAlC,IAAA;YAAA;UAAA;YAAAkC,SAAA,CAAAnC,IAAA;YAAAmC,SAAA,CAAAG,EAAA,GAAAH,SAAA;YAExBX,mBAAmB,IAAI,CAAC;YACxBY,WAAW,CAAC;cACVpD,IAAI,EAAEsC,wBAAiB,CAACiB,iBAAiB;cACzCC,GAAG,EAAAL,SAAA,CAAAG,EAAA;cACHd,mBAAmB,EAAnBA;YACF,CAA2B,CAAC;UAAC;UAAA;YAAA,OAAAW,SAAA,CAAAnB,IAAA;QAAA;MAAA,GAAAe,QAAA;IAAA,CAGlC,IAAEL,QAAQ,GAAG,IAAI,CAAC;EACrB;EAEA,IAAI1C,IAAI,KAAKsC,wBAAiB,CAACmB,eAAe,EAAE;IAC9C,IAAI5D,cAAc,EAAE;MAClB+C,aAAa,CAAC/C,cAAc,CAAC;MAC7BA,cAAc,GAAGgD,SAAS;IAC5B;EACF;AACF,CAAC;;AAED;AACAa,IAAI,CAACC,gBAAgB,CAAC,SAAS,EAAE7D,cAAc,CAAC;AAAC,IAAA8D,QAAA,GAAAC,OAAA,CAAAxD,OAAA,GAClCP,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
4
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
5
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
6
|
+
var _uuid = require("uuid");
|
|
7
|
+
var _webWorker = _interopRequireDefault(require("./webWorker"));
|
|
8
|
+
var _types = require("../../common/types");
|
|
9
|
+
global.self = global;
|
|
10
|
+
jest.mock('uuid');
|
|
11
|
+
describe('webWorker', function () {
|
|
12
|
+
var postMessageSpy;
|
|
13
|
+
var capturedIntervalCallback;
|
|
14
|
+
var capturedIntervalTimer;
|
|
15
|
+
var clearIntervalSpy;
|
|
16
|
+
beforeEach(function () {
|
|
17
|
+
jest.useFakeTimers();
|
|
18
|
+
global.fetch = jest.fn();
|
|
19
|
+
_uuid.v4.mockReturnValue('mock-uuid');
|
|
20
|
+
postMessageSpy = jest.spyOn(global, 'postMessage').mockImplementation(function () {});
|
|
21
|
+
clearIntervalSpy = jest.spyOn(global, 'clearInterval');
|
|
22
|
+
|
|
23
|
+
// Overriding setInterval so that we capture the callback rather than schedule a timer
|
|
24
|
+
jest.spyOn(global, 'setInterval').mockImplementation(
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
|
+
function (callback, interval) {
|
|
27
|
+
capturedIntervalCallback = callback;
|
|
28
|
+
// Create a dummy timer object (could be any non-null value)
|
|
29
|
+
capturedIntervalTimer = {
|
|
30
|
+
dummy: true
|
|
31
|
+
};
|
|
32
|
+
return capturedIntervalTimer;
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
afterEach(function () {
|
|
36
|
+
jest.clearAllMocks();
|
|
37
|
+
jest.clearAllTimers();
|
|
38
|
+
jest.useRealTimers();
|
|
39
|
+
});
|
|
40
|
+
it('should start keepalive lifecycle correctly', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
41
|
+
var fakeSuccessResponse, fakeFailureRespponse;
|
|
42
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
fakeSuccessResponse = {
|
|
46
|
+
ok: true,
|
|
47
|
+
status: 200
|
|
48
|
+
};
|
|
49
|
+
global.fetch.mockResolvedValue(fakeSuccessResponse);
|
|
50
|
+
(0, _webWorker.default)({
|
|
51
|
+
data: {
|
|
52
|
+
type: _types.WorkerMessageType.START_KEEPALIVE,
|
|
53
|
+
accessToken: 'dummy',
|
|
54
|
+
deviceUrl: 'dummyDevice',
|
|
55
|
+
interval: 1,
|
|
56
|
+
retryCountThreshold: 3,
|
|
57
|
+
url: 'http://example.com'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Manually invoke the captured interval callback to simulate one tick
|
|
62
|
+
_context.next = 5;
|
|
63
|
+
return capturedIntervalCallback();
|
|
64
|
+
case 5:
|
|
65
|
+
expect(global.fetch.mock.calls.length).toBe(1);
|
|
66
|
+
expect(global.fetch).toHaveBeenCalledWith('http://example.com/status', {
|
|
67
|
+
method: 'POST',
|
|
68
|
+
headers: {
|
|
69
|
+
'cisco-device-url': 'dummyDevice',
|
|
70
|
+
'spark-user-agent': 'webex-calling/beta',
|
|
71
|
+
Authorization: 'dummy',
|
|
72
|
+
trackingId: 'web_worker_mock-uuid'
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
expect(postMessageSpy).not.toHaveBeenCalled();
|
|
76
|
+
fakeFailureRespponse = {
|
|
77
|
+
ok: false,
|
|
78
|
+
status: 401
|
|
79
|
+
};
|
|
80
|
+
global.fetch.mockResolvedValue(fakeFailureRespponse);
|
|
81
|
+
(0, _webWorker.default)({
|
|
82
|
+
data: {
|
|
83
|
+
type: _types.WorkerMessageType.START_KEEPALIVE,
|
|
84
|
+
accessToken: 'dummy',
|
|
85
|
+
deviceUrl: 'dummyDevice',
|
|
86
|
+
interval: 1,
|
|
87
|
+
retryCountThreshold: 3,
|
|
88
|
+
url: 'http://example.com'
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Manually invoke the captured interval callback to simulate one tick
|
|
93
|
+
_context.next = 13;
|
|
94
|
+
return capturedIntervalCallback();
|
|
95
|
+
case 13:
|
|
96
|
+
expect(global.fetch.mock.calls.length).toBe(2);
|
|
97
|
+
expect(postMessageSpy).toHaveBeenCalledWith({
|
|
98
|
+
err: new Error("Keepalive failed with status: 401"),
|
|
99
|
+
keepAliveRetryCount: 1,
|
|
100
|
+
type: 'KEEPALIVE_FAILURE'
|
|
101
|
+
});
|
|
102
|
+
case 15:
|
|
103
|
+
case "end":
|
|
104
|
+
return _context.stop();
|
|
105
|
+
}
|
|
106
|
+
}, _callee);
|
|
107
|
+
})));
|
|
108
|
+
it('should post KEEPALIVE_FAILURE when fetch fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
109
|
+
var mockError;
|
|
110
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
111
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
112
|
+
case 0:
|
|
113
|
+
mockError = new Error('Network error');
|
|
114
|
+
global.fetch.mockRejectedValue({
|
|
115
|
+
ok: false,
|
|
116
|
+
err: mockError,
|
|
117
|
+
status: 401
|
|
118
|
+
});
|
|
119
|
+
(0, _webWorker.default)({
|
|
120
|
+
data: {
|
|
121
|
+
type: _types.WorkerMessageType.START_KEEPALIVE,
|
|
122
|
+
accessToken: 'dummy',
|
|
123
|
+
deviceUrl: 'dummyDevice',
|
|
124
|
+
interval: 1,
|
|
125
|
+
retryCountThreshold: 1,
|
|
126
|
+
url: 'http://example.com'
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
_context2.next = 5;
|
|
130
|
+
return capturedIntervalCallback();
|
|
131
|
+
case 5:
|
|
132
|
+
expect(postMessageSpy).toHaveBeenCalledWith({
|
|
133
|
+
type: _types.WorkerMessageType.KEEPALIVE_FAILURE,
|
|
134
|
+
err: {
|
|
135
|
+
ok: false,
|
|
136
|
+
err: mockError,
|
|
137
|
+
status: 401
|
|
138
|
+
},
|
|
139
|
+
keepAliveRetryCount: 1
|
|
140
|
+
});
|
|
141
|
+
case 6:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context2.stop();
|
|
144
|
+
}
|
|
145
|
+
}, _callee2);
|
|
146
|
+
})));
|
|
147
|
+
it('should post KEEPALIVE_SUCCESS after a failure when fetch succeeds', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
148
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
149
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
// Set fetch so that first tick rejects (failure) and second tick resolves (success)
|
|
152
|
+
global.fetch.mockRejectedValueOnce(new Error('first failure')).mockResolvedValueOnce({
|
|
153
|
+
ok: true,
|
|
154
|
+
status: 200
|
|
155
|
+
});
|
|
156
|
+
(0, _webWorker.default)({
|
|
157
|
+
data: {
|
|
158
|
+
type: _types.WorkerMessageType.START_KEEPALIVE,
|
|
159
|
+
accessToken: 'dummy',
|
|
160
|
+
deviceUrl: 'dummyDevice',
|
|
161
|
+
interval: 1,
|
|
162
|
+
retryCountThreshold: 3,
|
|
163
|
+
url: 'http://example.com'
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// First tick: trigger failure
|
|
168
|
+
_context3.next = 4;
|
|
169
|
+
return capturedIntervalCallback();
|
|
170
|
+
case 4:
|
|
171
|
+
expect(postMessageSpy.mock.calls[0][0].type).toBe(_types.WorkerMessageType.KEEPALIVE_FAILURE);
|
|
172
|
+
|
|
173
|
+
// Second tick: trigger success.
|
|
174
|
+
_context3.next = 7;
|
|
175
|
+
return capturedIntervalCallback();
|
|
176
|
+
case 7:
|
|
177
|
+
expect(postMessageSpy.mock.calls[1][0].type).toBe(_types.WorkerMessageType.KEEPALIVE_SUCCESS);
|
|
178
|
+
expect(postMessageSpy.mock.calls[1][0].statusCode).toBe(200);
|
|
179
|
+
case 9:
|
|
180
|
+
case "end":
|
|
181
|
+
return _context3.stop();
|
|
182
|
+
}
|
|
183
|
+
}, _callee3);
|
|
184
|
+
})));
|
|
185
|
+
it('should clear keepalive timer on receiving CLEAR_KEEPALIVE message', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
186
|
+
var fakeSuccessResponse, startEvent;
|
|
187
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
188
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
189
|
+
case 0:
|
|
190
|
+
fakeSuccessResponse = {
|
|
191
|
+
ok: true,
|
|
192
|
+
status: 200
|
|
193
|
+
};
|
|
194
|
+
global.fetch.mockResolvedValue(fakeSuccessResponse);
|
|
195
|
+
startEvent = {
|
|
196
|
+
data: {
|
|
197
|
+
type: _types.WorkerMessageType.START_KEEPALIVE,
|
|
198
|
+
accessToken: 'dummy',
|
|
199
|
+
deviceUrl: 'dummyDevice',
|
|
200
|
+
interval: 1,
|
|
201
|
+
retryCountThreshold: 1,
|
|
202
|
+
url: 'http://example.com'
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
(0, _webWorker.default)(startEvent);
|
|
206
|
+
(0, _webWorker.default)({
|
|
207
|
+
data: {
|
|
208
|
+
type: _types.WorkerMessageType.CLEAR_KEEPALIVE
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
jest.advanceTimersByTime(3000);
|
|
212
|
+
expect(global.fetch.mock.calls.length).toBeLessThanOrEqual(3);
|
|
213
|
+
expect(clearIntervalSpy).toHaveBeenCalled();
|
|
214
|
+
case 8:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context4.stop();
|
|
217
|
+
}
|
|
218
|
+
}, _callee4);
|
|
219
|
+
})));
|
|
220
|
+
it('improve coverage: should not clear keepalive timer on receiving CLEAR_KEEPALIVE message without keepTimer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
221
|
+
var fakeSuccessResponse, startEvent;
|
|
222
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
223
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
224
|
+
case 0:
|
|
225
|
+
jest.spyOn(global, 'setInterval').mockReturnValue(undefined);
|
|
226
|
+
fakeSuccessResponse = {
|
|
227
|
+
ok: true,
|
|
228
|
+
status: 200
|
|
229
|
+
};
|
|
230
|
+
global.fetch.mockResolvedValue(fakeSuccessResponse);
|
|
231
|
+
startEvent = {
|
|
232
|
+
data: {
|
|
233
|
+
type: _types.WorkerMessageType.START_KEEPALIVE,
|
|
234
|
+
accessToken: 'dummy',
|
|
235
|
+
deviceUrl: 'dummyDevice',
|
|
236
|
+
interval: 1,
|
|
237
|
+
retryCountThreshold: 1,
|
|
238
|
+
url: 'http://example.com'
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
(0, _webWorker.default)(startEvent);
|
|
242
|
+
(0, _webWorker.default)({
|
|
243
|
+
data: {
|
|
244
|
+
type: _types.WorkerMessageType.CLEAR_KEEPALIVE
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
jest.advanceTimersByTime(3000);
|
|
248
|
+
expect(clearIntervalSpy).not.toHaveBeenCalled();
|
|
249
|
+
case 8:
|
|
250
|
+
case "end":
|
|
251
|
+
return _context5.stop();
|
|
252
|
+
}
|
|
253
|
+
}, _callee5);
|
|
254
|
+
})));
|
|
255
|
+
});
|
|
256
|
+
//# sourceMappingURL=webWorker.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_uuid","require","_webWorker","_interopRequireDefault","_types","global","self","jest","mock","describe","postMessageSpy","capturedIntervalCallback","capturedIntervalTimer","clearIntervalSpy","beforeEach","useFakeTimers","fetch","fn","uuid","mockReturnValue","spyOn","mockImplementation","callback","interval","dummy","afterEach","clearAllMocks","clearAllTimers","useRealTimers","it","_asyncToGenerator2","default","_regenerator","mark","_callee","fakeSuccessResponse","fakeFailureRespponse","wrap","_callee$","_context","prev","next","ok","status","mockResolvedValue","messageHandler","data","type","WorkerMessageType","START_KEEPALIVE","accessToken","deviceUrl","retryCountThreshold","url","expect","calls","length","toBe","toHaveBeenCalledWith","method","headers","Authorization","trackingId","not","toHaveBeenCalled","err","Error","keepAliveRetryCount","stop","_callee2","mockError","_callee2$","_context2","mockRejectedValue","KEEPALIVE_FAILURE","_callee3","_callee3$","_context3","mockRejectedValueOnce","mockResolvedValueOnce","KEEPALIVE_SUCCESS","statusCode","_callee4","startEvent","_callee4$","_context4","CLEAR_KEEPALIVE","advanceTimersByTime","toBeLessThanOrEqual","_callee5","_callee5$","_context5","undefined"],"sources":["webWorker.test.ts"],"sourcesContent":["import {v4 as uuid} from 'uuid';\nimport messageHandler from './webWorker';\nimport {WorkerMessageType} from '../../common/types';\n\n(global as any).self = global;\n\njest.mock('uuid');\n\ndescribe('webWorker', () => {\n let postMessageSpy: jest.SpyInstance;\n let capturedIntervalCallback: any;\n let capturedIntervalTimer: any;\n let clearIntervalSpy: jest.SpyInstance;\n\n beforeEach(() => {\n jest.useFakeTimers();\n global.fetch = jest.fn();\n (uuid as jest.Mock).mockReturnValue('mock-uuid');\n\n postMessageSpy = jest.spyOn(global, 'postMessage').mockImplementation(() => {});\n clearIntervalSpy = jest.spyOn(global, 'clearInterval');\n\n // Overriding setInterval so that we capture the callback rather than schedule a timer\n jest.spyOn(global, 'setInterval').mockImplementation(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (callback: any, interval: number): NodeJS.Timeout => {\n capturedIntervalCallback = callback;\n // Create a dummy timer object (could be any non-null value)\n capturedIntervalTimer = {dummy: true};\n\n return capturedIntervalTimer as NodeJS.Timeout;\n }\n );\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n jest.clearAllTimers();\n jest.useRealTimers();\n });\n\n it('should start keepalive lifecycle correctly', async () => {\n const fakeSuccessResponse = {ok: true, status: 200};\n (global.fetch as jest.Mock).mockResolvedValue(fakeSuccessResponse);\n\n messageHandler({\n data: {\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: 'dummy',\n deviceUrl: 'dummyDevice',\n interval: 1,\n retryCountThreshold: 3,\n url: 'http://example.com',\n },\n } as MessageEvent);\n\n // Manually invoke the captured interval callback to simulate one tick\n await capturedIntervalCallback();\n\n expect((global.fetch as jest.Mock).mock.calls.length).toBe(1);\n expect(global.fetch).toHaveBeenCalledWith('http://example.com/status', {\n method: 'POST',\n headers: {\n 'cisco-device-url': 'dummyDevice',\n 'spark-user-agent': 'webex-calling/beta',\n Authorization: 'dummy',\n trackingId: 'web_worker_mock-uuid',\n },\n });\n expect(postMessageSpy).not.toHaveBeenCalled();\n\n const fakeFailureRespponse = {ok: false, status: 401};\n (global.fetch as jest.Mock).mockResolvedValue(fakeFailureRespponse);\n\n messageHandler({\n data: {\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: 'dummy',\n deviceUrl: 'dummyDevice',\n interval: 1,\n retryCountThreshold: 3,\n url: 'http://example.com',\n },\n } as MessageEvent);\n\n // Manually invoke the captured interval callback to simulate one tick\n await capturedIntervalCallback();\n\n expect((global.fetch as jest.Mock).mock.calls.length).toBe(2);\n expect(postMessageSpy).toHaveBeenCalledWith({\n err: new Error(`Keepalive failed with status: 401`),\n keepAliveRetryCount: 1,\n type: 'KEEPALIVE_FAILURE',\n });\n });\n\n it('should post KEEPALIVE_FAILURE when fetch fails', async () => {\n const mockError = new Error('Network error');\n (global.fetch as jest.Mock).mockRejectedValue({\n ok: false,\n err: mockError,\n status: 401,\n });\n\n messageHandler({\n data: {\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: 'dummy',\n deviceUrl: 'dummyDevice',\n interval: 1,\n retryCountThreshold: 1,\n url: 'http://example.com',\n },\n } as MessageEvent);\n\n await capturedIntervalCallback();\n\n expect(postMessageSpy).toHaveBeenCalledWith({\n type: WorkerMessageType.KEEPALIVE_FAILURE,\n err: {\n ok: false,\n err: mockError,\n status: 401,\n },\n keepAliveRetryCount: 1,\n });\n });\n\n it('should post KEEPALIVE_SUCCESS after a failure when fetch succeeds', async () => {\n // Set fetch so that first tick rejects (failure) and second tick resolves (success)\n (global.fetch as jest.Mock)\n .mockRejectedValueOnce(new Error('first failure'))\n .mockResolvedValueOnce({ok: true, status: 200});\n\n messageHandler({\n data: {\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: 'dummy',\n deviceUrl: 'dummyDevice',\n interval: 1,\n retryCountThreshold: 3,\n url: 'http://example.com',\n },\n } as MessageEvent);\n\n // First tick: trigger failure\n await capturedIntervalCallback();\n expect(postMessageSpy.mock.calls[0][0].type).toBe(WorkerMessageType.KEEPALIVE_FAILURE);\n\n // Second tick: trigger success.\n await capturedIntervalCallback();\n expect(postMessageSpy.mock.calls[1][0].type).toBe(WorkerMessageType.KEEPALIVE_SUCCESS);\n expect(postMessageSpy.mock.calls[1][0].statusCode).toBe(200);\n });\n\n it('should clear keepalive timer on receiving CLEAR_KEEPALIVE message', async () => {\n const fakeSuccessResponse = {ok: true, status: 200};\n (global.fetch as jest.Mock).mockResolvedValue(fakeSuccessResponse);\n\n const startEvent = {\n data: {\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: 'dummy',\n deviceUrl: 'dummyDevice',\n interval: 1,\n retryCountThreshold: 1,\n url: 'http://example.com',\n },\n };\n\n messageHandler(startEvent as MessageEvent);\n messageHandler({data: {type: WorkerMessageType.CLEAR_KEEPALIVE}} as MessageEvent);\n\n jest.advanceTimersByTime(3000);\n expect((global.fetch as jest.Mock).mock.calls.length).toBeLessThanOrEqual(3);\n expect(clearIntervalSpy).toHaveBeenCalled();\n });\n\n it('improve coverage: should not clear keepalive timer on receiving CLEAR_KEEPALIVE message without keepTimer', async () => {\n jest.spyOn(global, 'setInterval').mockReturnValue(undefined);\n const fakeSuccessResponse = {ok: true, status: 200};\n (global.fetch as jest.Mock).mockResolvedValue(fakeSuccessResponse);\n\n const startEvent = {\n data: {\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: 'dummy',\n deviceUrl: 'dummyDevice',\n interval: 1,\n retryCountThreshold: 1,\n url: 'http://example.com',\n },\n };\n\n messageHandler(startEvent as MessageEvent);\n messageHandler({data: {type: WorkerMessageType.CLEAR_KEEPALIVE}} as MessageEvent);\n\n jest.advanceTimersByTime(3000);\n expect(clearIntervalSpy).not.toHaveBeenCalled();\n });\n});\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAECI,MAAM,CAASC,IAAI,GAAGD,MAAM;AAE7BE,IAAI,CAACC,IAAI,CAAC,MAAM,CAAC;AAEjBC,QAAQ,CAAC,WAAW,EAAE,YAAM;EAC1B,IAAIC,cAAgC;EACpC,IAAIC,wBAA6B;EACjC,IAAIC,qBAA0B;EAC9B,IAAIC,gBAAkC;EAEtCC,UAAU,CAAC,YAAM;IACfP,IAAI,CAACQ,aAAa,CAAC,CAAC;IACpBV,MAAM,CAACW,KAAK,GAAGT,IAAI,CAACU,EAAE,CAAC,CAAC;IACvBC,QAAI,CAAeC,eAAe,CAAC,WAAW,CAAC;IAEhDT,cAAc,GAAGH,IAAI,CAACa,KAAK,CAACf,MAAM,EAAE,aAAa,CAAC,CAACgB,kBAAkB,CAAC,YAAM,CAAC,CAAC,CAAC;IAC/ER,gBAAgB,GAAGN,IAAI,CAACa,KAAK,CAACf,MAAM,EAAE,eAAe,CAAC;;IAEtD;IACAE,IAAI,CAACa,KAAK,CAACf,MAAM,EAAE,aAAa,CAAC,CAACgB,kBAAkB;IAClD;IACA,UAACC,QAAa,EAAEC,QAAgB,EAAqB;MACnDZ,wBAAwB,GAAGW,QAAQ;MACnC;MACAV,qBAAqB,GAAG;QAACY,KAAK,EAAE;MAAI,CAAC;MAErC,OAAOZ,qBAAqB;IAC9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AC;UACtDzD,mBAAmB,GAAG;YAACO,EAAE,EAAE,IAAI;YAAEC,MAAM,EAAE;UAAG,CAAC;UAClDtC,MAAM,CAACW,KAAK,CAAe4B,iBAAiB,CAACT,mBAAmB,CAAC;UAE5DgD,UAAU,GAAG;YACjBrC,IAAI,EAAE;cACJC,IAAI,EAAEC,wBAAiB,CAACC,eAAe;cACvCC,WAAW,EAAE,OAAO;cACpBC,SAAS,EAAE,aAAa;cACxB5B,QAAQ,EAAE,CAAC;cACX6B,mBAAmB,EAAE,CAAC;cACtBC,GAAG,EAAE;YACP;UACF,CAAC;UAED,IAAAR,kBAAc,EAACsC,UAA0B,CAAC;UAC1C,IAAAtC,kBAAc,EAAC;YAACC,IAAI,EAAE;cAACC,IAAI,EAAEC,wBAAiB,CAACsC;YAAe;UAAC,CAAiB,CAAC;UAEjF/E,IAAI,CAACgF,mBAAmB,CAAC,IAAI,CAAC;UAC9BjC,MAAM,CAACzC,gBAAgB,CAAC,CAACkD,GAAG,CAACC,gBAAgB,CAAC,CAAC;QAAC;QAAA;UAAA,OAAA2B,SAAA,CAAAvB,IAAA;MAAA;IAAA,GAAAqB,QAAA;EAAA,CACjD,GAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* This file contains the stringified version of the web worker code from webWorker.ts
|
|
10
|
+
* It can be used to create a Blob URL for the worker instead of loading it from a separate file
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var webWorkerStr = "/* eslint-env worker */\n\nconst uuid = () => {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n};\n\n// Enum values from the original imports\nconst HTTP_METHODS = {\n GET: 'GET',\n POST: 'POST',\n PUT: 'PUT',\n DELETE: 'DELETE',\n PATCH: 'PATCH',\n};\n\nconst WorkerMessageType = {\n START_KEEPALIVE: 'START_KEEPALIVE',\n CLEAR_KEEPALIVE: 'CLEAR_KEEPALIVE',\n KEEPALIVE_SUCCESS: 'KEEPALIVE_SUCCESS',\n KEEPALIVE_FAILURE: 'KEEPALIVE_FAILURE',\n};\n\nlet keepaliveTimer;\n\nconst messageHandler = (event) => {\n const {type} = event.data;\n\n const postKeepAlive = async (accessToken, deviceUrl, url) => {\n const response = await fetch(`${url}/status`, {\n method: HTTP_METHODS.POST,\n headers: {\n 'cisco-device-url': deviceUrl,\n 'spark-user-agent': 'webex-calling/beta',\n Authorization: `${accessToken}`,\n trackingId: `web_worker_${uuid()}`,\n },\n });\n\n if (!response.ok) {\n throw new Error(`Keepalive failed with status: ${response.status}`);\n }\n\n return response;\n };\n\n if (type === WorkerMessageType.START_KEEPALIVE) {\n let keepAliveRetryCount = 0;\n const {accessToken, deviceUrl, interval, retryCountThreshold, url} = event.data;\n\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n\n keepaliveTimer = setInterval(async () => {\n if (keepAliveRetryCount < retryCountThreshold) {\n try {\n const res = await postKeepAlive(accessToken, deviceUrl, url);\n const statusCode = res.status;\n if (keepAliveRetryCount > 0) {\n self.postMessage({\n type: WorkerMessageType.KEEPALIVE_SUCCESS,\n statusCode,\n });\n }\n keepAliveRetryCount = 0;\n } catch (err) {\n keepAliveRetryCount += 1;\n self.postMessage({\n type: WorkerMessageType.KEEPALIVE_FAILURE,\n err,\n keepAliveRetryCount,\n });\n }\n }\n }, interval * 1000);\n }\n\n if (type === WorkerMessageType.CLEAR_KEEPALIVE) {\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n }\n};\n\nself.addEventListener('message', messageHandler);\n";
|
|
14
|
+
var _default = exports.default = webWorkerStr;
|
|
15
|
+
//# sourceMappingURL=webWorkerStr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["webWorkerStr","_default","exports","default"],"sources":["webWorkerStr.ts"],"sourcesContent":["/**\n * This file contains the stringified version of the web worker code from webWorker.ts\n * It can be used to create a Blob URL for the worker instead of loading it from a separate file\n */\n\nconst webWorkerStr = `/* eslint-env worker */\n\nconst uuid = () => {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n};\n\n// Enum values from the original imports\nconst HTTP_METHODS = {\n GET: 'GET',\n POST: 'POST',\n PUT: 'PUT',\n DELETE: 'DELETE',\n PATCH: 'PATCH',\n};\n\nconst WorkerMessageType = {\n START_KEEPALIVE: 'START_KEEPALIVE',\n CLEAR_KEEPALIVE: 'CLEAR_KEEPALIVE',\n KEEPALIVE_SUCCESS: 'KEEPALIVE_SUCCESS',\n KEEPALIVE_FAILURE: 'KEEPALIVE_FAILURE',\n};\n\nlet keepaliveTimer;\n\nconst messageHandler = (event) => {\n const {type} = event.data;\n\n const postKeepAlive = async (accessToken, deviceUrl, url) => {\n const response = await fetch(\\`\\${url}/status\\`, {\n method: HTTP_METHODS.POST,\n headers: {\n 'cisco-device-url': deviceUrl,\n 'spark-user-agent': 'webex-calling/beta',\n Authorization: \\`\\${accessToken}\\`,\n trackingId: \\`web_worker_\\${uuid()}\\`,\n },\n });\n\n if (!response.ok) {\n throw new Error(\\`Keepalive failed with status: \\${response.status}\\`);\n }\n\n return response;\n };\n\n if (type === WorkerMessageType.START_KEEPALIVE) {\n let keepAliveRetryCount = 0;\n const {accessToken, deviceUrl, interval, retryCountThreshold, url} = event.data;\n\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n\n keepaliveTimer = setInterval(async () => {\n if (keepAliveRetryCount < retryCountThreshold) {\n try {\n const res = await postKeepAlive(accessToken, deviceUrl, url);\n const statusCode = res.status;\n if (keepAliveRetryCount > 0) {\n self.postMessage({\n type: WorkerMessageType.KEEPALIVE_SUCCESS,\n statusCode,\n });\n }\n keepAliveRetryCount = 0;\n } catch (err) {\n keepAliveRetryCount += 1;\n self.postMessage({\n type: WorkerMessageType.KEEPALIVE_FAILURE,\n err,\n keepAliveRetryCount,\n });\n }\n }\n }, interval * 1000);\n }\n\n if (type === WorkerMessageType.CLEAR_KEEPALIVE) {\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n }\n};\n\nself.addEventListener('message', messageHandler);\n`;\n\nexport default webWorkerStr;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;;AAEA,IAAMA,YAAY,o5EA2FjB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaH,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import * as Media from '@webex/internal-media-core';\nimport {LOGGER} from '../Logger/types';\nimport {ISDKConnector} from '../SDKConnector/types';\nimport {Eventing} from '../Events/impl';\nimport {CallingClientEventTypes} from '../Events/types';\nimport {ServiceData} from '../common/types';\nimport {ICall} from './calling/types';\nimport {CallingClientError} from '../Errors';\nimport {ILine} from './line/types';\n\nexport interface LoggerConfig {\n level: LOGGER;\n}\n\ninterface DiscoveryConfig {\n country: string;\n region: string;\n}\n\nexport interface CallingClientConfig {\n logger?: LoggerConfig;\n discovery?: DiscoveryConfig;\n serviceData?: ServiceData;\n jwe?: string;\n}\n\nexport type CallingClientErrorEmitterCallback = (\n err: CallingClientError,\n finalError?: boolean\n) => void;\n\n/**\n * An interface for the `CallingClient` module.\n * The `CallingClient` module is designed to provide a set of APIs related to line registration and calling functionalities within the SDK.\n *\n * @example\n * ```javascript\n * const callingClient = createClient(webex, callingConfig);\n * ```\n */\nexport interface ICallingClient extends Eventing<CallingClientEventTypes> {\n /**\n * Represents the `mediaEngine for managing media-related operations within the CallingClient.\n * The media engine provides access to audio and video devices such as cameras, microphones, and speakers within the media layer.\n *\n * @public\n * @example\n * ```\n * const microphones = await callingClient.mediaEngine.Media.getMicrophones();\n * const speakers = await callingClient.mediaEngine.Media.getSpeakers();\n * const cameras = await callingClient.mediaEngine.Media.getCameras();\n * ```\n */\n mediaEngine: typeof Media;\n\n /**\n * @ignore\n */\n getSDKConnector(): ISDKConnector;\n\n /**\n * @ignore\n */\n getLoggingLevel(): LOGGER;\n\n /**\n * Retrieves details of the line object(s) belonging to a user.\n *\n * This method gathers all the {@link ILine} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ILine} objects registered with\n * the `callingClient`\n *\n * @example\n * ```typescript\n * const lines = callingClient.getLines();\n * ```\n * The `lines` response object will have `lineId` as its key and\n * a list {@link ILine} objects as it's value.\n * ```\n * {\n * 'lineId1': lineObj1,\n * 'lineId2': lineObj2,\n * }\n * ```\n */\n getLines(): Record<string, ILine>;\n\n /**\n * Retrieves a dictionary of active calls grouped by `lineId`.\n *\n * This method gathers active {@link ICall} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ICall} objects of active calls associated\n * with each line.\n *\n * @example\n * ```typescript\n * const activeCalls = callingClient.getActiveCalls();\n * ```\n * The `activeCalls` response object will have `lineId` as its key and\n * a list {@link ICall} objects as it's value.\n *\n * ```\n * {\n * 'line1': [call1, call2],\n * 'line2': [call3],\n * }\n * ```\n */\n getActiveCalls(): Record<string, ICall[]>;\n\n /**\n * Retrieves the {@link ICall} object for the currently connected call in the client.\n *\n * This method iterates through active call objects and returns the call\n * that is currently connected (not on hold).\n *\n * @example\n * ```typescript\n * const connectedCall : ICall = callingClient.getConnectedCall();\n * ```\n * The `connectedCall` object will be the Call object of the connected call with the client\n */\n getConnectedCall(): ICall | undefined;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import * as Media from '@webex/internal-media-core';\nimport {LOGGER} from '../Logger/types';\nimport {ISDKConnector} from '../SDKConnector/types';\nimport {Eventing} from '../Events/impl';\nimport {CallingClientEventTypes} from '../Events/types';\nimport {ServiceData} from '../common/types';\nimport {ICall} from './calling/types';\nimport {CallingClientError} from '../Errors';\nimport {ILine} from './line/types';\n\nexport interface LoggerConfig {\n level: LOGGER;\n}\n\ninterface DiscoveryConfig {\n country: string;\n region: string;\n}\n\nexport interface CallingClientConfig {\n logger?: LoggerConfig;\n discovery?: DiscoveryConfig;\n serviceData?: ServiceData;\n jwe?: string;\n}\n\nexport type CallingClientErrorEmitterCallback = (\n err: CallingClientError,\n finalError?: boolean\n) => void;\n\n/**\n * An interface for the `CallingClient` module.\n * The `CallingClient` module is designed to provide a set of APIs related to line registration and calling functionalities within the SDK.\n *\n * @example\n * ```javascript\n * const callingClient = createClient(webex, callingConfig);\n * ```\n */\nexport interface ICallingClient extends Eventing<CallingClientEventTypes> {\n /**\n * Represents the `mediaEngine for managing media-related operations within the CallingClient.\n * The media engine provides access to audio and video devices such as cameras, microphones, and speakers within the media layer.\n *\n * @public\n * @example\n * ```\n * const microphones = await callingClient.mediaEngine.Media.getMicrophones();\n * const speakers = await callingClient.mediaEngine.Media.getSpeakers();\n * const cameras = await callingClient.mediaEngine.Media.getCameras();\n * ```\n */\n mediaEngine: typeof Media;\n\n /**\n * @ignore\n */\n getSDKConnector(): ISDKConnector;\n\n /**\n * @ignore\n */\n getLoggingLevel(): LOGGER;\n\n /**\n * Retrieves details of the line object(s) belonging to a user.\n *\n * This method gathers all the {@link ILine} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ILine} objects registered with\n * the `callingClient`\n *\n * @example\n * ```typescript\n * const lines = callingClient.getLines();\n * ```\n * The `lines` response object will have `lineId` as its key and\n * a list {@link ILine} objects as it's value.\n * ```\n * {\n * 'lineId1': lineObj1,\n * 'lineId2': lineObj2,\n * }\n * ```\n */\n getLines(): Record<string, ILine>;\n\n /**\n * Retrieves a dictionary of active calls grouped by `lineId`.\n *\n * This method gathers active {@link ICall} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ICall} objects of active calls associated\n * with each line.\n *\n * @example\n * ```typescript\n * const activeCalls = callingClient.getActiveCalls();\n * ```\n * The `activeCalls` response object will have `lineId` as its key and\n * a list {@link ICall} objects as it's value.\n *\n * ```\n * {\n * 'line1': [call1, call2],\n * 'line2': [call3],\n * }\n * ```\n */\n getActiveCalls(): Record<string, ICall[]>;\n\n /**\n * Retrieves the {@link ICall} object for the currently connected call in the client.\n *\n * This method iterates through active call objects and returns the call\n * that is currently connected (not on hold).\n *\n * @example\n * ```typescript\n * const connectedCall : ICall = callingClient.getConnectedCall();\n * ```\n * The `connectedCall` object will be the Call object of the connected call with the client\n */\n getConnectedCall(): ICall | undefined;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = windowsChromiumIceWarmup;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
12
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
13
|
+
// This file contains a workaround for a known issue in Windows Chromium-based browsers
|
|
14
|
+
// See: https://issues.chromium.org/issues/332933530
|
|
15
|
+
// There is a rare condition where WebRTC doesn't work on the first try due to ICE gathering issues.
|
|
16
|
+
// This function attempts to "warm up" the ICE gathering process by creating a pair of peer connections
|
|
17
|
+
// and forcing ICE candidate gathering and exchange before the actual call setup.
|
|
18
|
+
// We need to try establishing the connection through the srflx candidates since the host candidate won't work
|
|
19
|
+
// This is intended to be called once at the start of the calling SDK to reduce the likelihood of ICE issues later.
|
|
20
|
+
function waitForIceComplete(pc, timeoutMs) {
|
|
21
|
+
return new _promise.default(function (resolve) {
|
|
22
|
+
if (!pc) {
|
|
23
|
+
resolve({
|
|
24
|
+
ok: false,
|
|
25
|
+
reason: 'no-pc'
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (pc.iceGatheringState === 'complete') {
|
|
30
|
+
resolve({
|
|
31
|
+
ok: true,
|
|
32
|
+
reached: 'already'
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
var done = false;
|
|
37
|
+
var onChange = function onChange() {
|
|
38
|
+
if (pc.iceGatheringState === 'complete' && !done) {
|
|
39
|
+
done = true;
|
|
40
|
+
pc.removeEventListener('icegatheringstatechange', onChange);
|
|
41
|
+
resolve({
|
|
42
|
+
ok: true,
|
|
43
|
+
reached: 'event'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
pc.addEventListener('icegatheringstatechange', onChange);
|
|
48
|
+
|
|
49
|
+
// timeout fallback
|
|
50
|
+
setTimeout(function () {
|
|
51
|
+
if (done) return;
|
|
52
|
+
done = true;
|
|
53
|
+
pc.removeEventListener('icegatheringstatechange', onChange);
|
|
54
|
+
resolve({
|
|
55
|
+
ok: pc.iceGatheringState === 'complete',
|
|
56
|
+
reached: 'timeout'
|
|
57
|
+
});
|
|
58
|
+
}, timeoutMs);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function windowsChromiumIceWarmup(_x) {
|
|
62
|
+
return _windowsChromiumIceWarmup.apply(this, arguments);
|
|
63
|
+
}
|
|
64
|
+
function _windowsChromiumIceWarmup() {
|
|
65
|
+
_windowsChromiumIceWarmup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
66
|
+
var _ref$iceServers, iceServers, _ref$timeoutMs, timeoutMs, pc1, pc2, candidates, offer, answer;
|
|
67
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
_ref$iceServers = _ref.iceServers, iceServers = _ref$iceServers === void 0 ? [] : _ref$iceServers, _ref$timeoutMs = _ref.timeoutMs, timeoutMs = _ref$timeoutMs === void 0 ? 1000 : _ref$timeoutMs;
|
|
71
|
+
pc1 = new RTCPeerConnection({
|
|
72
|
+
iceServers: iceServers,
|
|
73
|
+
iceCandidatePoolSize: 1
|
|
74
|
+
});
|
|
75
|
+
pc2 = new RTCPeerConnection({
|
|
76
|
+
iceServers: iceServers,
|
|
77
|
+
iceCandidatePoolSize: 1
|
|
78
|
+
});
|
|
79
|
+
candidates = {
|
|
80
|
+
pc1: [],
|
|
81
|
+
pc2: []
|
|
82
|
+
};
|
|
83
|
+
pc1.onicecandidate = function (e) {
|
|
84
|
+
if (e.candidate && e.candidate.type !== 'host') {
|
|
85
|
+
candidates.pc1.push(e.candidate);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
_context.next = 7;
|
|
89
|
+
return pc1.createDataChannel('warmup');
|
|
90
|
+
case 7:
|
|
91
|
+
_context.next = 9;
|
|
92
|
+
return pc1.addTransceiver('audio');
|
|
93
|
+
case 9:
|
|
94
|
+
_context.next = 11;
|
|
95
|
+
return pc1.createOffer();
|
|
96
|
+
case 11:
|
|
97
|
+
offer = _context.sent;
|
|
98
|
+
_context.next = 14;
|
|
99
|
+
return pc1.setLocalDescription(offer);
|
|
100
|
+
case 14:
|
|
101
|
+
_context.next = 16;
|
|
102
|
+
return waitForIceComplete(pc1, timeoutMs);
|
|
103
|
+
case 16:
|
|
104
|
+
_context.next = 18;
|
|
105
|
+
return pc2.setRemoteDescription(offer);
|
|
106
|
+
case 18:
|
|
107
|
+
pc2.onicecandidate = function (e) {
|
|
108
|
+
if (e.candidate && e.candidate.type !== 'host') {
|
|
109
|
+
candidates.pc2.push(e.candidate);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
_context.next = 21;
|
|
113
|
+
return pc2.createAnswer();
|
|
114
|
+
case 21:
|
|
115
|
+
answer = _context.sent;
|
|
116
|
+
_context.next = 24;
|
|
117
|
+
return pc2.setLocalDescription(answer);
|
|
118
|
+
case 24:
|
|
119
|
+
_context.next = 26;
|
|
120
|
+
return pc1.setRemoteDescription(answer);
|
|
121
|
+
case 26:
|
|
122
|
+
_context.next = 28;
|
|
123
|
+
return waitForIceComplete(pc2, timeoutMs);
|
|
124
|
+
case 28:
|
|
125
|
+
_context.next = 30;
|
|
126
|
+
return _promise.default.all([].concat((0, _toConsumableArray2.default)(candidates.pc1.map(function (candidate) {
|
|
127
|
+
return pc2.addIceCandidate(candidate).catch(console.error);
|
|
128
|
+
})), (0, _toConsumableArray2.default)(candidates.pc2.map(function (candidate) {
|
|
129
|
+
return pc1.addIceCandidate(candidate).catch(console.error);
|
|
130
|
+
}))));
|
|
131
|
+
case 30:
|
|
132
|
+
pc1.close();
|
|
133
|
+
pc2.close();
|
|
134
|
+
case 32:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
137
|
+
}
|
|
138
|
+
}, _callee);
|
|
139
|
+
}));
|
|
140
|
+
return _windowsChromiumIceWarmup.apply(this, arguments);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=windowsChromiumIceWarmupUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["waitForIceComplete","pc","timeoutMs","_promise","default","resolve","ok","reason","iceGatheringState","reached","done","onChange","removeEventListener","addEventListener","setTimeout","windowsChromiumIceWarmup","_x","_windowsChromiumIceWarmup","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","_ref","_ref$iceServers","iceServers","_ref$timeoutMs","pc1","pc2","candidates","offer","answer","wrap","_callee$","_context","prev","next","RTCPeerConnection","iceCandidatePoolSize","onicecandidate","e","candidate","type","push","createDataChannel","addTransceiver","createOffer","sent","setLocalDescription","setRemoteDescription","createAnswer","all","concat","_toConsumableArray2","map","addIceCandidate","catch","console","error","close","stop"],"sources":["windowsChromiumIceWarmupUtils.ts"],"sourcesContent":["// This file contains a workaround for a known issue in Windows Chromium-based browsers\n// See: https://issues.chromium.org/issues/332933530\n// There is a rare condition where WebRTC doesn't work on the first try due to ICE gathering issues.\n// This function attempts to \"warm up\" the ICE gathering process by creating a pair of peer connections\n// and forcing ICE candidate gathering and exchange before the actual call setup.\n// We need to try establishing the connection through the srflx candidates since the host candidate won't work\n// This is intended to be called once at the start of the calling SDK to reduce the likelihood of ICE issues later.\nfunction waitForIceComplete(pc: RTCPeerConnection, timeoutMs: number) {\n return new Promise((resolve) => {\n if (!pc) {\n resolve({ok: false, reason: 'no-pc'});\n\n return;\n }\n if (pc.iceGatheringState === 'complete') {\n resolve({ok: true, reached: 'already'});\n\n return;\n }\n\n let done = false;\n const onChange = () => {\n if (pc.iceGatheringState === 'complete' && !done) {\n done = true;\n pc.removeEventListener('icegatheringstatechange', onChange);\n resolve({ok: true, reached: 'event'});\n }\n };\n pc.addEventListener('icegatheringstatechange', onChange);\n\n // timeout fallback\n setTimeout(() => {\n if (done) return;\n done = true;\n pc.removeEventListener('icegatheringstatechange', onChange);\n resolve({ok: pc.iceGatheringState === 'complete', reached: 'timeout'});\n }, timeoutMs);\n });\n}\n\nexport default async function windowsChromiumIceWarmup({iceServers = [], timeoutMs = 1000}) {\n const pc1 = new RTCPeerConnection({iceServers, iceCandidatePoolSize: 1});\n const pc2 = new RTCPeerConnection({iceServers, iceCandidatePoolSize: 1});\n\n const candidates: {pc1: RTCIceCandidate[]; pc2: RTCIceCandidate[]} = {pc1: [], pc2: []};\n pc1.onicecandidate = (e) => {\n if (e.candidate && e.candidate.type !== 'host') {\n candidates.pc1.push(e.candidate);\n }\n };\n\n await pc1.createDataChannel('warmup');\n await pc1.addTransceiver('audio');\n\n const offer = await pc1.createOffer();\n await pc1.setLocalDescription(offer);\n\n await waitForIceComplete(pc1, timeoutMs);\n\n await pc2.setRemoteDescription(offer);\n pc2.onicecandidate = (e) => {\n if (e.candidate && e.candidate.type !== 'host') {\n candidates.pc2.push(e.candidate);\n }\n };\n\n const answer = await pc2.createAnswer();\n await pc2.setLocalDescription(answer);\n await pc1.setRemoteDescription(answer);\n\n await waitForIceComplete(pc2, timeoutMs);\n\n // Add ice candidates that were gathered\n await Promise.all([\n ...candidates.pc1.map((candidate) => pc2.addIceCandidate(candidate).catch(console.error)),\n ...candidates.pc2.map((candidate) => pc1.addIceCandidate(candidate).catch(console.error)),\n ]);\n\n pc1.close();\n pc2.close();\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkBA,CAACC,EAAqB,EAAEC,SAAiB,EAAE;EACpE,OAAO,IAAAC,QAAA,CAAAC,OAAA,CAAY,UAACC,OAAO,EAAK;IAC9B,IAAI,CAACJ,EAAE,EAAE;MACPI,OAAO,CAAC;QAACC,EAAE,EAAE,KAAK;QAAEC,MAAM,EAAE;MAAO,CAAC,CAAC;MAErC;IACF;IACA,IAAIN,EAAE,CAACO,iBAAiB,KAAK,UAAU,EAAE;MACvCH,OAAO,CAAC;QAACC,EAAE,EAAE,IAAI;QAAEG,OAAO,EAAE;MAAS,CAAC,CAAC;MAEvC;IACF;IAEA,IAAIC,IAAI,GAAG,KAAK;IAChB,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAA,EAAS;MACrB,IAAIV,EAAE,CAACO,iBAAiB,KAAK,UAAU,I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