@dolbyio/dolbyio-rest-apis-client 3.5.4 → 3.6.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 (40) hide show
  1. package/README.md +27 -6
  2. package/dist/authentication.d.ts +15 -2
  3. package/dist/authentication.js +47 -31
  4. package/dist/communications/authentication.d.ts +17 -2
  5. package/dist/communications/authentication.js +84 -32
  6. package/dist/communications/conference.js +192 -206
  7. package/dist/communications/internal/httpHelpers.js +36 -38
  8. package/dist/communications/monitor/conferences.js +217 -229
  9. package/dist/communications/monitor/recordings.js +127 -137
  10. package/dist/communications/monitor/webhooks.js +77 -81
  11. package/dist/communications/recording.js +36 -40
  12. package/dist/communications/remix.js +42 -46
  13. package/dist/communications/streaming.js +78 -86
  14. package/dist/communications/types/authentication.d.ts +25 -0
  15. package/dist/communications/types/authentication.js +5 -0
  16. package/dist/index.js +1 -1
  17. package/dist/internal/httpHelpers.js +25 -29
  18. package/dist/media/analyze.js +19 -23
  19. package/dist/media/analyzeMusic.js +19 -23
  20. package/dist/media/analyzeSpeech.js +19 -23
  21. package/dist/media/diagnose.js +19 -23
  22. package/dist/media/enhance.js +19 -23
  23. package/dist/media/internal/jobsHelpers.js +46 -50
  24. package/dist/media/io.js +75 -85
  25. package/dist/media/jobs.js +97 -103
  26. package/dist/media/mastering.js +37 -45
  27. package/dist/media/transcode.js +19 -23
  28. package/dist/media/types/analyzeMusic.d.ts +50 -1
  29. package/dist/media/types/diagnose.d.ts +84 -1
  30. package/dist/media/types/jobResults.d.ts +1 -0
  31. package/dist/media/webhooks.js +105 -113
  32. package/dist/streaming/cluster.js +39 -43
  33. package/dist/streaming/director.js +46 -50
  34. package/dist/streaming/geo.js +42 -46
  35. package/dist/streaming/internal/httpHelpers.js +51 -61
  36. package/dist/streaming/publishToken.js +158 -174
  37. package/dist/streaming/stream.js +37 -41
  38. package/dist/streaming/subscribeToken.js +98 -108
  39. package/dist/types/jwtToken.d.ts +1 -0
  40. package/package.json +8 -8
@@ -8,7 +8,7 @@ exports.updatePermissions = exports.terminate = exports.setSpatialListenersAudio
8
8
  var _httpHelpers = require("../internal/httpHelpers");
9
9
  var _urls = require("./internal/urls");
10
10
  var _rtcpMode = require("./types/rtcpMode");
11
- 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
+ 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
12
  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
13
  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); }); }; }
