@dolbyio/dolbyio-rest-apis-client 3.4.3 → 3.4.4

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 (103) hide show
  1. package/dist/authentication.js +49 -33
  2. package/dist/communications/authentication.js +49 -33
  3. package/dist/communications/conference.js +306 -181
  4. package/dist/communications/index.js +11 -29
  5. package/dist/communications/internal/httpHelpers.js +56 -34
  6. package/dist/communications/internal/urls.js +8 -4
  7. package/dist/communications/monitor/conferences.js +322 -194
  8. package/dist/communications/monitor/index.js +9 -27
  9. package/dist/communications/monitor/recordings.js +274 -144
  10. package/dist/communications/monitor/webhooks.js +119 -83
  11. package/dist/communications/recording.js +74 -43
  12. package/dist/communications/remix.js +107 -0
  13. package/dist/communications/streaming.js +145 -77
  14. package/dist/communications/types/conference.js +4 -2
  15. package/dist/communications/types/conferences.js +4 -2
  16. package/dist/communications/types/core.js +4 -2
  17. package/dist/communications/types/participant.js +1 -3
  18. package/dist/communications/types/permission.js +18 -27
  19. package/dist/communications/types/recordings.js +4 -2
  20. package/dist/communications/types/remixStatus.js +1 -0
  21. package/dist/communications/types/rtcpMode.js +9 -9
  22. package/dist/communications/types/spatialAudio.js +4 -2
  23. package/dist/communications/types/videoCodec.js +8 -5
  24. package/dist/communications/types/webhooks.js +4 -2
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +12 -28
  27. package/dist/internal/httpHelpers.js +167 -134
  28. package/dist/internal/urls.js +6 -3
  29. package/dist/media/analyze.js +55 -21
  30. package/dist/media/analyzeSpeech.js +55 -21
  31. package/dist/media/diagnose.js +55 -21
  32. package/dist/media/enhance.js +55 -21
  33. package/dist/media/index.js +15 -33
  34. package/dist/media/internal/httpHelpers.js +27 -42
  35. package/dist/media/internal/jobsHelpers.js +82 -44
  36. package/dist/media/internal/urls.js +6 -3
  37. package/dist/media/io.js +131 -54
  38. package/dist/media/jobs.js +150 -88
  39. package/dist/media/mastering.js +101 -29
  40. package/dist/media/transcode.js +55 -21
  41. package/dist/media/types/analyze.js +4 -2
  42. package/dist/media/types/analyzeSpeech.js +4 -2
  43. package/dist/media/types/diagnose.js +4 -2
  44. package/dist/media/types/enhance.js +4 -2
  45. package/dist/media/types/jobResults.js +4 -2
  46. package/dist/media/types/jobs.js +4 -2
  47. package/dist/media/types/mastering.js +4 -2
  48. package/dist/media/types/transcode.js +4 -2
  49. package/dist/media/types/webhooks.js +4 -2
  50. package/dist/media/webhooks.js +176 -96
  51. package/dist/types/jwtToken.js +1 -3
  52. package/package.json +8 -3
  53. package/dist/authentication.js.map +0 -1
  54. package/dist/communications/authentication.js.map +0 -1
  55. package/dist/communications/conference.js.map +0 -1
  56. package/dist/communications/index.js.map +0 -1
  57. package/dist/communications/internal/httpHelpers.js.map +0 -1
  58. package/dist/communications/internal/urls.js.map +0 -1
  59. package/dist/communications/monitor/conferences.js.map +0 -1
  60. package/dist/communications/monitor/index.js.map +0 -1
  61. package/dist/communications/monitor/recordings.js.map +0 -1
  62. package/dist/communications/monitor/webhooks.js.map +0 -1
  63. package/dist/communications/recording.js.map +0 -1
  64. package/dist/communications/streaming.js.map +0 -1
  65. package/dist/communications/types/conference.js.map +0 -1
  66. package/dist/communications/types/conferences.js.map +0 -1
  67. package/dist/communications/types/core.js.map +0 -1
  68. package/dist/communications/types/participant.js.map +0 -1
  69. package/dist/communications/types/permission.js.map +0 -1
  70. package/dist/communications/types/recordings.js.map +0 -1
  71. package/dist/communications/types/rtcpMode.js.map +0 -1
  72. package/dist/communications/types/spatialAudio.js.map +0 -1
  73. package/dist/communications/types/videoCodec.js.map +0 -1
  74. package/dist/communications/types/webhooks.js.map +0 -1
  75. package/dist/index.js.map +0 -1
  76. package/dist/internal/httpHelpers.js.map +0 -1
  77. package/dist/internal/urls.js.map +0 -1
  78. package/dist/internal/version.d.ts +0 -5
  79. package/dist/internal/version.js +0 -31
  80. package/dist/internal/version.js.map +0 -1
  81. package/dist/media/analyze.js.map +0 -1
  82. package/dist/media/analyzeSpeech.js.map +0 -1
  83. package/dist/media/diagnose.js.map +0 -1
  84. package/dist/media/enhance.js.map +0 -1
  85. package/dist/media/index.js.map +0 -1
  86. package/dist/media/internal/httpHelpers.js.map +0 -1
  87. package/dist/media/internal/jobsHelpers.js.map +0 -1
  88. package/dist/media/internal/urls.js.map +0 -1
  89. package/dist/media/io.js.map +0 -1
  90. package/dist/media/jobs.js.map +0 -1
  91. package/dist/media/mastering.js.map +0 -1
  92. package/dist/media/transcode.js.map +0 -1
  93. package/dist/media/types/analyze.js.map +0 -1
  94. package/dist/media/types/analyzeSpeech.js.map +0 -1
  95. package/dist/media/types/diagnose.js.map +0 -1
  96. package/dist/media/types/enhance.js.map +0 -1
  97. package/dist/media/types/jobResults.js.map +0 -1
  98. package/dist/media/types/jobs.js.map +0 -1
  99. package/dist/media/types/mastering.js.map +0 -1
  100. package/dist/media/types/transcode.js.map +0 -1
  101. package/dist/media/types/webhooks.js.map +0 -1
  102. package/dist/media/webhooks.js.map +0 -1
  103. package/dist/types/jwtToken.js.map +0 -1
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getAllEvents = exports.getEvents = void 0;
13
- const httpHelpers_1 = require("../../internal/httpHelpers");
14
- const httpHelpers_2 = require("../internal/httpHelpers");
15
- const urls_1 = require("../internal/urls");
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getEvents = exports.getAllEvents = void 0;
8
+ var _httpHelpers = require("../../internal/httpHelpers");
9
+ var _httpHelpers2 = require("../internal/httpHelpers");
10
+ var _urls = require("../internal/urls");
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 method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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
+ 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
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
14
  /**
17
15
  * Gets a list of Webhook events sent, during a specific time range. The list includes associated endpoint response codes and headers.
18
16
  *
@@ -23,42 +21,61 @@ const urls_1 = require("../internal/urls");
23
21
  *
24
22
  * @returns A `GetWebHookResponse` object through a `Promise`.
25
23
  */
