@dolbyio/dolbyio-rest-apis-client 3.6.1 → 4.0.0

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.
Files changed (45) hide show
  1. package/dist/authentication.d.ts +5 -5
  2. package/dist/authentication.js +9 -7
  3. package/dist/communications/authentication.d.ts +0 -14
  4. package/dist/communications/authentication.js +16 -67
  5. package/dist/communications/conference.js +15 -16
  6. package/dist/communications/monitor/conferences.d.ts +1 -0
  7. package/dist/communications/monitor/conferences.js +9 -7
  8. package/dist/communications/monitor/recordings.d.ts +28 -15
  9. package/dist/communications/monitor/recordings.js +86 -56
  10. package/dist/communications/monitor/webhooks.js +5 -3
  11. package/dist/communications/recording.d.ts +28 -12
  12. package/dist/communications/recording.js +69 -48
  13. package/dist/communications/remix.js +73 -55
  14. package/dist/communications/streaming.d.ts +44 -21
  15. package/dist/communications/streaming.js +132 -101
  16. package/dist/communications/types/mixOptions.d.ts +39 -0
  17. package/dist/communications/types/mixOptions.js +5 -0
  18. package/dist/communications/types/recordings.d.ts +58 -47
  19. package/dist/communications/types/rtsStream.d.ts +10 -0
  20. package/dist/communications/types/rtsStream.js +1 -0
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.js +4 -2
  23. package/dist/internal/utils.d.ts +6 -0
  24. package/dist/internal/utils.js +5 -0
  25. package/dist/media/internal/jobsHelpers.js +5 -3
  26. package/dist/media/io.js +4 -2
  27. package/dist/media/jobs.js +6 -4
  28. package/dist/media/webhooks.js +7 -5
  29. package/dist/streaming/cluster.js +5 -3
  30. package/dist/streaming/director.js +5 -3
  31. package/dist/streaming/geo.js +5 -3
  32. package/dist/streaming/publishToken.js +11 -9
  33. package/dist/streaming/stream.js +5 -3
  34. package/dist/streaming/subscribeToken.js +8 -6
  35. package/dist/urls.d.ts +13 -0
  36. package/dist/urls.js +37 -0
  37. package/package.json +8 -9
  38. package/dist/communications/internal/urls.d.ts +0 -2
  39. package/dist/communications/internal/urls.js +0 -10
  40. package/dist/internal/urls.d.ts +0 -1
  41. package/dist/internal/urls.js +0 -8
  42. package/dist/media/internal/urls.d.ts +0 -1
  43. package/dist/media/internal/urls.js +0 -8
  44. package/dist/streaming/internal/urls.d.ts +0 -2
  45. package/dist/streaming/internal/urls.js +0 -10
@@ -4,10 +4,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.getRecordings = exports.getRecording = exports.getDolbyVoiceRecording = exports.getAllRecordings = exports.deleteRecording = void 0;
7
+ exports.getRecordings = exports.getConferenceRecordings = exports.getAllRecordings = exports.getAllConferenceRecordings = exports.deleteRecording = void 0;
8
8
  var _httpHelpers = require("../../internal/httpHelpers");
9
9
  var _httpHelpers2 = require("../internal/httpHelpers");
10
- var _urls = require("../internal/urls");
10
+ var Urls = _interopRequireWildcard(require("../../urls"));
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
13
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
12
14
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
15
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -16,6 +18,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
16
18
  * This API checks only the recordings that have ended during a specific time range.
17
19
  * Recordings are indexed based on the ending time.
18
20
  *
21
+ * This API returns presigned URLs for secure download of the recording files.
22
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
23
+ *
19
24
  * @link https://docs.dolby.io/communications-apis/reference/get-recordings
20
25
  *
21
26
  * @param accessToken Access token to use for authentication.
@@ -40,24 +45,25 @@ var getRecordings = /*#__PURE__*/function () {
40
45
  to: opts.to.toString(),
41
46
  max: opts.max.toString()
42
47
  };
43
- if (opts.start) {
44
- params['start'] = opts.start;
45
- }
48
+ if (opts.start) params['start'] = opts.start;
49
+ if (opts.region) params['region'] = opts.region;
50
+ if (opts.type) params['type'] = opts.type;
51
+ if (opts.mediaType) params['mediaType'] = opts.mediaType;
46
52
  requestOptions = {
47
- hostname: _urls.COMMS_HOSTNAME,
48
- path: '/v1/monitor/recordings',
53
+ hostname: Urls.getCommsHostname(),
54
+ path: '/v2/monitor/recordings',
49
55
  params: params,
50
56
  headers: {
51
57
  Accept: 'application/json',
52
58
  Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
53
59
  }
54
60
  };