14
14
  /**
@@ -25,59 +25,57 @@ var createConference = /*#__PURE__*/function () {
25
25
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, options) {
26
26
  var parameters, body, obj_participants, index, participant, hostname, requestOptions, response;
27
27
  return _regeneratorRuntime().wrap(function _callee$(_context) {
28
- while (1) {
29
- switch (_context.prev = _context.next) {
30
- case 0:
31
- parameters = {
32
- dolbyVoice: options.dolbyVoice ? options.dolbyVoice : true,
33
- liveRecording: options.liveRecording ? options.liveRecording : false,
34
- audioOnly: options.audioOnly ? options.audioOnly : false,
35
- rtcpMode: options.rtcpMode ? options.rtcpMode : _rtcpMode.RTCPMode.Average
36
- };
37
- if (options.pinCode) parameters['pincode'] = options.pinCode;
38
- if (options.ttl) parameters['ttl'] = options.ttl;
39
- if (options.videoCodec) parameters['videoCodec'] = options.videoCodec;
40
- if (options.recordingFormats) parameters['recording'] = {
41
- format: options.recordingFormats
42
- };
43
- body = {
44
- ownerExternalId: options.ownerExternalId,
45
- parameters: parameters
46
- };
47
- if (options.alias) body['alias'] = options.alias;
48
- if (options.participants) {
49
- obj_participants = {};
50
- for (index = 0; index < options.participants.length; index++) {
51
- participant = options.participants[index];
52
- obj_participants[participant.externalId] = {
53
- permissions: participant.permissions,
54
- notification: participant.notify
55
- };
56
- }
57
- body['participants'] = obj_participants;
28
+ while (1) switch (_context.prev = _context.next) {
29
+ case 0:
30
+ parameters = {
31
+ dolbyVoice: options.dolbyVoice ? options.dolbyVoice : true,
32
+ liveRecording: options.liveRecording ? options.liveRecording : false,
33
+ audioOnly: options.audioOnly ? options.audioOnly : false,
34
+ rtcpMode: options.rtcpMode ? options.rtcpMode : _rtcpMode.RTCPMode.Average
35
+ };
36
+ if (options.pinCode) parameters['pincode'] = options.pinCode;
37
+ if (options.ttl) parameters['ttl'] = options.ttl;
38
+ if (options.videoCodec) parameters['videoCodec'] = options.videoCodec;
39
+ if (options.recordingFormats) parameters['recording'] = {
40
+ format: options.recordingFormats
41
+ };
42
+ body = {
43
+ ownerExternalId: options.ownerExternalId,
44
+ parameters: parameters
45
+ };
46
+ if (options.alias) body['alias'] = options.alias;
47
+ if (options.participants) {
48
+ obj_participants = {};
49
+ for (index = 0; index < options.participants.length; index++) {
50
+ participant = options.participants[index];
51
+ obj_participants[participant.externalId] = {
52
+ permissions: participant.permissions,
53
+ notification: participant.notify
54
+ };
58
55
  }
56
+ body['participants'] = obj_participants;
57
+ }
59
58
 
60
- // Compute the hostname based on the requested region
61
- hostname = options.region ? "".concat(options.region, ".").concat(_urls.COMMS_HOSTNAME) : _urls.COMMS_HOSTNAME;
62
- requestOptions = {
63
- hostname: hostname,
64
- path: '/v2/conferences/create',
65
- headers: {
66
- Accept: 'application/json',
67
- 'Content-Type': 'application/json',
68
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
69
- },
70
- body: JSON.stringify(body)
71
- };
72
- _context.next = 12;
73
- return (0, _httpHelpers.sendPost)(requestOptions);
74
- case 12:
75
- response = _context.sent;
76
- return _context.abrupt("return", response);
77
- case 14:
78
- case "end":
79
- return _context.stop();
80
- }
59
+ // Compute the hostname based on the requested region
60
+ hostname = options.region ? "".concat(options.region, ".").concat(_urls.COMMS_HOSTNAME) : _urls.COMMS_HOSTNAME;
61
+ requestOptions = {
62
+ hostname: hostname,
63
+ path: '/v2/conferences/create',
64
+ headers: {
65
+ Accept: 'application/json',
66
+ 'Content-Type': 'application/json',
67
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
68
+ },
69
+ body: JSON.stringify(body)
70
+ };
71
+ _context.next = 12;
72
+ return (0, _httpHelpers.sendPost)(requestOptions);
73
+ case 12:
74
+ response = _context.sent;
75
+ return _context.abrupt("return", response);
76
+ case 14:
77
+ case "end":
78
+ return _context.stop();
81
79
  }
82
80
  }, _callee);
83
81
  }));
@@ -104,39 +102,37 @@ var invite = /*#__PURE__*/function () {
104
102
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, conferenceId, participants) {
105
103
  var obj_participants, index, participant, body, options, response;
106
104
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
107
- while (1) {
108
- switch (_context2.prev = _context2.next) {
109
- case 0:
110
- obj_participants = {};
111
- for (index = 0; index < participants.length; index++) {
112
- participant = participants[index];
113
- obj_participants[participant.externalId] = {
114
- permissions: participant.permissions,
115
- notification: participant.notify
116
- };
117
- }
118
- body = JSON.stringify({
119
- participants: obj_participants
120
- });
121
- options = {
122
- hostname: _urls.COMMS_HOSTNAME,
123
- path: "/v2/conferences/".concat(conferenceId, "/invite"),
124
- headers: {
125
- Accept: 'application/json',
126
- 'Content-Type': 'application/json',
127
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
128
- },
129
- body: body
105
+ while (1) switch (_context2.prev = _context2.next) {
106
+ case 0:
107
+ obj_participants = {};
108
+ for (index = 0; index < participants.length; index++) {
109
+ participant = participants[index];
110
+ obj_participants[participant.externalId] = {
111
+ permissions: participant.permissions,
112
+ notification: participant.notify
130
113
  };
131
- _context2.next = 6;
132
- return (0, _httpHelpers.sendPost)(options);
133
- case 6:
134
- response = _context2.sent;
135
- return _context2.abrupt("return", response);
136
- case 8:
137
- case "end":
138
- return _context2.stop();
139
- }
114
+ }
115
+ body = JSON.stringify({
116
+ participants: obj_participants
117
+ });
118
+ options = {
119
+ hostname: _urls.COMMS_HOSTNAME,
120
+ path: "/v2/conferences/".concat(conferenceId, "/invite"),
121
+ headers: {
122
+ Accept: 'application/json',
123
+ 'Content-Type': 'application/json',
124
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
125
+ },
126
+ body: body
127
+ };
128
+ _context2.next = 6;
129
+ return (0, _httpHelpers.sendPost)(options);
130
+ case 6:
131
+ response = _context2.sent;
132
+ return _context2.abrupt("return", response);
133
+ case 8:
134
+ case "end":
135
+ return _context2.stop();
140
136
  }
141
137
  }, _callee2);
142
138
  }));