26
- const getEvents = (accessToken, options) => __awaiter(void 0, void 0, void 0, function* () {
27
- const optionsDefault = {
28
- from: 0,
29
- to: 9999999999999,
30
- max: 100,
31
- };
32
- const opts = Object.assign(optionsDefault, options);
33
- let path = '/v1/monitor/';
34
- if (opts.conferenceId) {
35
- path += `conferences/${opts.conferenceId}/`;
36
- }
37
- path += 'webhooks';
38
- const params = {
39
- from: opts.from.toString(),
40
- to: opts.to.toString(),
41
- max: opts.max.toString(),
42
- };
43
- if (opts.type) {
44
- params['type'] = opts.type;
45
- }
46
- if (opts.start) {
47
- params['start'] = opts.start;
48
- }
49
- const requestOptions = {
50
- hostname: urls_1.COMMS_HOSTNAME,
51
- path,
52
- params,
53
- headers: {
54
- Accept: 'application/json',
55
- Authorization: `${accessToken.token_type} ${accessToken.access_token}`,
56
- },
57
- };
58
- const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
59
- return response;
60
- });
61
- exports.getEvents = getEvents;
24
+ var getEvents = /*#__PURE__*/function () {
25
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, options) {
26
+ var optionsDefault, opts, path, params, requestOptions, response;
27
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
28
+ while (1) {
29
+ switch (_context.prev = _context.next) {
30
+ case 0:
31
+ optionsDefault = {
32
+ from: 0,
33
+ to: 9999999999999,
34
+ max: 100
35
+ };
36
+ opts = Object.assign(optionsDefault, options);
37
+ path = '/v1/monitor/';
38
+ if (opts.conferenceId) {
39
+ path += "conferences/".concat(opts.conferenceId, "/");
40
+ }
41
+ path += 'webhooks';
42
+ params = {
43
+ from: opts.from.toString(),
44
+ to: opts.to.toString(),
45
+ max: opts.max.toString()
46
+ };
47
+ if (opts.type) {
48
+ params['type'] = opts.type;
49
+ }
50
+ if (opts.start) {
51
+ params['start'] = opts.start;
52
+ }
53
+ requestOptions = {
54
+ hostname: _urls.COMMS_HOSTNAME,
55
+ path: path,
56
+ params: params,
57
+ headers: {
58
+ Accept: 'application/json',
59
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
60
+ }
61
+ };
62
+ _context.next = 11;
63
+ return (0, _httpHelpers.sendGet)(requestOptions);
64
+ case 11:
65
+ response = _context.sent;
66
+ return _context.abrupt("return", response);
67
+ case 13:
68
+ case "end":
69
+ return _context.stop();
70
+ }
71
+ }
72
+ }, _callee);
73
+ }));
74
+ return function getEvents(_x, _x2) {
75
+ return _ref.apply(this, arguments);
76
+ };
77
+ }();
78
+
62
79
  /**
63
80
  * Gets a list of all Webhook events sent, during a specific time range. The list includes associated endpoint response codes and headers.
64
81
  *
@@ -69,36 +86,55 @@ exports.getEvents = getEvents;
69
86
  *
70
87
  * @returns An array of `WebHook` objects through a `Promise`.
71
88
  */