55
- _context.next = 7;
61
+ _context.next = 10;
56
62
  return (0, _httpHelpers.sendGet)(requestOptions);
57
- case 7:
63
+ case 10:
58
64
  response = _context.sent;
59
65
  return _context.abrupt("return", response);
60
- case 9:
66
+ case 12:
61
67
  case "end":
62
68
  return _context.stop();
63
69
  }
@@ -73,6 +79,9 @@ var getRecordings = /*#__PURE__*/function () {
73
79
  * This API checks only the recordings that have ended during a specific time range.
74
80
  * Recordings are indexed based on the ending time.
75
81
  *
82
+ * This API returns presigned URLs for secure download of the recording files.
83
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
84
+ *
76
85
  * @link https://docs.dolby.io/communications-apis/reference/get-recordings
77
86
  *
78
87
  * @param accessToken Access token to use for authentication.
@@ -98,20 +107,23 @@ var getAllRecordings = /*#__PURE__*/function () {
98
107
  to: opts.to.toString(),
99
108
  max: opts.page_size.toString()
100
109
  };
110
+ if (opts.region) params['region'] = opts.region;
111
+ if (opts.type) params['type'] = opts.type;
112
+ if (opts.mediaType) params['mediaType'] = opts.mediaType;
101
113
  requestOptions = {
102
- hostname: _urls.COMMS_HOSTNAME,
103
- path: '/v1/monitor/recordings',
114
+ hostname: Urls.getCommsHostname(),
115
+ path: '/v2/monitor/recordings',
104
116
  params: params,
105
117
  headers: {
106
118
  Accept: 'application/json',
107
119
  Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
108
120
  }
109
121
  };
110
- _context2.next = 6;
122
+ _context2.next = 9;
111
123
  return (0, _httpHelpers2.getAll)(requestOptions, 'recordings');
112
- case 6:
124
+ case 9:
113
125
  return _context2.abrupt("return", _context2.sent);
114
- case 7:
126
+ case 10:
115
127
  case "end":
116
128
  return _context2.stop();
117
129
  }