@@ -159,28 +155,26 @@ var kick = /*#__PURE__*/function () {
159
155
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(accessToken, conferenceId, externalIds) {
160
156
  var body, options;
161
157
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
162
- while (1) {
163
- switch (_context3.prev = _context3.next) {
164
- case 0:
165
- body = JSON.stringify({
166
- externalIds: externalIds
167
- });
168
- options = {
169
- hostname: _urls.COMMS_HOSTNAME,
170
- path: "/v2/conferences/".concat(conferenceId, "/kick"),
171
- headers: {
172
- Accept: 'application/json',
173
- 'Content-Type': 'application/json',
174
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
175
- },
176
- body: body
177
- };
178
- _context3.next = 4;
179
- return (0, _httpHelpers.sendPost)(options);
180
- case 4:
181
- case "end":
182
- return _context3.stop();
183
- }
158
+ while (1) switch (_context3.prev = _context3.next) {
159
+ case 0:
160
+ body = JSON.stringify({
161
+ externalIds: externalIds
162
+ });
163
+ options = {
164
+ hostname: _urls.COMMS_HOSTNAME,
165
+ path: "/v2/conferences/".concat(conferenceId, "/kick"),
166
+ headers: {
167
+ Accept: 'application/json',
168
+ 'Content-Type': 'application/json',
169
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
170
+ },
171
+ body: body
172
+ };
173
+ _context3.next = 4;
174
+ return (0, _httpHelpers.sendPost)(options);
175
+ case 4:
176
+ case "end":
177
+ return _context3.stop();
184
178
  }
185
179
  }, _callee3);
186
180
  }));
@@ -205,32 +199,30 @@ var sendMessage = /*#__PURE__*/function () {
205
199
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(accessToken, conferenceId, fromExternalId, toExternalIds, message) {
206
200
  var body, options;
207
201
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
208
- while (1) {
209
- switch (_context4.prev = _context4.next) {
210
- case 0:
211
- body = {
212
- from: fromExternalId,
213
- message: message
214
- };
215
- if (toExternalIds && toExternalIds.length > 0) {
216
- body['to'] = toExternalIds;
217
- }
218
- options = {
219
- hostname: _urls.COMMS_HOSTNAME,
220
- path: "/v2/conferences/".concat(conferenceId, "/message"),
221
- headers: {
222
- Accept: 'application/json',
223
- 'Content-Type': 'application/json',
224
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
225
- },
226
- body: JSON.stringify(body)
227
- };
228
- _context4.next = 5;
229
- return (0, _httpHelpers.sendPost)(options);
230
- case 5:
231
- case "end":
232
- return _context4.stop();
233
- }
202
+ while (1) switch (_context4.prev = _context4.next) {
203
+ case 0:
204
+ body = {
205
+ from: fromExternalId,
206
+ message: message
207
+ };
208
+ if (toExternalIds && toExternalIds.length > 0) {
209
+ body['to'] = toExternalIds;
210
+ }
211
+ options = {
212
+ hostname: _urls.COMMS_HOSTNAME,
213
+ path: "/v2/conferences/".concat(conferenceId, "/message"),
214
+ headers: {
215
+ Accept: 'application/json',
216
+ 'Content-Type': 'application/json',
217
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
218
+ },
219
+ body: JSON.stringify(body)
220
+ };
221
+ _context4.next = 5;
222
+ return (0, _httpHelpers.sendPost)(options);
223
+ case 5:
224
+ case "end":
225
+ return _context4.stop();
234
226
  }
235
227
  }, _callee4);
236
228
  }));