72
- const getAllEvents = (accessToken, options) => __awaiter(void 0, void 0, void 0, function* () {
73
- const optionsDefault = {
74
- from: 0,
75
- to: 9999999999999,
76
- page_size: 100,
77
- };
78
- const opts = Object.assign(optionsDefault, options);
79
- let path = '/v1/monitor/';
80
- if (opts.conferenceId) {
81
- path += `conferences/${opts.conferenceId}/`;
82
- }
83
- path += 'webhooks';
84
- const params = {
85
- from: opts.from.toString(),
86
- to: opts.to.toString(),
87
- max: opts.page_size.toString(),
88
- };
89
- if (opts.type) {
90
- params['type'] = opts.type;
91
- }
92
- const requestOptions = {
93
- hostname: urls_1.COMMS_HOSTNAME,
94
- path,
95
- params,
96
- headers: {
97
- Accept: 'application/json',
98
- Authorization: `${accessToken.token_type} ${accessToken.access_token}`,
99
- },
100
- };
101
- return yield (0, httpHelpers_2.getAll)(requestOptions, 'webhooks');
102
- });
103
- exports.getAllEvents = getAllEvents;
104
- //# sourceMappingURL=webhooks.js.map
89
+ exports.getEvents = getEvents;
90
+ var getAllEvents = /*#__PURE__*/function () {
91
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, options) {
92
+ var optionsDefault, opts, path, params, requestOptions;
93
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
94
+ while (1) {
95
+ switch (_context2.prev = _context2.next) {
96
+ case 0:
97
+ optionsDefault = {
98
+ from: 0,
99
+ to: 9999999999999,
100
+ page_size: 100
101
+ };
102
+ opts = Object.assign(optionsDefault, options);
103
+ path = '/v1/monitor/';
104
+ if (opts.conferenceId) {
105
+ path += "conferences/".concat(opts.conferenceId, "/");
106
+ }
107
+ path += 'webhooks';
108
+ params = {
109
+ from: opts.from.toString(),
110
+ to: opts.to.toString(),
111
+ max: opts.page_size.toString()
112
+ };
113
+ if (opts.type) {
114
+ params['type'] = opts.type;
115
+ }
116
+ requestOptions = {
117
+ hostname: _urls.COMMS_HOSTNAME,
118
+ path: path,
119
+ params: params,
120
+ headers: {
121
+ Accept: 'application/json',
122
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
123
+ }
124
+ };
125
+ _context2.next = 10;
126
+ return (0, _httpHelpers2.getAll)(requestOptions, 'webhooks');
127
+ case 10:
128
+ return _context2.abrupt("return", _context2.sent);
129
+ case 11:
130
+ case "end":
131
+ return _context2.stop();
132
+ }
133
+ }
134
+ }, _callee2);
135
+ }));
136
+ return function getAllEvents(_x3, _x4) {
137
+ return _ref2.apply(this, arguments);
138
+ };
139
+ }();
140
+ exports.getAllEvents = getAllEvents;
@@ -1,17 +1,15 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
12
7
  exports.stop = exports.start = void 0;