@@ -127,15 +139,18 @@ var getAllRecordings = /*#__PURE__*/function () {
127
139
  * This API checks the recordings that have ended during a specific time range.
128
140
  * Recordings are indexed based on the ending time.
129
141
  *
142
+ * This API returns presigned URLs for secure download of the recording files.
143
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
144
+ *
130
145
  * @link https://docs.dolby.io/communications-apis/reference/get-conference-recordings
131
146
  *
132
147
  * @param accessToken Access token to use for authentication.
133
- * @param options Options to request the recording.
148
+ * @param options Options to request the recordings.
134
149
  *
135
- * @returns An array of {@link Recording} objects through a {@link Promise}.
150
+ * @returns A {@link GetConferenceRecordingsResponse} object through a {@link Promise}.
136
151
  */
137
152
  exports.getAllRecordings = getAllRecordings;
138
- var getRecording = /*#__PURE__*/function () {
153
+ var getConferenceRecordings = /*#__PURE__*/function () {
139
154
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(accessToken, options) {
140
155
  var optionsDefault, opts, params, requestOptions, response;
141
156
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -144,7 +159,8 @@ var getRecording = /*#__PURE__*/function () {
144
159
  optionsDefault = {
145
160
  from: 0,
146
161
  to: 9999999999999,
147
- max: 100
162
+ max: 100,
163
+ confId: ''
148
164
  };
149
165
  opts = Object.assign(optionsDefault, options);
150
166
  params = {
@@ -152,12 +168,10 @@ var getRecording = /*#__PURE__*/function () {
152
168
  to: opts.to.toString(),
153
169
  max: opts.max.toString()
154
170
  };
155
- if (opts.start) {
156
- params['start'] = opts.start;
157
- }
171
+ if (opts.start) params['start'] = opts.start;
158
172
  requestOptions = {
159
- hostname: _urls.COMMS_HOSTNAME,
160
- path: "/v1/monitor/conferences/".concat(opts.confId, "/recordings"),
173
+ hostname: Urls.getCommsHostname(),
174
+ path: "/v2/monitor/conferences/".concat(opts.confId, "/recordings"),
161
175
  params: params,
162
176
  headers: {
163
177
  Accept: 'application/json',
@@ -168,95 +182,111 @@ var getRecording = /*#__PURE__*/function () {
168
182
  return (0, _httpHelpers.sendGet)(requestOptions);
169
183
  case 7:
170
184
  response = _context3.sent;
171
- return _context3.abrupt("return", response.recordings);
185
+ return _context3.abrupt("return", response);
172
186
  case 9:
173
187
  case "end":
174
188
  return _context3.stop();
175
189
  }
176
190
  }, _callee3);
177
191
  }));
178
- return function getRecording(_x5, _x6) {
192
+ return function getConferenceRecordings(_x5, _x6) {
179
193
  return _ref3.apply(this, arguments);
180
194
  };
181
195
  }();
182
196
 
183
197
  /**
184
- * Delete all recording data related to a specific conference.
198
+ * Get a list of the recorded conference metadata, such as duration or size of the recording.
199
+ * This API checks only the recordings that have ended during a specific time range.
200
+ * Recordings are indexed based on the ending time.
185
201
  *
186
- * **Warning**: After deleting the recording, it is not possible to restore the recording data.
202
+ * This API returns presigned URLs for secure download of the recording files.
203
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
187
204
  *
188
- * @link https://docs.dolby.io/communications-apis/reference/delete-conference-recordings
205
+ * @link https://docs.dolby.io/communications-apis/reference/get-conference-recordings
189
206
  *
190
207
  * @param accessToken Access token to use for authentication.
191
- * @param confId Identifier of the conference.
208
+ * @param options Options to request the recordings.
209
+ *
210
+ * @returns An array of {@link Recording} objects through a {@link Promise}.
192
211
  */
193
- exports.getRecording = getRecording;
194
- var deleteRecording = /*#__PURE__*/function () {
195
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(accessToken, confId) {
196
- var requestOptions;
212
+ exports.getConferenceRecordings = getConferenceRecordings;
213
+ var getAllConferenceRecordings = /*#__PURE__*/function () {
214
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(accessToken, options) {
215
+ var optionsDefault, opts, params, requestOptions;
197
216
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
198
217
  while (1) switch (_context4.prev = _context4.next) {
199
218
  case 0:
219
+ optionsDefault = {
220
+ from: 0,
221
+ to: 9999999999999,
222
+ page_size: 100,
223
+ confId: ''
224
+ };
225
+ opts = Object.assign(optionsDefault, options);
226
+ params = {
227
+ from: opts.from.toString(),
228
+ to: opts.to.toString(),
229
+ max: opts.page_size.toString()
230
+ };
200
231
  requestOptions = {
201
- hostname: _urls.COMMS_HOSTNAME,
202
- path: "/v1/monitor/conferences/".concat(confId, "/recordings"),
232
+ hostname: Urls.getCommsHostname(),
233
+ path: "/v2/monitor/conferences/".concat(opts.confId, "/recordings"),
234
+ params: params,
203
235
  headers: {
204
236
  Accept: 'application/json',
205
237
  Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
206
238
  }
207
239
  };
208
- _context4.next = 3;
209
- return (0, _httpHelpers.sendDelete)(requestOptions);
210
- case 3:
240
+ _context4.next = 6;
241
+ return (0, _httpHelpers2.getAll)(requestOptions, 'recordings');
242
+ case 6:
243
+ return _context4.abrupt("return", _context4.sent);
244
+ case 7:
211
245
  case "end":
212
246
  return _context4.stop();
213
247
  }
214
248
  }, _callee4);
215
249
  }));
216
- return function deleteRecording(_x7, _x8) {
250
+ return function getAllConferenceRecordings(_x7, _x8) {
217
251
  return _ref4.apply(this, arguments);
218
252
  };
219
253
  }();
220
254
 
221
255
  /**
222
- * Get details of all Dolby Voice-based audio recordings, and associated split recordings,
223
- * for a given conference and download the conference recording in the MP3 audio format.
256
+ * Deletes all recording data related to a specific conference, even data downloaded using the v1 Monitor API.
257
+ *
258
+ * **Warning**: After deleting the recording, it is not possible to restore the recording data.
224
259
  *
225
- * @link https://docs.dolby.io/communications-apis/reference/get-dolby-voice-audio-recordings
260
+ * @link https://docs.dolby.io/communications-apis/reference/delete-conference-recordings
226
261
  *
227
262
  * @param accessToken Access token to use for authentication.
228
263
  * @param confId Identifier of the conference.
229
- *
230
- * @returns A {@link DolbyVoiceRecording} object through a {@link Promise}.
231
264
  */
232
- exports.deleteRecording = deleteRecording;
233
- var getDolbyVoiceRecording = /*#__PURE__*/function () {
265
+ exports.getAllConferenceRecordings = getAllConferenceRecordings;
266
+ var deleteRecording = /*#__PURE__*/function () {
234
267
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(accessToken, confId) {
235
- var requestOptions, response;
268
+ var requestOptions;
236
269
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
237
270
  while (1) switch (_context5.prev = _context5.next) {
238
271
  case 0:
239
272
  requestOptions = {
240
- hostname: _urls.COMMS_HOSTNAME,
241
- path: "/v1/monitor/conferences/".concat(confId, "/recordings/audio"),
273
+ hostname: Urls.getCommsHostname(),
274
+ path: "/v2/monitor/conferences/".concat(confId, "/recordings"),
242
275
  headers: {
243
276
  Accept: 'application/json',
244
277
  Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
245
278
  }
246
279
  };
247
280
  _context5.next = 3;
248
- return (0, _httpHelpers.sendGet)(requestOptions);
281
+ return (0, _httpHelpers.sendDelete)(requestOptions);
249
282
  case 3:
250
- response = _context5.sent;
251
- return _context5.abrupt("return", response);
252
- case 5:
253
283
  case "end":
254
284
  return _context5.stop();
255
285
  }
256
286
  }, _callee5);
257
287
  }));