@@ -255,30 +247,28 @@ var setSpatialListenersAudio = /*#__PURE__*/function () {
255
247
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(accessToken, conferenceId, environment, listener, users) {
256
248
  var body, options;
257
249
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
258
- while (1) {
259
- switch (_context5.prev = _context5.next) {
260
- case 0:
261
- body = JSON.stringify({
262
- environment: environment,
263
- listener: listener,
264
- users: users
265
- });
266
- options = {
267
- hostname: _urls.COMMS_HOSTNAME,
268
- path: "/v2/conferences/".concat(conferenceId, "/spatial-listeners-audio"),
269
- headers: {
270
- Accept: 'application/json',
271
- 'Content-Type': 'application/json',
272
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
273
- },
274
- body: body
275
- };
276
- _context5.next = 4;
277
- return (0, _httpHelpers.sendPut)(options);
278
- case 4:
279
- case "end":
280
- return _context5.stop();
281
- }
250
+ while (1) switch (_context5.prev = _context5.next) {
251
+ case 0:
252
+ body = JSON.stringify({
253
+ environment: environment,
254
+ listener: listener,
255
+ users: users
256
+ });
257
+ options = {
258
+ hostname: _urls.COMMS_HOSTNAME,
259
+ path: "/v2/conferences/".concat(conferenceId, "/spatial-listeners-audio"),
260
+ headers: {
261
+ Accept: 'application/json',
262
+ 'Content-Type': 'application/json',
263
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
264
+ },
265
+ body: body
266
+ };
267
+ _context5.next = 4;
268
+ return (0, _httpHelpers.sendPut)(options);
269
+ case 4:
270
+ case "end":
271
+ return _context5.stop();
282
272
  }
283
273
  }, _callee5);
284
274
  }));
@@ -303,39 +293,37 @@ var updatePermissions = /*#__PURE__*/function () {
303
293
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(accessToken, conferenceId, participants) {
304
294
  var obj_participants, index, participant, body, options, response;
305
295
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
306
- while (1) {
307
- switch (_context6.prev = _context6.next) {
308
- case 0:
309
- obj_participants = {};
310
- for (index = 0; index < participants.length; index++) {
311
- participant = participants[index];
312
- obj_participants[participant.externalId] = {
313
- permissions: participant.permissions,
314
- notification: participant.notify
315
- };
316
- }
317
- body = JSON.stringify({
318
- participants: obj_participants
319
- });
320
- options = {
321
- hostname: _urls.COMMS_HOSTNAME,
322
- path: "/v2/conferences/".concat(conferenceId, "/permissions"),
323
- headers: {
324
- Accept: 'application/json',
325
- 'Content-Type': 'application/json',
326
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
327
- },
328
- body: body
296
+ while (1) switch (_context6.prev = _context6.next) {
297
+ case 0:
298
+ obj_participants = {};
299
+ for (index = 0; index < participants.length; index++) {
300
+ participant = participants[index];
301
+ obj_participants[participant.externalId] = {
302
+ permissions: participant.permissions,
303
+ notification: participant.notify
329
304
  };
330
- _context6.next = 6;
331
- return (0, _httpHelpers.sendPost)(options);
332
- case 6:
333
- response = _context6.sent;
334
- return _context6.abrupt("return", response);
335
- case 8:
336
- case "end":
337
- return _context6.stop();
338
- }
305
+ }
306
+ body = JSON.stringify({
307
+ participants: obj_participants
308
+ });
309
+ options = {
310
+ hostname: _urls.COMMS_HOSTNAME,
311
+ path: "/v2/conferences/".concat(conferenceId, "/permissions"),
312
+ headers: {
313
+ Accept: 'application/json',
314
+ 'Content-Type': 'application/json',
315
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
316
+ },
317
+ body: body
318
+ };
319
+ _context6.next = 6;
320
+ return (0, _httpHelpers.sendPost)(options);
321
+ case 6:
322
+ response = _context6.sent;
323
+ return _context6.abrupt("return", response);
324
+ case 8:
325
+ case "end":
326
+ return _context6.stop();
339
327
  }
340
328
  }, _callee6);
341
329
  }));
@@ -357,24 +345,22 @@ var terminate = /*#__PURE__*/function () {
357
345
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(accessToken, conferenceId) {
358
346
  var options;
359
347
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
360
- while (1) {
361
- switch (_context7.prev = _context7.next) {
362
- case 0:
363
- options = {
364
- hostname: _urls.COMMS_HOSTNAME,
365
- path: "/v2/conferences/".concat(conferenceId),
366
- headers: {
367
- Accept: 'application/json',
368
- 'Content-Type': 'application/json',
369
- Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
370
- }
371
- };
372
- _context7.next = 3;
373
- return (0, _httpHelpers.sendDelete)(options);
374
- case 3:
375
- case "end":
376
- return _context7.stop();
377
- }
348
+ while (1) switch (_context7.prev = _context7.next) {
349
+ case 0:
350
+ options = {
351
+ hostname: _urls.COMMS_HOSTNAME,
352
+ path: "/v2/conferences/".concat(conferenceId),
353
+ headers: {
354
+ Accept: 'application/json',
355
+ 'Content-Type': 'application/json',
356
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
357
+ }
358
+ };
359
+ _context7.next = 3;
360
+ return (0, _httpHelpers.sendDelete)(options);
361
+ case 3:
362
+ case "end":
363
+ return _context7.stop();
378
364
  }
379
365
  }, _callee7);
380
366
  }));