13
- const httpHelpers_1 = require("../internal/httpHelpers");
14
- const urls_1 = require("./internal/urls");
8
+ var _httpHelpers = require("../internal/httpHelpers");
9
+ var _urls = require("./internal/urls");
10
+ 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 method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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 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
+ 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); }); }; }
15
13
  /**
16
14
  * Starts recording for the specified conference.
17
15
  * You can specify a custom layout URL per recording request.
@@ -28,23 +26,39 @@ const urls_1 = require("./internal/urls");
28
26
  * - `default`: uses the Dolby.io default layout;
29
27
  * - URL string: uses this layout URL
30
28
  */
31
- const start = (accessToken, conferenceId, layoutUrl) => __awaiter(void 0, void 0, void 0, function* () {
32
- const body = {};
33
- if (layoutUrl)
34
- body['layoutUrl'] = layoutUrl;
35
- const options = {
36
- hostname: urls_1.COMMS_HOSTNAME,
37
- path: `/v2/conferences/mix/${conferenceId}/recording/start`,
38
- headers: {
39
- Accept: 'application/json',
40
- 'Content-Type': 'application/json',
41
- Authorization: `${accessToken.token_type} ${accessToken.access_token}`,
42
- },
43
- body: JSON.stringify(body),
44
- };
45
- yield (0, httpHelpers_1.sendPost)(options);
46
- });
47
- exports.start = start;
29
+ var start = /*#__PURE__*/function () {
30
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, conferenceId, layoutUrl) {
31
+ var body, options;
32
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
33
+ while (1) {
34
+ switch (_context.prev = _context.next) {
35
+ case 0:
36
+ body = {};
37
+ if (layoutUrl) body['layoutUrl'] = layoutUrl;
38
+ options = {
39
+ hostname: _urls.COMMS_HOSTNAME,
40
+ path: "/v2/conferences/mix/".concat(conferenceId, "/recording/start"),
41
+ headers: {
42
+ Accept: 'application/json',
43
+ 'Content-Type': 'application/json',
44
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
45
+ },
46
+ body: JSON.stringify(body)
47
+ };
48
+ _context.next = 5;
49
+ return (0, _httpHelpers.sendPost)(options);
50
+ case 5:
51
+ case "end":
52
+ return _context.stop();
53
+ }
54
+ }
55
+ }, _callee);
56
+ }));
57
+ return function start(_x, _x2, _x3) {
58
+ return _ref.apply(this, arguments);
59
+ };
60
+ }();
61
+
48
62
  /**
49
63
  * Stops the recording of the specified conference.
50
64
  *
@@ -53,17 +67,34 @@ exports.start = start;
53
67
  * @param accessToken Access token to use for authentication.
54
68
  * @param conferenceId Identifier of the conference.
55
69
  */
