@webex/calling 3.12.0-next.6 → 3.12.0-next.61
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/CallRecording/CallRecording.js +158 -0
- package/dist/CallRecording/CallRecording.js.map +1 -0
- package/dist/CallRecording/CallRecording.test.js +257 -0
- package/dist/CallRecording/CallRecording.test.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js +576 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +651 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +235 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +49 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +136 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/utils.js +42 -0
- package/dist/CallRecording/utils.js.map +1 -0
- package/dist/CallRecording/utils.test.js +97 -0
- package/dist/CallRecording/utils.test.js.map +1 -0
- package/dist/CallingClient/CallingClient.js +454 -224
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +513 -154
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +589 -445
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +695 -445
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +81 -31
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +123 -0
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +2 -0
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +28 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +4 -1
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +16 -1
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +724 -407
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +380 -58
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +41 -104
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +39 -153
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/utils/constants.js +58 -0
- package/dist/CallingClient/utils/constants.js.map +1 -0
- package/dist/CallingClient/utils/index.js +63 -0
- package/dist/CallingClient/utils/index.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js +122 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js +221 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js.map +1 -0
- package/dist/CallingClient/utils/request.js +435 -0
- package/dist/CallingClient/utils/request.js.map +1 -0
- package/dist/CallingClient/utils/request.test.js +999 -0
- package/dist/CallingClient/utils/request.test.js.map +1 -0
- package/dist/CallingClient/utils/types.js +7 -0
- package/dist/CallingClient/utils/types.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js +70 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js +139 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +13 -11
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +3 -8
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Events/types.js +38 -11
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.js +63 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +357 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +19 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/api.js +56 -0
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +156 -51
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +79 -0
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +10 -5
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +165 -40
- package/dist/index.js.map +1 -1
- package/dist/mobius-socket/config.js +24 -0
- package/dist/mobius-socket/config.js.map +1 -0
- package/dist/mobius-socket/errors.js +143 -0
- package/dist/mobius-socket/errors.js.map +1 -0
- package/dist/mobius-socket/errors.test.js +20 -0
- package/dist/mobius-socket/errors.test.js.map +1 -0
- package/dist/mobius-socket/index.js +57 -0
- package/dist/mobius-socket/index.js.map +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js +492 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.js +849 -0
- package/dist/mobius-socket/mobius-socket.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.test.js +1898 -0
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -0
- package/dist/mobius-socket/socket/constants.js +55 -0
- package/dist/mobius-socket/socket/constants.js.map +1 -0
- package/dist/mobius-socket/socket/index.js +15 -0
- package/dist/mobius-socket/socket/index.js.map +1 -0
- package/dist/mobius-socket/socket/socket-base.js +604 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -0
- package/dist/mobius-socket/socket/socket.js +19 -0
- package/dist/mobius-socket/socket/socket.js.map +1 -0
- package/dist/mobius-socket/socket/socket.shim.js +26 -0
- package/dist/mobius-socket/socket/socket.shim.js.map +1 -0
- package/dist/mobius-socket/socket/types.js +7 -0
- package/dist/mobius-socket/socket/types.js.map +1 -0
- package/dist/mobius-socket/socket.test.js +727 -0
- package/dist/mobius-socket/socket.test.js.map +1 -0
- package/dist/mobius-socket/test/mocha-helpers.js +23 -0
- package/dist/mobius-socket/test/mocha-helpers.js.map +1 -0
- package/dist/mobius-socket/test/promise-tick.js +28 -0
- package/dist/mobius-socket/test/promise-tick.js.map +1 -0
- package/dist/mobius-socket/types.js +7 -0
- package/dist/mobius-socket/types.js.map +1 -0
- package/dist/module/CallRecording/CallRecording.js +56 -0
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +264 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +201 -0
- package/dist/module/CallRecording/constants.js +27 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +126 -10
- package/dist/module/CallingClient/calling/call.js +177 -61
- package/dist/module/CallingClient/calling/callManager.js +39 -7
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +24 -0
- package/dist/module/CallingClient/line/index.js +2 -2
- package/dist/module/CallingClient/registration/register.js +239 -63
- package/dist/module/CallingClient/registration/webWorker.js +42 -61
- package/dist/module/CallingClient/registration/webWorkerStr.js +47 -82
- package/dist/module/CallingClient/utils/constants.js +36 -0
- package/dist/module/CallingClient/utils/index.js +5 -0
- package/dist/module/CallingClient/utils/mobiusSocketMapper.js +72 -0
- package/dist/module/CallingClient/utils/request.js +211 -0
- package/dist/module/CallingClient/utils/types.js +1 -0
- package/dist/module/CallingClient/utils/wsFeatureFlag.js +41 -0
- package/dist/module/Contacts/ContactsClient.js +1 -1
- package/dist/module/Events/types.js +23 -10
- package/dist/module/Metrics/index.js +48 -1
- package/dist/module/Metrics/types.js +18 -0
- package/dist/module/api.js +3 -2
- package/dist/module/common/Utils.js +60 -17
- package/dist/module/common/testUtil.js +6 -1
- package/dist/module/common/types.js +3 -0
- package/dist/module/index.js +7 -3
- package/dist/module/mobius-socket/config.js +15 -0
- package/dist/module/mobius-socket/errors.js +58 -0
- package/dist/module/mobius-socket/index.js +24 -0
- package/dist/module/mobius-socket/mobius-socket.js +593 -0
- package/dist/module/mobius-socket/socket/constants.js +26 -0
- package/dist/module/mobius-socket/socket/index.js +4 -0
- package/dist/module/mobius-socket/socket/socket-base.js +368 -0
- package/dist/module/mobius-socket/socket/socket.js +9 -0
- package/dist/module/mobius-socket/socket/socket.shim.js +12 -0
- package/dist/module/mobius-socket/socket/types.js +1 -0
- package/dist/module/mobius-socket/types.js +1 -0
- package/dist/types/CallRecording/CallRecording.d.ts +18 -0
- package/dist/types/CallRecording/CallRecording.d.ts.map +1 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +23 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +61 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +28 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +176 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/utils.d.ts +3 -0
- package/dist/types/CallRecording/utils.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts +8 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +12 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +4 -2
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +34 -9
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +24 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +7 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +4 -2
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +1 -0
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/CallingClient/utils/constants.d.ts +35 -0
- package/dist/types/CallingClient/utils/constants.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/index.d.ts +6 -0
- package/dist/types/CallingClient/utils/index.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts +5 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/request.d.ts +28 -0
- package/dist/types/CallingClient/utils/request.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/types.d.ts +34 -0
- package/dist/types/CallingClient/utils/types.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts +4 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts.map +1 -0
- package/dist/types/Events/types.d.ts +79 -15
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +19 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +39 -12
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +6 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +11 -3
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +5 -1
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +5 -1
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mobius-socket/config.d.ts +17 -0
- package/dist/types/mobius-socket/config.d.ts.map +1 -0
- package/dist/types/mobius-socket/errors.d.ts +32 -0
- package/dist/types/mobius-socket/errors.d.ts.map +1 -0
- package/dist/types/mobius-socket/index.d.ts +14 -0
- package/dist/types/mobius-socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts +48 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/constants.d.ts +27 -0
- package/dist/types/mobius-socket/socket/constants.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/index.d.ts +5 -0
- package/dist/types/mobius-socket/socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts +43 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/types.d.ts +61 -0
- package/dist/types/mobius-socket/socket/types.d.ts.map +1 -0
- package/dist/types/mobius-socket/types.d.ts +21 -0
- package/dist/types/mobius-socket/types.d.ts.map +1 -0
- package/package.json +20 -5
- package/src/mobius-socket/socket/socket.shim.ts +22 -0
- package/src/mobius-socket/socket/socket.ts +14 -0
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
+
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
8
|
+
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
9
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
10
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
11
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.WxcCallRecordingConnector = void 0;
|
|
15
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
16
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
17
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
19
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
20
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
21
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
22
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
23
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
24
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
25
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
26
|
+
var _SDKConnector = _interopRequireDefault(require("../SDKConnector"));
|
|
27
|
+
var _types = require("../common/types");
|
|
28
|
+
var _Logger = _interopRequireDefault(require("../Logger"));
|
|
29
|
+
var _Utils = require("../common/Utils");
|
|
30
|
+
var _constants = require("../common/constants");
|
|
31
|
+
var _types2 = require("../Events/types");
|
|
32
|
+
var _impl = require("../Events/impl");
|
|
33
|
+
var _types3 = require("./types");
|
|
34
|
+
var _constants2 = require("./constants");
|
|
35
|
+
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
38
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable dot-notation */ /* eslint-disable no-underscore-dangle */
|
|
39
|
+
/**
|
|
40
|
+
* Webex Calling (WXC) backend connector for Post Call Recording.
|
|
41
|
+
*
|
|
42
|
+
* Owns everything backend-specific for the Webex Calling cloud `convergedRecordings` capability:
|
|
43
|
+
* resolving the hydra developer API base URL from the u2c catalog, the REST read/delete calls, and
|
|
44
|
+
* subscribing to the `convergedRecordings.*` Mercury events (re-emitting them as typed
|
|
45
|
+
* `callRecording:*` events). The {@link CallRecording} facade selects this connector when the
|
|
46
|
+
* resolved calling backend is WXC.
|
|
47
|
+
*/
|
|
48
|
+
var WxcCallRecordingConnector = exports.WxcCallRecordingConnector = /*#__PURE__*/function (_Eventing) {
|
|
49
|
+
/**
|
|
50
|
+
* @param webex - `Webex SDK` instance.
|
|
51
|
+
* @param logger - Logger interface used to set the log level for the module.
|
|
52
|
+
*/
|
|
53
|
+
function WxcCallRecordingConnector(webex, logger) {
|
|
54
|
+
var _this$webex$internal$, _this$webex$internal$2;
|
|
55
|
+
var _this;
|
|
56
|
+
(0, _classCallCheck2.default)(this, WxcCallRecordingConnector);
|
|
57
|
+
_this = _callSuper(this, WxcCallRecordingConnector);
|
|
58
|
+
(0, _defineProperty2.default)(_this, "sdkConnector", void 0);
|
|
59
|
+
(0, _defineProperty2.default)(_this, "webex", void 0);
|
|
60
|
+
(0, _defineProperty2.default)(_this, "recordingServiceUrl", void 0);
|
|
61
|
+
// `event` is optional because SDKConnector.registerListener invokes callbacks as `(data?: T)`.
|
|
62
|
+
// `data` uses optional chaining at runtime because malformed Mercury payloads may omit it.
|
|
63
|
+
(0, _defineProperty2.default)(_this, "handleRecordingCreatedEvent", /*#__PURE__*/function () {
|
|
64
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(event) {
|
|
65
|
+
var _event$data;
|
|
66
|
+
return _regenerator.default.wrap(function (_context) {
|
|
67
|
+
while (1) switch (_context.prev = _context.next) {
|
|
68
|
+
case 0:
|
|
69
|
+
if (event !== null && event !== void 0 && (_event$data = event.data) !== null && _event$data !== void 0 && _event$data.activity) {
|
|
70
|
+
_context.next = 1;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return _context.abrupt("return");
|
|
74
|
+
case 1:
|
|
75
|
+
_this.emit(_types2.COMMON_EVENT_KEYS.CALL_RECORDING_CREATED, event);
|
|
76
|
+
case 2:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context.stop();
|
|
79
|
+
}
|
|
80
|
+
}, _callee);
|
|
81
|
+
}));
|
|
82
|
+
return function (_x) {
|
|
83
|
+
return _ref.apply(this, arguments);
|
|
84
|
+
};
|
|
85
|
+
}());
|
|
86
|
+
/**
|
|
87
|
+
* The backend expresses the full recording lifecycle through `convergedRecordings.updated` events
|
|
88
|
+
* qualified by an `eventSubType` (rather than dedicated created/deleted events):
|
|
89
|
+
* - `TRASH` (soft delete) / `PURGE` (permanent delete) -> surfaced as `callRecording:deleted`
|
|
90
|
+
* so consumers can drop the recording from the active list.
|
|
91
|
+
* - `RESTORE` (restored from trash) -> surfaced as `callRecording:created` so it is re-added.
|
|
92
|
+
* - `SUMMARY_CREATE` (AI summary/transcript ready) and anything else -> `callRecording:updated`.
|
|
93
|
+
*
|
|
94
|
+
* The full event (including `data.eventSubType`) is always forwarded, so consumers that need to
|
|
95
|
+
* distinguish a soft delete from a permanent purge can still inspect it.
|
|
96
|
+
*/
|
|
97
|
+
(0, _defineProperty2.default)(_this, "handleRecordingUpdatedEvent", /*#__PURE__*/function () {
|
|
98
|
+
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(event) {
|
|
99
|
+
var _event$data2;
|
|
100
|
+
var _t;
|
|
101
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
if (event !== null && event !== void 0 && (_event$data2 = event.data) !== null && _event$data2 !== void 0 && _event$data2.activity) {
|
|
105
|
+
_context2.next = 1;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
return _context2.abrupt("return");
|
|
109
|
+
case 1:
|
|
110
|
+
_t = event.data.eventSubType;
|
|
111
|
+
_context2.next = _t === _types2.RECORDING_EVENT_SUBTYPE.TRASH ? 2 : _t === _types2.RECORDING_EVENT_SUBTYPE.PURGE ? 2 : _t === _types2.RECORDING_EVENT_SUBTYPE.RESTORE ? 3 : 4;
|
|
112
|
+
break;
|
|
113
|
+
case 2:
|
|
114
|
+
_this.emit(_types2.COMMON_EVENT_KEYS.CALL_RECORDING_DELETED, event);
|
|
115
|
+
return _context2.abrupt("continue", 5);
|
|
116
|
+
case 3:
|
|
117
|
+
_this.emit(_types2.COMMON_EVENT_KEYS.CALL_RECORDING_CREATED, event);
|
|
118
|
+
return _context2.abrupt("continue", 5);
|
|
119
|
+
case 4:
|
|
120
|
+
_this.emit(_types2.COMMON_EVENT_KEYS.CALL_RECORDING_UPDATED, event);
|
|
121
|
+
case 5:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context2.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee2);
|
|
126
|
+
}));
|
|
127
|
+
return function (_x2) {
|
|
128
|
+
return _ref2.apply(this, arguments);
|
|
129
|
+
};
|
|
130
|
+
}());
|
|
131
|
+
(0, _defineProperty2.default)(_this, "handleRecordingDeletedEvent", /*#__PURE__*/function () {
|
|
132
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(event) {
|
|
133
|
+
var _event$data3;
|
|
134
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
135
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
136
|
+
case 0:
|
|
137
|
+
if (event !== null && event !== void 0 && (_event$data3 = event.data) !== null && _event$data3 !== void 0 && _event$data3.activity) {
|
|
138
|
+
_context3.next = 1;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
return _context3.abrupt("return");
|
|
142
|
+
case 1:
|
|
143
|
+
_this.emit(_types2.COMMON_EVENT_KEYS.CALL_RECORDING_DELETED, event);
|
|
144
|
+
case 2:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context3.stop();
|
|
147
|
+
}
|
|
148
|
+
}, _callee3);
|
|
149
|
+
}));
|
|
150
|
+
return function (_x3) {
|
|
151
|
+
return _ref3.apply(this, arguments);
|
|
152
|
+
};
|
|
153
|
+
}());
|
|
154
|
+
_this.sdkConnector = _SDKConnector.default;
|
|
155
|
+
if (!_this.sdkConnector.getWebex()) {
|
|
156
|
+
_SDKConnector.default.setWebex(webex);
|
|
157
|
+
}
|
|
158
|
+
_this.webex = _this.sdkConnector.getWebex();
|
|
159
|
+
|
|
160
|
+
// Resolve the Post Call Recording base URL (hydra developer API) directly from the u2c
|
|
161
|
+
// service catalog. The catalog is populated by the host SDK's service discovery, so no
|
|
162
|
+
// dedicated recording plugin is required.
|
|
163
|
+
_this.recordingServiceUrl = ((_this$webex$internal$ = _this.webex.internal.services._serviceUrls) === null || _this$webex$internal$ === void 0 ? void 0 : _this$webex$internal$.hydraDeveloperApi) || _this.webex.internal.services.get((_this$webex$internal$2 = _this.webex.internal.services._activeServices) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.hydraDeveloperApi);
|
|
164
|
+
_this.registerRecordingListeners();
|
|
165
|
+
_Logger.default.setLogger(logger.level, _constants2.CALL_RECORDING_FILE);
|
|
166
|
+
return _this;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Builds the `convergedRecordings` collection URL with the list query parameters.
|
|
171
|
+
*
|
|
172
|
+
* The converged recordings API only returns results when the request is bounded by BOTH a
|
|
173
|
+
* `from` and a `to` timestamp, so this method always sends both (a `from`-only request comes
|
|
174
|
+
* back empty). When the caller does not supply an explicit `from`, it is derived from the
|
|
175
|
+
* `days` lookback (`now - days`, default {@link DEFAULT_NUMBER_OF_DAYS}); when `to` is omitted
|
|
176
|
+
* it defaults to the current time (`now`). `status` and `max` default to `available` and `30`.
|
|
177
|
+
* The remaining filters (`serviceType`, `format`, `ownerType`, `storageRegion`, `locationId`,
|
|
178
|
+
* `topic`) are pass-through and only appended when the caller provides them.
|
|
179
|
+
*
|
|
180
|
+
* @param options - Optional time window/filtering/pagination from {@link GetRecordingsOptions}.
|
|
181
|
+
* @returns The fully-qualified request URL.
|
|
182
|
+
*/
|
|
183
|
+
(0, _inherits2.default)(WxcCallRecordingConnector, _Eventing);
|
|
184
|
+
return (0, _createClass2.default)(WxcCallRecordingConnector, [{
|
|
185
|
+
key: "buildRecordingsUrl",
|
|
186
|
+
value: function buildRecordingsUrl(options) {
|
|
187
|
+
var _options$to, _options$status, _options$max;
|
|
188
|
+
var params = new URLSearchParams();
|
|
189
|
+
var fromDate = options === null || options === void 0 ? void 0 : options.from;
|
|
190
|
+
if (!fromDate) {
|
|
191
|
+
var _options$days;
|
|
192
|
+
var date = new Date();
|
|
193
|
+
date.setDate(date.getDate() - ((_options$days = options === null || options === void 0 ? void 0 : options.days) !== null && _options$days !== void 0 ? _options$days : _constants2.DEFAULT_NUMBER_OF_DAYS));
|
|
194
|
+
fromDate = date.toISOString();
|
|
195
|
+
}
|
|
196
|
+
var toDate = (_options$to = options === null || options === void 0 ? void 0 : options.to) !== null && _options$to !== void 0 ? _options$to : new Date().toISOString();
|
|
197
|
+
params.append(_constants2.FROM, fromDate);
|
|
198
|
+
params.append(_constants2.TO, toDate);
|
|
199
|
+
params.append(_constants2.STATUS, (_options$status = options === null || options === void 0 ? void 0 : options.status) !== null && _options$status !== void 0 ? _options$status : _constants2.DEFAULT_STATUS);
|
|
200
|
+
params.append(_constants2.MAX, "".concat((_options$max = options === null || options === void 0 ? void 0 : options.max) !== null && _options$max !== void 0 ? _options$max : _constants2.DEFAULT_MAX));
|
|
201
|
+
|
|
202
|
+
// Optional pass-through filters: only sent when the caller provides them so the API can apply
|
|
203
|
+
// its own defaults for any that are omitted.
|
|
204
|
+
var optionalParams = [[_constants2.SERVICE_TYPE, options === null || options === void 0 ? void 0 : options.serviceType], [_constants2.FORMAT, options === null || options === void 0 ? void 0 : options.format], [_constants2.OWNER_TYPE, options === null || options === void 0 ? void 0 : options.ownerType], [_constants2.STORAGE_REGION, options === null || options === void 0 ? void 0 : options.storageRegion], [_constants2.LOCATION_ID, options === null || options === void 0 ? void 0 : options.locationId], [_constants2.TOPIC, options === null || options === void 0 ? void 0 : options.topic]];
|
|
205
|
+
optionalParams.forEach(function (_ref4) {
|
|
206
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
|
207
|
+
key = _ref5[0],
|
|
208
|
+
value = _ref5[1];
|
|
209
|
+
if (value) {
|
|
210
|
+
params.append(key, value);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return "".concat(this.recordingServiceUrl, "/").concat(_constants2.CONVERGED_RECORDINGS, "?").concat(params.toString());
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Reads Post Call Recordings, dispatching to the matching operation based on the request `type`.
|
|
218
|
+
* The concrete response type is inferred per request via {@link RecordingResponseFor}.
|
|
219
|
+
*
|
|
220
|
+
* @param request - The discriminated read request.
|
|
221
|
+
*/
|
|
222
|
+
}, {
|
|
223
|
+
key: "getCallRecording",
|
|
224
|
+
value: function getCallRecording(request) {
|
|
225
|
+
return this.dispatchGetCallRecording(request);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Internal dispatcher for {@link getCallRecording}. Routes the discriminated request to the
|
|
230
|
+
* backend-specific read method. Kept separate from the public generic signature so the switch
|
|
231
|
+
* runs against a concrete union (with exhaustiveness checking) and the conditional return type is
|
|
232
|
+
* narrowed in exactly one place.
|
|
233
|
+
*
|
|
234
|
+
* @param request - The discriminated read request.
|
|
235
|
+
*/
|
|
236
|
+
}, {
|
|
237
|
+
key: "dispatchGetCallRecording",
|
|
238
|
+
value: function dispatchGetCallRecording(request) {
|
|
239
|
+
switch (request.type) {
|
|
240
|
+
case _types3.RecordingRequestType.LIST:
|
|
241
|
+
return this.getRecordings(request.options);
|
|
242
|
+
case _types3.RecordingRequestType.DETAIL:
|
|
243
|
+
return this.getRecording(request.recordingId);
|
|
244
|
+
case _types3.RecordingRequestType.METADATA:
|
|
245
|
+
return this.getRecordingMetadata(request.recordingId);
|
|
246
|
+
case _types3.RecordingRequestType.BY_CALL_SESSION:
|
|
247
|
+
return this.getRecordingsByCallSessionId(request.callSessionId, request.options);
|
|
248
|
+
default:
|
|
249
|
+
{
|
|
250
|
+
var exhaustiveCheck = request;
|
|
251
|
+
throw new Error("Unsupported recording request type: ".concat((0, _stringify.default)(exhaustiveCheck)));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Fetches the converged recordings for the current user.
|
|
258
|
+
* @param options - Optional filters and pagination parameters.
|
|
259
|
+
*/
|
|
260
|
+
}, {
|
|
261
|
+
key: "getRecordings",
|
|
262
|
+
value: (function () {
|
|
263
|
+
var _getRecordings = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4(options) {
|
|
264
|
+
var loggerContext, _response$headers, _response$body, _body$items, _responseDetails$data, _responseDetails$data2, url, response, body, responseDetails, errorInfo, _t2;
|
|
265
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
266
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
267
|
+
case 0:
|
|
268
|
+
loggerContext = {
|
|
269
|
+
file: _constants2.CALL_RECORDING_FILE,
|
|
270
|
+
method: _constants2.METHODS.GET_RECORDINGS
|
|
271
|
+
};
|
|
272
|
+
_Logger.default.info("".concat(_constants.METHOD_START_MESSAGE, " with options=").concat((0, _stringify.default)(options !== null && options !== void 0 ? options : {})), loggerContext);
|
|
273
|
+
_context4.prev = 1;
|
|
274
|
+
url = this.buildRecordingsUrl(options);
|
|
275
|
+
_context4.next = 2;
|
|
276
|
+
return this.webex.request(_objectSpread({
|
|
277
|
+
uri: url,
|
|
278
|
+
method: _types.HTTP_METHODS.GET,
|
|
279
|
+
service: _types.ALLOWED_SERVICES.HYDRA_DEVELOPER_API
|
|
280
|
+
}, options !== null && options !== void 0 && options.webexUserRequest ? {
|
|
281
|
+
headers: (0, _defineProperty2.default)({}, _constants2.WEBEX_USER_REQUEST_HEADER, 'true')
|
|
282
|
+
} : {}));
|
|
283
|
+
case 2:
|
|
284
|
+
response = _context4.sent;
|
|
285
|
+
_Logger.default.log("Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.trackingid), loggerContext);
|
|
286
|
+
body = (_response$body = response.body) !== null && _response$body !== void 0 ? _response$body : {};
|
|
287
|
+
responseDetails = {
|
|
288
|
+
statusCode: Number(response.statusCode) || _constants.SUCCESS_STATUS_CODE,
|
|
289
|
+
data: {
|
|
290
|
+
recordings: (_body$items = body.items) !== null && _body$items !== void 0 ? _body$items : []
|
|
291
|
+
},
|
|
292
|
+
message: _constants.SUCCESS_MESSAGE
|
|
293
|
+
};
|
|
294
|
+
_Logger.default.log("Successfully retrieved ".concat((_responseDetails$data = (_responseDetails$data2 = responseDetails.data.recordings) === null || _responseDetails$data2 === void 0 ? void 0 : _responseDetails$data2.length) !== null && _responseDetails$data !== void 0 ? _responseDetails$data : 0, " recordings"), loggerContext);
|
|
295
|
+
return _context4.abrupt("return", responseDetails);
|
|
296
|
+
case 3:
|
|
297
|
+
_context4.prev = 3;
|
|
298
|
+
_t2 = _context4["catch"](1);
|
|
299
|
+
_Logger.default.error("Failed to get recordings: ".concat((0, _stringify.default)(_t2)), loggerContext);
|
|
300
|
+
_context4.next = 4;
|
|
301
|
+
return (0, _Utils.uploadLogs)();
|
|
302
|
+
case 4:
|
|
303
|
+
errorInfo = _t2;
|
|
304
|
+
return _context4.abrupt("return", (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext));
|
|
305
|
+
case 5:
|
|
306
|
+
case "end":
|
|
307
|
+
return _context4.stop();
|
|
308
|
+
}
|
|
309
|
+
}, _callee4, this, [[1, 3]]);
|
|
310
|
+
}));
|
|
311
|
+
function getRecordings(_x4) {
|
|
312
|
+
return _getRecordings.apply(this, arguments);
|
|
313
|
+
}
|
|
314
|
+
return getRecordings;
|
|
315
|
+
}()
|
|
316
|
+
/**
|
|
317
|
+
* Fetches a single converged recording by its id.
|
|
318
|
+
* @param recordingId - The recording id (`id`).
|
|
319
|
+
*/
|
|
320
|
+
)
|
|
321
|
+
}, {
|
|
322
|
+
key: "getRecording",
|
|
323
|
+
value: (function () {
|
|
324
|
+
var _getRecording = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(recordingId) {
|
|
325
|
+
var loggerContext, _response$headers2, url, response, responseDetails, errorInfo, _t3;
|
|
326
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
327
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
328
|
+
case 0:
|
|
329
|
+
loggerContext = {
|
|
330
|
+
file: _constants2.CALL_RECORDING_FILE,
|
|
331
|
+
method: _constants2.METHODS.GET_RECORDING
|
|
332
|
+
};
|
|
333
|
+
_Logger.default.info("".concat(_constants.METHOD_START_MESSAGE, " with recordingId=").concat(recordingId), loggerContext);
|
|
334
|
+
_context5.prev = 1;
|
|
335
|
+
url = "".concat(this.recordingServiceUrl, "/").concat(_constants2.CONVERGED_RECORDINGS, "/").concat(recordingId);
|
|
336
|
+
_context5.next = 2;
|
|
337
|
+
return this.webex.request({
|
|
338
|
+
uri: url,
|
|
339
|
+
method: _types.HTTP_METHODS.GET,
|
|
340
|
+
service: _types.ALLOWED_SERVICES.HYDRA_DEVELOPER_API
|
|
341
|
+
});
|
|
342
|
+
case 2:
|
|
343
|
+
response = _context5.sent;
|
|
344
|
+
_Logger.default.log("Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers2 = response.headers) === null || _response$headers2 === void 0 ? void 0 : _response$headers2.trackingid), loggerContext);
|
|
345
|
+
responseDetails = {
|
|
346
|
+
statusCode: Number(response.statusCode) || _constants.SUCCESS_STATUS_CODE,
|
|
347
|
+
data: {
|
|
348
|
+
recording: response.body
|
|
349
|
+
},
|
|
350
|
+
message: _constants.SUCCESS_MESSAGE
|
|
351
|
+
};
|
|
352
|
+
_Logger.default.log("Successfully retrieved recording ".concat(recordingId), loggerContext);
|
|
353
|
+
return _context5.abrupt("return", responseDetails);
|
|
354
|
+
case 3:
|
|
355
|
+
_context5.prev = 3;
|
|
356
|
+
_t3 = _context5["catch"](1);
|
|
357
|
+
_Logger.default.error("Failed to get recording: ".concat((0, _stringify.default)(_t3)), loggerContext);
|
|
358
|
+
_context5.next = 4;
|
|
359
|
+
return (0, _Utils.uploadLogs)();
|
|
360
|
+
case 4:
|
|
361
|
+
errorInfo = _t3;
|
|
362
|
+
return _context5.abrupt("return", (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext));
|
|
363
|
+
case 5:
|
|
364
|
+
case "end":
|
|
365
|
+
return _context5.stop();
|
|
366
|
+
}
|
|
367
|
+
}, _callee5, this, [[1, 3]]);
|
|
368
|
+
}));
|
|
369
|
+
function getRecording(_x5) {
|
|
370
|
+
return _getRecording.apply(this, arguments);
|
|
371
|
+
}
|
|
372
|
+
return getRecording;
|
|
373
|
+
}()
|
|
374
|
+
/**
|
|
375
|
+
* Returns all recordings linked to a given call session id.
|
|
376
|
+
*
|
|
377
|
+
* Note (documented API gap): the recording API does not expose a confirmed server-side query parameter
|
|
378
|
+
* to filter by call session id, so a list is fetched and filtered client-side on
|
|
379
|
+
* `serviceData.callSessionId`. The scan is bounded by the list query, so `options` is forwarded
|
|
380
|
+
* to {@link getRecordings} to let callers widen the time window/status/page when the target
|
|
381
|
+
* session may fall outside the defaults.
|
|
382
|
+
*
|
|
383
|
+
* @param callSessionId - The call session id to filter by.
|
|
384
|
+
* @param options - Optional list query forwarded to {@link getRecordings} to control the
|
|
385
|
+
* set of recordings scanned before filtering.
|
|
386
|
+
*/
|
|
387
|
+
)
|
|
388
|
+
}, {
|
|
389
|
+
key: "getRecordingsByCallSessionId",
|
|
390
|
+
value: (function () {
|
|
391
|
+
var _getRecordingsByCallSessionId = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(callSessionId, options) {
|
|
392
|
+
var _listResponse$data$re;
|
|
393
|
+
var loggerContext, listResponse, filtered;
|
|
394
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
395
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
396
|
+
case 0:
|
|
397
|
+
loggerContext = {
|
|
398
|
+
file: _constants2.CALL_RECORDING_FILE,
|
|
399
|
+
method: _constants2.METHODS.GET_RECORDINGS_BY_CALL_SESSION_ID
|
|
400
|
+
};
|
|
401
|
+
_Logger.default.info("".concat(_constants.METHOD_START_MESSAGE, " with callSessionId=").concat(callSessionId), loggerContext);
|
|
402
|
+
_context6.next = 1;
|
|
403
|
+
return this.getRecordings(options);
|
|
404
|
+
case 1:
|
|
405
|
+
listResponse = _context6.sent;
|
|
406
|
+
if (!(listResponse.statusCode !== _constants.SUCCESS_STATUS_CODE)) {
|
|
407
|
+
_context6.next = 2;
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
return _context6.abrupt("return", listResponse);
|
|
411
|
+
case 2:
|
|
412
|
+
filtered = ((_listResponse$data$re = listResponse.data.recordings) !== null && _listResponse$data$re !== void 0 ? _listResponse$data$re : []).filter(function (recording) {
|
|
413
|
+
var _recording$serviceDat;
|
|
414
|
+
return ((_recording$serviceDat = recording.serviceData) === null || _recording$serviceDat === void 0 ? void 0 : _recording$serviceDat.callSessionId) === callSessionId;
|
|
415
|
+
});
|
|
416
|
+
if (filtered.length === 0) {
|
|
417
|
+
_Logger.default.info(_constants2.RECORDING_NOT_FOUND_MESSAGE, loggerContext);
|
|
418
|
+
} else {
|
|
419
|
+
_Logger.default.log("Successfully retrieved ".concat(filtered.length, " recordings for call session ").concat(callSessionId), loggerContext);
|
|
420
|
+
}
|
|
421
|
+
return _context6.abrupt("return", {
|
|
422
|
+
statusCode: _constants.SUCCESS_STATUS_CODE,
|
|
423
|
+
data: {
|
|
424
|
+
recordings: filtered
|
|
425
|
+
},
|
|
426
|
+
message: _constants.SUCCESS_MESSAGE
|
|
427
|
+
});
|
|
428
|
+
case 3:
|
|
429
|
+
case "end":
|
|
430
|
+
return _context6.stop();
|
|
431
|
+
}
|
|
432
|
+
}, _callee6, this);
|
|
433
|
+
}));
|
|
434
|
+
function getRecordingsByCallSessionId(_x6, _x7) {
|
|
435
|
+
return _getRecordingsByCallSessionId.apply(this, arguments);
|
|
436
|
+
}
|
|
437
|
+
return getRecordingsByCallSessionId;
|
|
438
|
+
}()
|
|
439
|
+
/**
|
|
440
|
+
* Fetches the metadata for a single recording.
|
|
441
|
+
* @param recordingId - The recording id (`id`).
|
|
442
|
+
*/
|
|
443
|
+
)
|
|
444
|
+
}, {
|
|
445
|
+
key: "getRecordingMetadata",
|
|
446
|
+
value: (function () {
|
|
447
|
+
var _getRecordingMetadata = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7(recordingId) {
|
|
448
|
+
var loggerContext, _response$headers3, url, response, responseDetails, errorInfo, _t4;
|
|
449
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
450
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
451
|
+
case 0:
|
|
452
|
+
loggerContext = {
|
|
453
|
+
file: _constants2.CALL_RECORDING_FILE,
|
|
454
|
+
method: _constants2.METHODS.GET_RECORDING_METADATA
|
|
455
|
+
};
|
|
456
|
+
_Logger.default.info("".concat(_constants.METHOD_START_MESSAGE, " with recordingId=").concat(recordingId), loggerContext);
|
|
457
|
+
_context7.prev = 1;
|
|
458
|
+
url = "".concat(this.recordingServiceUrl, "/").concat(_constants2.CONVERGED_RECORDINGS, "/").concat(recordingId, "/").concat(_constants2.METADATA);
|
|
459
|
+
_context7.next = 2;
|
|
460
|
+
return this.webex.request({
|
|
461
|
+
uri: url,
|
|
462
|
+
method: _types.HTTP_METHODS.GET,
|
|
463
|
+
service: _types.ALLOWED_SERVICES.HYDRA_DEVELOPER_API
|
|
464
|
+
});
|
|
465
|
+
case 2:
|
|
466
|
+
response = _context7.sent;
|
|
467
|
+
_Logger.default.log("Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers3 = response.headers) === null || _response$headers3 === void 0 ? void 0 : _response$headers3.trackingid), loggerContext);
|
|
468
|
+
responseDetails = {
|
|
469
|
+
statusCode: Number(response.statusCode) || _constants.SUCCESS_STATUS_CODE,
|
|
470
|
+
data: {
|
|
471
|
+
metadata: response.body
|
|
472
|
+
},
|
|
473
|
+
message: _constants.SUCCESS_MESSAGE
|
|
474
|
+
};
|
|
475
|
+
_Logger.default.log("Successfully retrieved metadata for recording ".concat(recordingId), loggerContext);
|
|
476
|
+
return _context7.abrupt("return", responseDetails);
|
|
477
|
+
case 3:
|
|
478
|
+
_context7.prev = 3;
|
|
479
|
+
_t4 = _context7["catch"](1);
|
|
480
|
+
_Logger.default.error("Failed to get recording metadata: ".concat((0, _stringify.default)(_t4)), loggerContext);
|
|
481
|
+
_context7.next = 4;
|
|
482
|
+
return (0, _Utils.uploadLogs)();
|
|
483
|
+
case 4:
|
|
484
|
+
errorInfo = _t4;
|
|
485
|
+
return _context7.abrupt("return", (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext));
|
|
486
|
+
case 5:
|
|
487
|
+
case "end":
|
|
488
|
+
return _context7.stop();
|
|
489
|
+
}
|
|
490
|
+
}, _callee7, this, [[1, 3]]);
|
|
491
|
+
}));
|
|
492
|
+
function getRecordingMetadata(_x8) {
|
|
493
|
+
return _getRecordingMetadata.apply(this, arguments);
|
|
494
|
+
}
|
|
495
|
+
return getRecordingMetadata;
|
|
496
|
+
}()
|
|
497
|
+
/**
|
|
498
|
+
* Permanently deletes a single recording. Per the API the recording cannot be recovered.
|
|
499
|
+
* @param recordingId - The recording id (`id`) to delete.
|
|
500
|
+
* @param options - Optional `reason`/`comment`, only required for Compliance Officer deletions.
|
|
501
|
+
*/
|
|
502
|
+
)
|
|
503
|
+
}, {
|
|
504
|
+
key: "deleteRecording",
|
|
505
|
+
value: (function () {
|
|
506
|
+
var _deleteRecording = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(recordingId, options) {
|
|
507
|
+
var loggerContext, _response$headers4, url, body, response, responseDetails, errorInfo, _t5;
|
|
508
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
509
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
510
|
+
case 0:
|
|
511
|
+
loggerContext = {
|
|
512
|
+
file: _constants2.CALL_RECORDING_FILE,
|
|
513
|
+
method: _constants2.METHODS.DELETE_RECORDING
|
|
514
|
+
};
|
|
515
|
+
_Logger.default.info("".concat(_constants.METHOD_START_MESSAGE, " with recordingId=").concat(recordingId), loggerContext);
|
|
516
|
+
_context8.prev = 1;
|
|
517
|
+
url = "".concat(this.recordingServiceUrl, "/").concat(_constants2.CONVERGED_RECORDINGS, "/").concat(recordingId);
|
|
518
|
+
body = {};
|
|
519
|
+
if (options !== null && options !== void 0 && options.reason) {
|
|
520
|
+
body.reason = options.reason;
|
|
521
|
+
}
|
|
522
|
+
if (options !== null && options !== void 0 && options.comment) {
|
|
523
|
+
body.comment = options.comment;
|
|
524
|
+
}
|
|
525
|
+
_context8.next = 2;
|
|
526
|
+
return this.webex.request(_objectSpread({
|
|
527
|
+
uri: url,
|
|
528
|
+
method: _types.HTTP_METHODS.DELETE,
|
|
529
|
+
service: _types.ALLOWED_SERVICES.HYDRA_DEVELOPER_API
|
|
530
|
+
}, (0, _keys.default)(body).length > 0 ? {
|
|
531
|
+
body: body
|
|
532
|
+
} : {}));
|
|
533
|
+
case 2:
|
|
534
|
+
response = _context8.sent;
|
|
535
|
+
_Logger.default.log("Response trackingId: ".concat(response === null || response === void 0 ? void 0 : (_response$headers4 = response.headers) === null || _response$headers4 === void 0 ? void 0 : _response$headers4.trackingid), loggerContext);
|
|
536
|
+
responseDetails = {
|
|
537
|
+
statusCode: Number(response.statusCode) || _constants.SUCCESS_STATUS_CODE,
|
|
538
|
+
data: {},
|
|
539
|
+
message: _constants.SUCCESS_MESSAGE
|
|
540
|
+
};
|
|
541
|
+
_Logger.default.log("Successfully deleted recording ".concat(recordingId), loggerContext);
|
|
542
|
+
return _context8.abrupt("return", responseDetails);
|
|
543
|
+
case 3:
|
|
544
|
+
_context8.prev = 3;
|
|
545
|
+
_t5 = _context8["catch"](1);
|
|
546
|
+
_Logger.default.error("Failed to delete recording: ".concat((0, _stringify.default)(_t5)), loggerContext);
|
|
547
|
+
_context8.next = 4;
|
|
548
|
+
return (0, _Utils.uploadLogs)();
|
|
549
|
+
case 4:
|
|
550
|
+
errorInfo = _t5;
|
|
551
|
+
return _context8.abrupt("return", (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext));
|
|
552
|
+
case 5:
|
|
553
|
+
case "end":
|
|
554
|
+
return _context8.stop();
|
|
555
|
+
}
|
|
556
|
+
}, _callee8, this, [[1, 3]]);
|
|
557
|
+
}));
|
|
558
|
+
function deleteRecording(_x9, _x0) {
|
|
559
|
+
return _deleteRecording.apply(this, arguments);
|
|
560
|
+
}
|
|
561
|
+
return deleteRecording;
|
|
562
|
+
}())
|
|
563
|
+
}, {
|
|
564
|
+
key: "registerRecordingListeners",
|
|
565
|
+
value:
|
|
566
|
+
/**
|
|
567
|
+
* Subscribes to the recording Mercury events and re-emits them as typed client events.
|
|
568
|
+
*/
|
|
569
|
+
function registerRecordingListeners() {
|
|
570
|
+
this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.RECORDING_EVENT_CREATED, this.handleRecordingCreatedEvent);
|
|
571
|
+
this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.RECORDING_EVENT_UPDATED, this.handleRecordingUpdatedEvent);
|
|
572
|
+
this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.RECORDING_EVENT_DELETED, this.handleRecordingDeletedEvent);
|
|
573
|
+
}
|
|
574
|
+
}]);
|
|
575
|
+
}(_impl.Eventing);
|
|
576
|
+
//# sourceMappingURL=WxcCallRecordingConnector.js.map
|