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

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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/authentication.d.ts +5 -5
  3. package/dist/authentication.js +9 -7
  4. package/dist/communications/authentication.d.ts +0 -14
  5. package/dist/communications/authentication.js +16 -67
  6. package/dist/communications/conference.js +15 -16
  7. package/dist/communications/monitor/conferences.d.ts +1 -0
  8. package/dist/communications/monitor/conferences.js +9 -7
  9. package/dist/communications/monitor/recordings.d.ts +28 -15
  10. package/dist/communications/monitor/recordings.js +86 -56
  11. package/dist/communications/monitor/webhooks.js +5 -3
  12. package/dist/communications/recording.d.ts +28 -12
  13. package/dist/communications/recording.js +69 -48
  14. package/dist/communications/remix.js +73 -55
  15. package/dist/communications/streaming.d.ts +44 -21
  16. package/dist/communications/streaming.js +133 -102
  17. package/dist/communications/types/mixOptions.d.ts +39 -0
  18. package/dist/communications/types/mixOptions.js +5 -0
  19. package/dist/communications/types/recordings.d.ts +58 -47
  20. package/dist/communications/types/rtsStream.d.ts +10 -0
  21. package/dist/communications/types/rtsStream.js +1 -0
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +4 -2
  24. package/dist/internal/utils.d.ts +6 -0
  25. package/dist/internal/utils.js +5 -0
  26. package/dist/media/internal/jobsHelpers.js +5 -3
  27. package/dist/media/io.js +4 -2
  28. package/dist/media/jobs.js +6 -4
  29. package/dist/media/webhooks.js +7 -5
  30. package/dist/streaming/cluster.js +5 -3
  31. package/dist/streaming/director.js +5 -3
  32. package/dist/streaming/geo.js +5 -3
  33. package/dist/streaming/publishToken.js +11 -9
  34. package/dist/streaming/stream.js +5 -3
  35. package/dist/streaming/subscribeToken.js +8 -6
  36. package/dist/urls.d.ts +13 -0
  37. package/dist/urls.js +37 -0
  38. package/package.json +8 -9
  39. package/dist/communications/internal/urls.d.ts +0 -2
  40. package/dist/communications/internal/urls.js +0 -10
  41. package/dist/internal/urls.d.ts +0 -1
  42. package/dist/internal/urls.js +0 -8
  43. package/dist/media/internal/urls.d.ts +0 -1
  44. package/dist/media/internal/urls.js +0 -8
  45. package/dist/streaming/internal/urls.d.ts +0 -2
  46. package/dist/streaming/internal/urls.js +0 -10
package/README.md CHANGED
@@ -164,7 +164,7 @@ const inputUrl = 'dlb://in/file.mp4';
164
164
  // Local path of the file to upload
165
165
  const originalFilePath = '/path/to/original_file.mp4';
166
166
 