56
- const stop = (accessToken, conferenceId) => __awaiter(void 0, void 0, void 0, function* () {
57
- const options = {
58
- hostname: urls_1.COMMS_HOSTNAME,
59
- path: `/v2/conferences/mix/${conferenceId}/recording/stop`,
60
- headers: {
61
- Accept: 'application/json',
62
- 'Content-Type': 'application/json',
63
- Authorization: `${accessToken.token_type} ${accessToken.access_token}`,
64
- },
65
- };
66
- yield (0, httpHelpers_1.sendPost)(options);
67
- });
68
- exports.stop = stop;
69
- //# sourceMappingURL=recording.js.map
70
+ exports.start = start;
71
+ var stop = /*#__PURE__*/function () {
72
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, conferenceId) {
73
+ var options;
74
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75
+ while (1) {
76
+ switch (_context2.prev = _context2.next) {
77
+ case 0:
78
+ options = {
79
+ hostname: _urls.COMMS_HOSTNAME,
80
+ path: "/v2/conferences/mix/".concat(conferenceId, "/recording/stop"),
81
+ headers: {
82
+ Accept: 'application/json',
83
+ 'Content-Type': 'application/json',
84
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
85
+ }
86
+ };
87
+ _context2.next = 3;
88
+ return (0, _httpHelpers.sendPost)(options);
89
+ case 3:
90
+ case "end":
91
+ return _context2.stop();
92
+ }
93
+ }
94
+ }, _callee2);
95
+ }));
96
+ return function stop(_x4, _x5) {
97
+ return _ref2.apply(this, arguments);
98
+ };
99
+ }();
100
+ exports.stop = stop;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.start = exports.getStatus = void 0;
8
+ var _httpHelpers = require("../internal/httpHelpers");
9
+ var _urls = require("./internal/urls");
10
+ 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 method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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 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
+ 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
+ * Use this API to trigger a remix and regenerate a recording of a previously recorded conference using
15
+ * the current mixer layout. The `Recording.MP4.Available` event is sent if the customer has configured
16
+ * the webhook in the developer portal.
17
+ *
18
+ * @link https://docs.dolby.io/communications-apis/reference/start-conference-remix
19
+ *
20
+ * @param accessToken Access token to use for authentication.
21
+ * @param conferenceId Identifier of the conference.
22
+ * @param layoutUrl Overwrites the layout URL configuration:
23
+ * - `null`: uses the layout URL configured in the dashboard (if no URL is set in the dashboard, then uses the Dolby.io default);
24
+ * - `default`: uses the Dolby.io default layout;
25
+ * - URL string: uses this layout URL
26
+ *
27
+ * @returns A `RemixStatus` object through a `Promise`.
28
+ */
29
+ var start = /*#__PURE__*/function () {
30
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, conferenceId, layoutUrl) {
31
+ var body, options, response;
32
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
33
+ while (1) {
34
+ switch (_context.prev = _context.next) {
35
+ case 0:
36
+ body = {};
37
+ if (layoutUrl) body['layoutUrl'] = layoutUrl;
38
+ options = {
39
+ hostname: _urls.COMMS_HOSTNAME,
40
+ path: "/v2/conferences/mix/".concat(conferenceId, "/remix/start"),
41
+ headers: {
42
+ Accept: 'application/json',
43
+ 'Content-Type': 'application/json',
44
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
45
+ },
46
+ body: JSON.stringify(body)
47
+ };
48
+ _context.next = 5;
49
+ return (0, _httpHelpers.sendPost)(options);
50
+ case 5:
51
+ response = _context.sent;
52
+ return _context.abrupt("return", response);
53
+ case 7:
54
+ case "end":
55
+ return _context.stop();
56
+ }
57
+ }
58
+ }, _callee);
59
+ }));
60
+ return function start(_x, _x2, _x3) {
61
+ return _ref.apply(this, arguments);
62
+ };
63
+ }();
64
+
65
+ /**
66
+ * Gets the status of a current mixing job.
67
+ *
68
+ * @link https://docs.dolby.io/communications-apis/reference/get-conference-remix-status
69
+ *
70
+ * @param accessToken Access token to use for authentication.
71
+ * @param conferenceId Identifier of the conference.
72
+ *
73
+ * @returns A `RemixStatus` object through a `Promise`.
74
+ */
75
+ exports.start = start;
76
+ var getStatus = /*#__PURE__*/function () {
77
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, conferenceId) {
78
+ var options, response;
79
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
80
+ while (1) {
81
+ switch (_context2.prev = _context2.next) {
82
+ case 0:
83
+ options = {
84
+ hostname: _urls.COMMS_HOSTNAME,
85
+ path: "/v2/conferences/mix/".concat(conferenceId, "/remix/status"),
86
+ headers: {
87
+ Accept: 'application/json',
88
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
89
+ }
90
+ };
91
+ _context2.next = 3;
92
+ return (0, _httpHelpers.sendGet)(options);
93
+ case 3:
94
+ response = _context2.sent;
95
+ return _context2.abrupt("return", response);
96
+ case 5:
97
+ case "end":
98
+ return _context2.stop();
99
+ }
100
+ }
101
+ }, _callee2);
102
+ }));
103
+ return function getStatus(_x4, _x5) {
104
+ return _ref2.apply(this, arguments);
105
+ };
106
+ }();
107
+ exports.getStatus = getStatus;