258
- return function getDolbyVoiceRecording(_x9, _x10) {
288
+ return function deleteRecording(_x9, _x10) {
259
289
  return _ref5.apply(this, arguments);
260
290
  };
261
291
  }();
262
- exports.getDolbyVoiceRecording = getDolbyVoiceRecording;
292
+ exports.deleteRecording = deleteRecording;
@@ -7,7 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getEvents = exports.getAllEvents = void 0;
8
8
  var _httpHelpers = require("../../internal/httpHelpers");
9
9
  var _httpHelpers2 = require("../internal/httpHelpers");
10
- var _urls = require("../internal/urls");
10
+ var Urls = _interopRequireWildcard(require("../../urls"));
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
13
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
12
14
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
15
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -50,7 +52,7 @@ var getEvents = /*#__PURE__*/function () {
50
52
  params['start'] = opts.start;
51
53
  }
52
54
  requestOptions = {
53
- hostname: _urls.COMMS_HOSTNAME,
55
+ hostname: Urls.getCommsHostname(),
54
56
  path: path,
55
57
  params: params,
56
58
  headers: {
@@ -111,7 +113,7 @@ var getAllEvents = /*#__PURE__*/function () {
111
113
  params['type'] = opts.type;
112
114
  }
113
115
  requestOptions = {
114
- hostname: _urls.COMMS_HOSTNAME,
116
+ hostname: Urls.getCommsHostname(),
115
117
  path: path,
116
118
  params: params,
117
119
  headers: {
@@ -1,24 +1,40 @@
1
+ import { Expand, ExpandRecursively } from '../internal/utils';
1
2
  import JwtToken from '../types/jwtToken';
3
+ import { MixOptionsBase, MixOptionsComplex } from './types/mixOptions';
2
4
  /**
3
5
  * Starts recording for the specified conference.
4
6
  *
5
- * You can specify a custom layout URL per recording request.
6
- * The {@link layoutUrl} parameter overrides the layout URL configured in the dashboard.
7
+ * You can specify a custom layout URL per a recording request.
8
+ * The {@link MixOptionsComplex.layoutUrl} parameter overrides the layout URL configured in the dashboard.
7
9
  *
8
10
  * @link https://docs.dolby.io/communications-apis/reference/api-recording-start
9
11
  *
10
- * @param accessToken Access token to use for authentication.
11
- * @param conferenceId Identifier of the conference.
12
- * @param layoutUrl Overwrites the layout URL configuration.
13
- * This field is ignored if it is not relevant regarding recording configuration,
14
- * for example if live_recording set to false or if the recording is MP3 only.
15
- * - `null`: uses the layout URL configured in the dashboard (if no URL is set in the dashboard, then uses the Dolby.io default);
16
- * - `default`: uses the Dolby.io default layout;
17
- * - URL string: uses this layout URL
12
+ * @param options Recording options.
13
+ */
14
+ export declare function start(options: Expand<MixOptionsBase>): Promise<void>;
15
+ /**
16
+ * Starts recording for the specified conference.
17
+ *
18
+ * You can specify a custom layout URL per a recording request.
19
+ * The {@link MixOptionsComplex.layoutUrl} parameter overrides the layout URL configured in the dashboard.
20
+ *
21
+ * You can also specify the resolution of the recording.
22
+ * The default mixer layout application supports both 1920x1080 (16:9 aspect ratio) and 1080x1920 (9:16 aspect ratio).
23
+ * If the {@link MixOptionsComplex.resolution} parameter is not specified, then the system defaults to 1920x1080.
24
+ *
25
+ * Using the {@link MixOptionsComplex.mixId} parameter you can uniquely identify individual mixed recordings.
26
+ * For example, `landscape-stage` and `portrait-audience` as mixId can help you identify the purpose of the recording
27
+ * when you receive the webhook notification or use the Monitor API to retrieve the recordings.
28
+ * You may start only one recording per mixId.
29
+ *
30
+ * @link https://docs.dolby.io/communications-apis/reference/api-recording-start
31
+ *
32
+ * @param options Recording options.
18
33
  */
19
- export declare const start: (accessToken: JwtToken, conferenceId: string, layoutUrl?: string) => Promise<void>;
34
+ export declare function start(options: ExpandRecursively<MixOptionsComplex>): Promise<void>;
20
35
  /**
21
- * Stops the recording of the specified conference.
36
+ * Stops recording the specified conference.
37
+ * Calling this API while recoding multiple mixed recordings stops all recordings.
22
38
  *
23
39
  * @link https://docs.dolby.io/communications-apis/reference/api-recording-stop
24
40
  *
@@ -4,77 +4,98 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.stop = exports.start = void 0;
7
+ exports.start = start;
8
+ exports.stop = void 0;
8
9
  var _httpHelpers = require("../internal/httpHelpers");
9
- var _urls = require("./internal/urls");
10
+ var Urls = _interopRequireWildcard(require("../urls"));
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
13
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
11
14
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
15
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
16
  /**
14
17
  * Starts recording for the specified conference.
15
18
  *
16
- * You can specify a custom layout URL per recording request.
17
- * The {@link layoutUrl} parameter overrides the layout URL configured in the dashboard.
19
+ * You can specify a custom layout URL per a recording request.
20
+ * The {@link MixOptionsComplex.layoutUrl} parameter overrides the layout URL configured in the dashboard.
21
+ *
22
+ * @link https://docs.dolby.io/communications-apis/reference/api-recording-start
23
+ *
24
+ * @param options Recording options.
25
+ */
26
+ /**
27
+ * Starts recording for the specified conference.
28
+ *
29
+ * You can specify a custom layout URL per a recording request.
30
+ * The {@link MixOptionsComplex.layoutUrl} parameter overrides the layout URL configured in the dashboard.
31
+ *
32
+ * You can also specify the resolution of the recording.
33
+ * The default mixer layout application supports both 1920x1080 (16:9 aspect ratio) and 1080x1920 (9:16 aspect ratio).
34
+ * If the {@link MixOptionsComplex.resolution} parameter is not specified, then the system defaults to 1920x1080.
35
+ *
36
+ * Using the {@link MixOptionsComplex.mixId} parameter you can uniquely identify individual mixed recordings.
37
+ * For example, `landscape-stage` and `portrait-audience` as mixId can help you identify the purpose of the recording
38
+ * when you receive the webhook notification or use the Monitor API to retrieve the recordings.
39
+ * You may start only one recording per mixId.
18
40
  *
19
41
  * @link https://docs.dolby.io/communications-apis/reference/api-recording-start
20
42
  *
43
+ * @param options Recording options.
44
+ */
45
+ function start(_x) {
46
+ return _start.apply(this, arguments);
47
+ }
48
+ /**
49
+ * Stops recording the specified conference.
50
+ * Calling this API while recoding multiple mixed recordings stops all recordings.
51
+ *
52
+ * @link https://docs.dolby.io/communications-apis/reference/api-recording-stop
53
+ *
21
54
  * @param accessToken Access token to use for authentication.
22
55
  * @param conferenceId Identifier of the conference.
23
- * @param layoutUrl Overwrites the layout URL configuration.
24
- * This field is ignored if it is not relevant regarding recording configuration,
25
- * for example if live_recording set to false or if the recording is MP3 only.
26
- * - `null`: uses the layout URL configured in the dashboard (if no URL is set in the dashboard, then uses the Dolby.io default);
27
- * - `default`: uses the Dolby.io default layout;
28
- * - URL string: uses this layout URL
29
56
  */
30
- var start = /*#__PURE__*/function () {
31
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, conferenceId, layoutUrl) {
32
- var body, options;
33
- return _regeneratorRuntime().wrap(function _callee$(_context) {
34
- while (1) switch (_context.prev = _context.next) {
57
+ function _start() {
58
+ _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
59
+ var body, optionsExt, requestOptions;
60
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
61
+ while (1) switch (_context2.prev = _context2.next) {
35
62
  case 0:
36
63
  body = {};
37
- if (layoutUrl) body['layoutUrl'] = layoutUrl;
38
- options = {
39
- hostname: _urls.COMMS_HOSTNAME,
40
- path: "/v2/conferences/mix/".concat(conferenceId, "/recording/start"),
64
+ optionsExt = options;
65
+ if (optionsExt.layoutUrl) body['layoutUrl'] = optionsExt.layoutUrl;
66
+ if (optionsExt.resolution) {
67
+ body['height'] = optionsExt.resolution.height;
68
+ body['width'] = optionsExt.resolution.width;
69
+ }
70
+ if (optionsExt.mixId) body['mixId'] = optionsExt.mixId;
71
+ requestOptions = {
72
+ hostname: Urls.getCommsHostname(),
73
+ path: "/v2/conferences/mix/".concat(options.conferenceId, "/recording/start"),
41
74
  headers: {
42
75
  Accept: 'application/json',
43
76
  'Content-Type': 'application/json',
44
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
77
+ Authorization: "".concat(options.accessToken.token_type, " ").concat(options.accessToken.access_token)
45
78
  },
46
79
  body: JSON.stringify(body)
47
80
  };
48
- _context.next = 5;
49
- return (0, _httpHelpers.sendPost)(options);
50
- case 5:
81
+ _context2.next = 8;
82
+ return (0, _httpHelpers.sendPost)(requestOptions);
83
+ case 8:
51
84
  case "end":
52
- return _context.stop();
85
+ return _context2.stop();
53
86
  }
54
- }, _callee);
87
+ }, _callee2);
55
88
  }));
56
- return function start(_x, _x2, _x3) {
57
- return _ref.apply(this, arguments);
58
- };
59
- }();
60
-
61
- /**
62
- * Stops the recording of the specified conference.
63
- *
64
- * @link https://docs.dolby.io/communications-apis/reference/api-recording-stop
65
- *
66
- * @param accessToken Access token to use for authentication.
67
- * @param conferenceId Identifier of the conference.
68
- */
69
- exports.start = start;
89
+ return _start.apply(this, arguments);
90
+ }
70
91
  var stop = /*#__PURE__*/function () {
71
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, conferenceId) {
92
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, conferenceId) {
72
93
  var options;
73
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
74
- while (1) switch (_context2.prev = _context2.next) {
94
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
95
+ while (1) switch (_context.prev = _context.next) {
75
96
  case 0:
76
97
  options = {
77
- hostname: _urls.COMMS_HOSTNAME,
98
+ hostname: Urls.getCommsHostname(),
78
99
  path: "/v2/conferences/mix/".concat(conferenceId, "/recording/stop"),
79
100
  headers: {
80
101
  Accept: 'application/json',
@@ -82,16 +103,16 @@ var stop = /*#__PURE__*/function () {
82
103
  Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
83
104
  }
84
105
  };
85
- _context2.next = 3;
106
+ _context.next = 3;
86
107
  return (0, _httpHelpers.sendPost)(options);
87
108
  case 3:
88
109
  case "end":
89
- return _context2.stop();
110
+ return _context.stop();
90
111
  }
91
- }, _callee2);
112
+ }, _callee);
92
113
  }));
93
- return function stop(_x4, _x5) {
94
- return _ref2.apply(this, arguments);
114
+ return function stop(_x2, _x3) {
115
+ return _ref.apply(this, arguments);
95
116
  };
96
117
  }();
97
118
  exports.stop = stop;