167
- await dolbyio.io.uploadFile(jwt, inputUrl, originalFilePath);
167
+ await dolbyio.media.io.uploadFile(jwt, inputUrl, originalFilePath);
168
168
  ```
169
169
 
170
170
  ### Start an enhance job
@@ -12,16 +12,16 @@ import JwtToken from './types/jwtToken';
12
12
  * @param expiresIn API token expiration time in seconds. If no value is specified, the default is 1800, indicating 30 minutes. The maximum value is 86,400, indicating 24 hours.
13
13
  * @param scope A list of case-sensitive strings allowing you to control what scope of access the API token should have. If not specified, the API token will possess unrestricted access to all resources and actions. The API supports the following scopes:
14
14
  * * `comms:client_access_token:create`: Allows requesting a client access token.
15
- * * `comms:conf:create`: Allows creating a new conference.
16
15
  * * `comms:conf:admin`: Allows administrating a conference, including actions such as Invite, Kick, Send Message, Set Spatial Listener's Audio, and Update Permissions.
16
+ * * `comms:conf:create`: Allows creating a new conference.
17
17
  * * `comms:conf:destroy`: Allows terminating a live conference.
18
18
  * * `comms:monitor:delete`: Allows deleting data from the Monitor API, for example, deleting recordings.
19
- * * `comms:monitor:read`: Allows reading data through the Monitor API.
20
19
  * * `comms:monitor:download`: Allows generating download URLs for data (e.g. recording) through the Monitor API.
21
- * * `comms:stream:write`: Allows starting and stopping RTMP or Real-Time streaming.
22
- * * `comms:remix:write`: Allows remixing recordings.
23
- * * `comms:remix:read`: Allows reading the remix status.
20
+ * * `comms:monitor:read`: Allows reading data through the Monitor API.
24
21
  * * `comms:record:write`: Allows starting and stopping recordings.
22
+ * * `comms:remix:read`: Allows reading the remix status.
23
+ * * `comms:remix:write`: Allows remixing recordings.
24
+ * * `comms:stream:write`: Allows starting and stopping RTMP or Real-Time streaming.
25
25
  * Incorrect values are omitted. If you want to give the token access to all Communications REST APIs, you can use a wildcard, such as comms:*
26
26
  *
27
27
  * @returns A {@link JwtToken} object through a {@link Promise}.
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getApiAccessToken = void 0;
8
8
  var _httpHelpers = require("./internal/httpHelpers");
9
- var _urls = require("./internal/urls");
9
+ var Urls = _interopRequireWildcard(require("./urls"));
10
+ 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); }
11
+ 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
12
  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
13
  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
14
  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); }); }; }
@@ -23,16 +25,16 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
23
25
  * @param expiresIn API token expiration time in seconds. If no value is specified, the default is 1800, indicating 30 minutes. The maximum value is 86,400, indicating 24 hours.
24
26
  * @param scope A list of case-sensitive strings allowing you to control what scope of access the API token should have. If not specified, the API token will possess unrestricted access to all resources and actions. The API supports the following scopes:
25
27
  * * `comms:client_access_token:create`: Allows requesting a client access token.
26
- * * `comms:conf:create`: Allows creating a new conference.
27
28
  * * `comms:conf:admin`: Allows administrating a conference, including actions such as Invite, Kick, Send Message, Set Spatial Listener's Audio, and Update Permissions.
29
+ * * `comms:conf:create`: Allows creating a new conference.
28
30
  * * `comms:conf:destroy`: Allows terminating a live conference.
29
31
  * * `comms:monitor:delete`: Allows deleting data from the Monitor API, for example, deleting recordings.
30
- * * `comms:monitor:read`: Allows reading data through the Monitor API.
31
32
  * * `comms:monitor:download`: Allows generating download URLs for data (e.g. recording) through the Monitor API.
32
- * * `comms:stream:write`: Allows starting and stopping RTMP or Real-Time streaming.
33
- * * `comms:remix:write`: Allows remixing recordings.
34
- * * `comms:remix:read`: Allows reading the remix status.
33
+ * * `comms:monitor:read`: Allows reading data through the Monitor API.
35
34
  * * `comms:record:write`: Allows starting and stopping recordings.
35
+ * * `comms:remix:read`: Allows reading the remix status.
36
+ * * `comms:remix:write`: Allows remixing recordings.
37
+ * * `comms:stream:write`: Allows starting and stopping RTMP or Real-Time streaming.
36
38
  * Incorrect values are omitted. If you want to give the token access to all Communications REST APIs, you can use a wildcard, such as comms:*
37
39
  *
38
40
  * @returns A {@link JwtToken} object through a {@link Promise}.
@@ -54,7 +56,7 @@ var getApiAccessToken = /*#__PURE__*/function () {
54
56
  }
55
57
  authz = Buffer.from("".concat(appKey, ":").concat(appSecret)).toString('base64');
56
58
  options = {
57
- hostname: _urls.AUTH_HOSTNAME,
59
+ hostname: Urls.getApiHostname(),
58
60
  path: '/v1/auth/token',
59
61
  headers: {
60
62
  'Content-Type': 'application/x-www-form-urlencoded',
@@ -1,19 +1,5 @@
1
1
  import JwtToken from '../types/jwtToken';
2
2
  import { GetClientAccessTokenOptions } from './types/authentication';
3
- /**
4
- * Gets a client access token to authenticate a session.
5
- *
6
- * @link https://docs.dolby.io/communications-apis/reference/get-client-access-token-v1
7
- *
8
- * @param appKey Your Dolby.io App Key.
9
- * @param appSecret Your Dolby.io App Secret.
10
- * @param expiresIn Access token expiration time in seconds. If no value is specified, the default is 3,600, indicating one hour. The maximum value is 86,400, indicating 24 hours.
11
- *
12
- * @returns A {@link JwtToken} object through a {@link Promise}.
13
- *
14
- * @deprecated This function is now deprecated and will be removed in the next release of this SDK. Please start using {@link getClientAccessTokenV2} instead.
15
- */
16
- export declare const getClientAccessToken: (appKey: string, appSecret: string, expiresIn?: number) => Promise<JwtToken>;
17
3
  /**
18
4
  * Generates a client access token.
19
5
  *
@@ -4,67 +4,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.getClientAccessTokenV2 = exports.getClientAccessToken = void 0;
7
+ exports.getClientAccessTokenV2 = void 0;
8
8
  var _httpHelpers = require("../internal/httpHelpers");
9
- var _urls = require("./internal/urls");
9
+ var Urls = _interopRequireWildcard(require("../urls"));
10
+ 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); }
11
+ 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
12
  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
13
  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
14
  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
- /**
14
- * Gets a client access token to authenticate a session.
15
- *
16
- * @link https://docs.dolby.io/communications-apis/reference/get-client-access-token-v1
17
- *
18
- * @param appKey Your Dolby.io App Key.
19
- * @param appSecret Your Dolby.io App Secret.
20
- * @param expiresIn Access token expiration time in seconds. If no value is specified, the default is 3,600, indicating one hour. The maximum value is 86,400, indicating 24 hours.
21
- *
22
- * @returns A {@link JwtToken} object through a {@link Promise}.
23
- *
24
- * @deprecated This function is now deprecated and will be removed in the next release of this SDK. Please start using {@link getClientAccessTokenV2} instead.
25
- */
26
- var getClientAccessToken = /*#__PURE__*/function () {
27
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(appKey, appSecret, expiresIn) {
28
- var body, authz, options, response;
29
- return _regeneratorRuntime().wrap(function _callee$(_context) {
30
- while (1) switch (_context.prev = _context.next) {
31
- case 0:
32
- body = new URLSearchParams({
33
- grant_type: 'client_credentials'
34
- });
35
- if (expiresIn) {
36
- body.append('expires_in', expiresIn.toFixed(0));
37
- }
38
- authz = Buffer.from("".concat(appKey, ":").concat(appSecret)).toString('base64');
39
- options = {
40
- hostname: _urls.SESSION_HOSTNAME,
41
- path: '/v1/oauth2/token',
42
- headers: {
43
- 'Content-Type': 'application/x-www-form-urlencoded',
44
- 'Cache-Control': 'no-cache',
45
- Authorization: "Basic ".concat(authz)
46
- },
47
- body: body.toString()
48
- };
49
- _context.next = 6;
50
- return (0, _httpHelpers.sendPost)(options);
51
- case 6:
52
- response = _context.sent;
53
- return _context.abrupt("return", response);
54
- case 8:
55
- case "end":
56
- return _context.stop();
57
- }
58
- }, _callee);
59
- }));
60
- return function getClientAccessToken(_x, _x2, _x3) {
61
- return _ref.apply(this, arguments);
62
- };
63
- }();
64
-
65
15
  /**
66
16
  * Generates a client access token.
67
- *
17
+ *
68
18
  * This API returns a client access token that your backend can request on behalf of a client to initialize the Dolby.io SDK in a secure way.
69
19
  *
70
20
  * @link https://docs.dolby.io/communications-apis/reference/get-client-access-token
@@ -73,12 +23,11 @@ var getClientAccessToken = /*#__PURE__*/function () {
73
23
  *
74
24
  * @returns A {@link JwtToken} object through a {@link Promise}.
75
25
  */
76
- exports.getClientAccessToken = getClientAccessToken;
77
26
  var getClientAccessTokenV2 = /*#__PURE__*/function () {
78
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
27
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
79
28
  var body, postOptions, response;
80
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
81
- while (1) switch (_context2.prev = _context2.next) {
29
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
30
+ while (1) switch (_context.prev = _context.next) {
82
31
  case 0:
83
32
  body = {
84
33
  sessionScope: options.sessionScope.join(' ')
@@ -86,7 +35,7 @@ var getClientAccessTokenV2 = /*#__PURE__*/function () {
86
35
  if (options.externalId) body['externalId'] = options.externalId;
87
36
  if (options.expiresIn) body['expiresIn'] = options.expiresIn;
88
37
  postOptions = {
89
- hostname: _urls.COMMS_HOSTNAME,
38
+ hostname: Urls.getCommsHostname(),
90
39
  path: '/v2/client-access-token',
91
40
  headers: {
92
41
  'Cache-Control': 'no-cache',
@@ -96,19 +45,19 @@ var getClientAccessTokenV2 = /*#__PURE__*/function () {
96
45
  },
97
46
  body: JSON.stringify(body)
98
47
  };
99
- _context2.next = 6;
48
+ _context.next = 6;
100
49
  return (0, _httpHelpers.sendPost)(postOptions);
101
50
  case 6:
102
- response = _context2.sent;
103
- return _context2.abrupt("return", response);
51
+ response = _context.sent;
52
+ return _context.abrupt("return", response);
104
53
  case 8:
105
54
  case "end":
106
- return _context2.stop();
55
+ return _context.stop();
107
56
  }
108
- }, _callee2);
57
+ }, _callee);
109
58
  }));
110
- return function getClientAccessTokenV2(_x4) {
111
- return _ref2.apply(this, arguments);
59
+ return function getClientAccessTokenV2(_x) {
60
+ return _ref.apply(this, arguments);
112
61
  };
113
62
  }();
114
63
  exports.getClientAccessTokenV2 = getClientAccessTokenV2;
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.updatePermissions = exports.terminate = exports.setSpatialListenersAudio = exports.sendMessage = exports.participants = exports.kick = exports.invite = exports.createConference = void 0;
8
8
  var _httpHelpers = require("../internal/httpHelpers");
9
- var _urls = require("./internal/urls");
9
+ var Urls = _interopRequireWildcard(require("../urls"));
10
10
  var _rtcpMode = require("./types/rtcpMode");
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); }); }; }
@@ -23,7 +25,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
23
25
  */
24
26
  var createConference = /*#__PURE__*/function () {
25
27
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, options) {
26
- var parameters, body, obj_participants, index, participant, hostname, requestOptions, response;
28
+ var parameters, body, obj_participants, index, participant, requestOptions, response;
27
29
  return _regeneratorRuntime().wrap(function _callee$(_context) {
28
30
  while (1) switch (_context.prev = _context.next) {
29
31
  case 0:
@@ -55,11 +57,8 @@ var createConference = /*#__PURE__*/function () {
55
57
  }
56
58
  body['participants'] = obj_participants;
57
59
  }
58
-
59
- // Compute the hostname based on the requested region
60
- hostname = options.region ? "".concat(options.region, ".").concat(_urls.COMMS_HOSTNAME) : _urls.COMMS_HOSTNAME;
61
60
  requestOptions = {
62
- hostname: hostname,
61
+ hostname: Urls.getCommsHostname(options.region),
63
62
  path: '/v2/conferences/create',
64
63
  headers: {
65
64
  Accept: 'application/json',
@@ -68,12 +67,12 @@ var createConference = /*#__PURE__*/function () {
68
67
  },
69
68
  body: JSON.stringify(body)
70
69
  };
71
- _context.next = 12;
70
+ _context.next = 11;
72
71
  return (0, _httpHelpers.sendPost)(requestOptions);
73
- case 12:
72
+ case 11:
74
73
  response = _context.sent;
75
74
  return _context.abrupt("return", response);
76
- case 14:
75
+ case 13:
77
76
  case "end":
78
77
  return _context.stop();
79
78
  }
@@ -116,7 +115,7 @@ var invite = /*#__PURE__*/function () {
116
115
  participants: obj_participants
117
116
  });
118
117
  options = {
119
- hostname: _urls.COMMS_HOSTNAME,
118
+ hostname: Urls.getCommsHostname(),
120
119
  path: "/v2/conferences/".concat(conferenceId, "/invite"),
121
120
  headers: {
122
121
  Accept: 'application/json',
@@ -161,7 +160,7 @@ var kick = /*#__PURE__*/function () {
161
160
  externalIds: externalIds
162
161
  });
163
162
  options = {
164
- hostname: _urls.COMMS_HOSTNAME,
163
+ hostname: Urls.getCommsHostname(),
165
164
  path: "/v2/conferences/".concat(conferenceId, "/kick"),
166
165
  headers: {
167
166
  Accept: 'application/json',
@@ -209,7 +208,7 @@ var sendMessage = /*#__PURE__*/function () {
209
208
  body['to'] = toExternalIds;
210
209
  }
211
210
  options = {
212
- hostname: _urls.COMMS_HOSTNAME,
211
+ hostname: Urls.getCommsHostname(),
213
212
  path: "/v2/conferences/".concat(conferenceId, "/message"),
214
213
  headers: {
215
214
  Accept: 'application/json',
@@ -255,7 +254,7 @@ var setSpatialListenersAudio = /*#__PURE__*/function () {
255
254
  users: users
256
255
  });
257
256
  options = {
258
- hostname: _urls.COMMS_HOSTNAME,
257
+ hostname: Urls.getCommsHostname(),
259
258
  path: "/v2/conferences/".concat(conferenceId, "/spatial-listeners-audio"),
260
259
  headers: {
261
260
  Accept: 'application/json',
@@ -307,7 +306,7 @@ var updatePermissions = /*#__PURE__*/function () {
307
306
  participants: obj_participants
308
307
  });
309
308
  options = {
310
- hostname: _urls.COMMS_HOSTNAME,
309
+ hostname: Urls.getCommsHostname(),
311
310
  path: "/v2/conferences/".concat(conferenceId, "/permissions"),
312
311
  headers: {
313
312
  Accept: 'application/json',
@@ -350,7 +349,7 @@ var participants = /*#__PURE__*/function () {
350
349
  while (1) switch (_context7.prev = _context7.next) {
351
350
  case 0:
352
351
  requestOptions = {
353
- hostname: _urls.COMMS_HOSTNAME,
352
+ hostname: Urls.getCommsHostname(),
354
353
  path: "/v2/conferences/".concat(conferenceId, "/participants"),
355
354
  headers: {
356
355
  Accept: 'application/json',
@@ -390,7 +389,7 @@ var terminate = /*#__PURE__*/function () {
390
389
  while (1) switch (_context8.prev = _context8.next) {
391
390
  case 0:
392
391
  options = {
393
- hostname: _urls.COMMS_HOSTNAME,
392
+ hostname: Urls.getCommsHostname(),
394
393
  path: "/v2/conferences/".concat(conferenceId),
395
394
  headers: {
396
395
  Accept: 'application/json',
@@ -2,6 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node" />
5
+ /// <reference types="node" />
5
6
  import JwtToken from '../../types/jwtToken';
6
7
  import { ListConferencesOptions, ListAllConferencesOptions, ListConferencesResponse, Conference, Statistics, ListParticipantsOptions, ListAllParticipantsOptions, ParticipantsResponse, Participant } from '../types/conferences';
7
8
  /**
@@ -7,7 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.listConferences = exports.listAllConferences = exports.getConferenceStatistics = exports.getConferenceParticipants = exports.getConference = exports.getAllConferenceParticipants = 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); }); }; }
@@ -55,7 +57,7 @@ var listConferences = /*#__PURE__*/function () {
55
57
  params['exid'] = opts.exid;
56
58
  }
57
59
  requestOptions = {
58
- hostname: _urls.COMMS_HOSTNAME,
60
+ hostname: Urls.getCommsHostname(),
59
61
  path: '/v1/monitor/conferences',
60
62
  params: params,
61
63
  headers: {
@@ -121,7 +123,7 @@ var listAllConferences = /*#__PURE__*/function () {
121
123
  params['exid'] = opts.exid;
122
124
  }
123
125
  requestOptions = {
124
- hostname: _urls.COMMS_HOSTNAME,
126
+ hostname: Urls.getCommsHostname(),
125
127
  path: '/v1/monitor/conferences',
126
128
  params: params,
127
129
  headers: {
@@ -170,7 +172,7 @@ var getConference = /*#__PURE__*/function () {
170
172
  case 0:
171
173
  livestats = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : false;
172
174
  options = {
173
- hostname: _urls.COMMS_HOSTNAME,
175
+ hostname: Urls.getCommsHostname(),
174
176
  path: "/v1/monitor/conferences/".concat(conferenceId, "?livestats=").concat(livestats),
175
177
  headers: {
176
178
  Accept: 'application/json',
@@ -215,7 +217,7 @@ var getConferenceStatistics = /*#__PURE__*/function () {
215
217
  while (1) switch (_context4.prev = _context4.next) {
216
218
  case 0:
217
219
  options = {
218
- hostname: _urls.COMMS_HOSTNAME,
220
+ hostname: Urls.getCommsHostname(),
219
221
  path: "/v1/monitor/conferences/".concat(conferenceId, "/statistics"),
220
222
  headers: {
221
223
  Accept: 'application/json',
@@ -280,7 +282,7 @@ var getConferenceParticipants = /*#__PURE__*/function () {
280
282
  params['type'] = opts.type;
281
283
  }
282
284
  requestOptions = {
283
- hostname: _urls.COMMS_HOSTNAME,
285
+ hostname: Urls.getCommsHostname(),
284
286
  path: path,
285
287
  params: params,
286
288
  headers: {
@@ -343,7 +345,7 @@ var getAllConferenceParticipants = /*#__PURE__*/function () {
343
345
  params['type'] = opts.type;
344
346
  }
345
347
  requestOptions = {
346
- hostname: _urls.COMMS_HOSTNAME,
348
+ hostname: Urls.getCommsHostname(),
347
349
  path: path,
348
350
  params: params,
349
351
  headers: {
@@ -1,10 +1,13 @@
1
1
  import JwtToken from '../../types/jwtToken';
2
- import { GetRecordingsOptions, GetAllRecordingsOptions, GetRecordingsResponse, Recording, GetRecordingOptions, DolbyVoiceRecording } from '../types/recordings';
2
+ import { GetRecordingsOptions, GetAllRecordingsOptions, GetRecordingsResponse, Recording, GetConferenceRecordingsOptions, GetAllConferenceRecordingsOptions, GetConferenceRecordingsResponse } from '../types/recordings';
3
3
  /**
4
4
  * Get a list of the recorded conference metadata, such as duration or size of the recording.
5
5
  * This API checks only the recordings that have ended during a specific time range.
6
6
  * Recordings are indexed based on the ending time.
7
7
  *
8
+ * This API returns presigned URLs for secure download of the recording files.
9
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
10
+ *
8
11
  * @link https://docs.dolby.io/communications-apis/reference/get-recordings
9
12
  *
10
13
  * @param accessToken Access token to use for authentication.
@@ -18,6 +21,9 @@ export declare const getRecordings: (accessToken: JwtToken, options: GetRecordin
18
21
  * This API checks only the recordings that have ended during a specific time range.
19
22
  * Recordings are indexed based on the ending time.
20
23
  *
24
+ * This API returns presigned URLs for secure download of the recording files.
25
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
26
+ *
21
27
  * @link https://docs.dolby.io/communications-apis/reference/get-recordings
22
28
  *
23
29
  * @param accessToken Access token to use for authentication.
@@ -31,34 +37,41 @@ export declare const getAllRecordings: (accessToken: JwtToken, options: GetAllRe
31
37
  * This API checks the recordings that have ended during a specific time range.
32
38
  * Recordings are indexed based on the ending time.
33
39
  *
40
+ * This API returns presigned URLs for secure download of the recording files.
41
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
42
+ *
34
43
  * @link https://docs.dolby.io/communications-apis/reference/get-conference-recordings
35
44
  *
36
45
  * @param accessToken Access token to use for authentication.
37
- * @param options Options to request the recording.
46
+ * @param options Options to request the recordings.
38
47
  *
39
- * @returns An array of {@link Recording} objects through a {@link Promise}.
48
+ * @returns A {@link GetConferenceRecordingsResponse} object through a {@link Promise}.
40
49
  */
41
- export declare const getRecording: (accessToken: JwtToken, options: GetRecordingOptions) => Promise<Array<Recording>>;
50
+ export declare const getConferenceRecordings: (accessToken: JwtToken, options: GetConferenceRecordingsOptions) => Promise<GetConferenceRecordingsResponse>;
42
51
  /**
43
- * Delete all recording data related to a specific conference.
52
+ * Get a list of the recorded conference metadata, such as duration or size of the recording.
53
+ * This API checks only the recordings that have ended during a specific time range.
54
+ * Recordings are indexed based on the ending time.
44
55
  *
45
- * **Warning**: After deleting the recording, it is not possible to restore the recording data.
56
+ * This API returns presigned URLs for secure download of the recording files.
57
+ * The URL returned in the response is an AWS S3 presigned URL with a validity of ten minutes.
46
58
  *
47
- * @link https://docs.dolby.io/communications-apis/reference/delete-conference-recordings
59
+ * @link https://docs.dolby.io/communications-apis/reference/get-conference-recordings
48
60
  *
49
61
  * @param accessToken Access token to use for authentication.
50
- * @param confId Identifier of the conference.
62
+ * @param options Options to request the recordings.
63
+ *
64
+ * @returns An array of {@link Recording} objects through a {@link Promise}.
51
65
  */
52
- export declare const deleteRecording: (accessToken: JwtToken, confId: string) => Promise<void>;
66
+ export declare const getAllConferenceRecordings: (accessToken: JwtToken, options: GetAllConferenceRecordingsOptions) => Promise<Array<Recording>>;
53
67
  /**
54
- * Get details of all Dolby Voice-based audio recordings, and associated split recordings,
55
- * for a given conference and download the conference recording in the MP3 audio format.
68
+ * Deletes all recording data related to a specific conference, even data downloaded using the v1 Monitor API.
56
69
  *
57
- * @link https://docs.dolby.io/communications-apis/reference/get-dolby-voice-audio-recordings
70
+ * **Warning**: After deleting the recording, it is not possible to restore the recording data.
71
+ *
72
+ * @link https://docs.dolby.io/communications-apis/reference/delete-conference-recordings
58
73
  *
59
74
  * @param accessToken Access token to use for authentication.
60
75
  * @param confId Identifier of the conference.
61
- *
62
- * @returns A {@link DolbyVoiceRecording} object through a {@link Promise}.
63
76
  */
64
- export declare const getDolbyVoiceRecording: (accessToken: JwtToken, confId: string) => Promise<DolbyVoiceRecording>;
77
+ export declare const deleteRecording: (accessToken: JwtToken, confId: string) => Promise<void>;