@dolbyio/dolbyio-rest-apis-client 3.4.2 → 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 (196) hide show
  1. package/dist/{src/authentication.d.ts → authentication.d.ts} +0 -0
  2. package/dist/authentication.js +64 -0
  3. package/dist/{src/communications → communications}/authentication.d.ts +0 -0
  4. package/dist/communications/authentication.js +62 -0
  5. package/dist/{src/communications → communications}/conference.d.ts +0 -0
  6. package/dist/communications/conference.js +380 -0
  7. package/dist/{src/communications → communications}/index.d.ts +0 -0
  8. package/dist/communications/index.js +19 -0
  9. package/dist/{src/communications → communications}/internal/httpHelpers.d.ts +0 -0
  10. package/dist/communications/internal/httpHelpers.js +69 -0
  11. package/dist/{src/communications → communications}/internal/urls.d.ts +0 -0
  12. package/dist/communications/internal/urls.js +10 -0
  13. package/dist/{src/communications → communications}/monitor/conferences.d.ts +0 -0
  14. package/dist/communications/monitor/conferences.js +399 -0
  15. package/dist/{src/communications → communications}/monitor/index.d.ts +0 -0
  16. package/dist/communications/monitor/index.js +15 -0
  17. package/dist/{src/communications → communications}/monitor/recordings.d.ts +0 -0
  18. package/dist/communications/monitor/recordings.js +356 -0
  19. package/dist/{src/communications → communications}/monitor/webhooks.d.ts +0 -0
  20. package/dist/communications/monitor/webhooks.js +140 -0
  21. package/dist/{src/communications → communications}/recording.d.ts +0 -0
  22. package/dist/communications/recording.js +100 -0
  23. package/dist/communications/remix.js +107 -0
  24. package/dist/{src/communications → communications}/streaming.d.ts +0 -0
  25. package/dist/communications/streaming.js +191 -0
  26. package/dist/{src/communications → communications}/types/conference.d.ts +0 -0
  27. package/dist/communications/types/conference.js +5 -0
  28. package/dist/{src/communications → communications}/types/conferences.d.ts +0 -0
  29. package/dist/communications/types/conferences.js +5 -0
  30. package/dist/{src/communications → communications}/types/core.d.ts +0 -0
  31. package/dist/communications/types/core.js +5 -0
  32. package/dist/{src/communications → communications}/types/participant.d.ts +0 -0
  33. package/dist/communications/types/participant.js +1 -0
  34. package/dist/{src/communications → communications}/types/permission.d.ts +0 -0
  35. package/dist/communications/types/permission.js +22 -0
  36. package/dist/{src/communications → communications}/types/recordings.d.ts +0 -0
  37. package/dist/communications/types/recordings.js +5 -0
  38. package/dist/communications/types/remixStatus.js +1 -0
  39. package/dist/{src/communications → communications}/types/rtcpMode.d.ts +0 -0
  40. package/dist/communications/types/rtcpMode.js +13 -0
  41. package/dist/{src/communications → communications}/types/spatialAudio.d.ts +0 -0
  42. package/dist/communications/types/spatialAudio.js +5 -0
  43. package/dist/{src/communications → communications}/types/videoCodec.d.ts +0 -0
  44. package/dist/communications/types/videoCodec.js +12 -0
  45. package/dist/{src/communications → communications}/types/webhooks.d.ts +0 -0
  46. package/dist/communications/types/webhooks.js +5 -0
  47. package/dist/{src/index.d.ts → index.d.ts} +2 -1
  48. package/dist/index.js +17 -0
  49. package/dist/{src/internal → internal}/httpHelpers.d.ts +0 -0
  50. package/dist/internal/httpHelpers.js +217 -0
  51. package/dist/{src/internal → internal}/urls.d.ts +0 -0
  52. package/dist/internal/urls.js +8 -0
  53. package/dist/{src/media → media}/analyze.d.ts +0 -0
  54. package/dist/media/analyze.js +95 -0
  55. package/dist/{src/media → media}/analyzeSpeech.d.ts +0 -0
  56. package/dist/media/analyzeSpeech.js +89 -0
  57. package/dist/{src/media → media}/diagnose.d.ts +0 -0
  58. package/dist/media/diagnose.js +91 -0
  59. package/dist/{src/media → media}/enhance.d.ts +0 -0
  60. package/dist/media/enhance.js +86 -0
  61. package/dist/{src/media → media}/index.d.ts +0 -0
  62. package/dist/media/index.js +27 -0
  63. package/dist/{src/media → media}/internal/httpHelpers.d.ts +0 -0
  64. package/dist/media/internal/httpHelpers.js +61 -0
  65. package/dist/{src/media → media}/internal/jobsHelpers.d.ts +0 -0
  66. package/dist/media/internal/jobsHelpers.js +85 -0
  67. package/dist/{src/media → media}/internal/urls.d.ts +0 -0
  68. package/dist/media/internal/urls.js +8 -0
  69. package/dist/{src/media → media}/io.d.ts +0 -0
  70. package/dist/media/io.js +176 -0
  71. package/dist/{src/media → media}/jobs.d.ts +0 -0
  72. package/dist/media/jobs.js +182 -0
  73. package/dist/{src/media → media}/mastering.d.ts +0 -0
  74. package/dist/media/mastering.js +166 -0
  75. package/dist/{src/media → media}/transcode.d.ts +0 -0
  76. package/dist/media/transcode.js +82 -0
  77. package/dist/{src/media → media}/types/analyze.d.ts +0 -0
  78. package/dist/media/types/analyze.js +5 -0
  79. package/dist/{src/media → media}/types/analyzeSpeech.d.ts +0 -0
  80. package/dist/media/types/analyzeSpeech.js +5 -0
  81. package/dist/{src/media → media}/types/diagnose.d.ts +0 -0
  82. package/dist/media/types/diagnose.js +5 -0
  83. package/dist/{src/media → media}/types/enhance.d.ts +0 -0
  84. package/dist/media/types/enhance.js +5 -0
  85. package/dist/{src/media → media}/types/jobResults.d.ts +0 -0
  86. package/dist/media/types/jobResults.js +5 -0
  87. package/dist/{src/media → media}/types/jobs.d.ts +0 -0
  88. package/dist/media/types/jobs.js +5 -0
  89. package/dist/{src/media → media}/types/mastering.d.ts +0 -0
  90. package/dist/media/types/mastering.js +5 -0
  91. package/dist/{src/media → media}/types/transcode.d.ts +0 -0
  92. package/dist/media/types/transcode.js +5 -0
  93. package/dist/{src/media → media}/types/webhooks.d.ts +0 -0
  94. package/dist/media/types/webhooks.js +5 -0
  95. package/dist/{src/media → media}/webhooks.d.ts +0 -0
  96. package/dist/media/webhooks.js +216 -0
  97. package/dist/{src/types → types}/jwtToken.d.ts +0 -0
  98. package/dist/types/jwtToken.js +1 -0
  99. package/package.json +8 -3
  100. package/dist/package.json +0 -30
  101. package/dist/src/authentication.js +0 -48
  102. package/dist/src/authentication.js.map +0 -1
  103. package/dist/src/communications/authentication.js +0 -46
  104. package/dist/src/communications/authentication.js.map +0 -1
  105. package/dist/src/communications/conference.js +0 -255
  106. package/dist/src/communications/conference.js.map +0 -1
  107. package/dist/src/communications/index.js +0 -37
  108. package/dist/src/communications/index.js.map +0 -1
  109. package/dist/src/communications/internal/httpHelpers.js +0 -47
  110. package/dist/src/communications/internal/httpHelpers.js.map +0 -1
  111. package/dist/src/communications/internal/urls.js +0 -6
  112. package/dist/src/communications/internal/urls.js.map +0 -1
  113. package/dist/src/communications/monitor/conferences.js +0 -271
  114. package/dist/src/communications/monitor/conferences.js.map +0 -1
  115. package/dist/src/communications/monitor/index.js +0 -33
  116. package/dist/src/communications/monitor/index.js.map +0 -1
  117. package/dist/src/communications/monitor/recordings.js +0 -226
  118. package/dist/src/communications/monitor/recordings.js.map +0 -1
  119. package/dist/src/communications/monitor/webhooks.js +0 -104
  120. package/dist/src/communications/monitor/webhooks.js.map +0 -1
  121. package/dist/src/communications/recording.js +0 -69
  122. package/dist/src/communications/recording.js.map +0 -1
  123. package/dist/src/communications/streaming.js +0 -123
  124. package/dist/src/communications/streaming.js.map +0 -1
  125. package/dist/src/communications/types/conference.js +0 -3
  126. package/dist/src/communications/types/conference.js.map +0 -1
  127. package/dist/src/communications/types/conferences.js +0 -3
  128. package/dist/src/communications/types/conferences.js.map +0 -1
  129. package/dist/src/communications/types/core.js +0 -3
  130. package/dist/src/communications/types/core.js.map +0 -1
  131. package/dist/src/communications/types/participant.js +0 -3
  132. package/dist/src/communications/types/participant.js.map +0 -1
  133. package/dist/src/communications/types/permission.js +0 -31
  134. package/dist/src/communications/types/permission.js.map +0 -1
  135. package/dist/src/communications/types/recordings.js +0 -3
  136. package/dist/src/communications/types/recordings.js.map +0 -1
  137. package/dist/src/communications/types/rtcpMode.js +0 -13
  138. package/dist/src/communications/types/rtcpMode.js.map +0 -1
  139. package/dist/src/communications/types/spatialAudio.js +0 -3
  140. package/dist/src/communications/types/spatialAudio.js.map +0 -1
  141. package/dist/src/communications/types/videoCodec.js +0 -9
  142. package/dist/src/communications/types/videoCodec.js.map +0 -1
  143. package/dist/src/communications/types/webhooks.js +0 -3
  144. package/dist/src/communications/types/webhooks.js.map +0 -1
  145. package/dist/src/index.js +0 -33
  146. package/dist/src/index.js.map +0 -1
  147. package/dist/src/internal/httpHelpers.js +0 -184
  148. package/dist/src/internal/httpHelpers.js.map +0 -1
  149. package/dist/src/internal/urls.js +0 -5
  150. package/dist/src/internal/urls.js.map +0 -1
  151. package/dist/src/media/analyze.js +0 -61
  152. package/dist/src/media/analyze.js.map +0 -1
  153. package/dist/src/media/analyzeSpeech.js +0 -55
  154. package/dist/src/media/analyzeSpeech.js.map +0 -1
  155. package/dist/src/media/diagnose.js +0 -57
  156. package/dist/src/media/diagnose.js.map +0 -1
  157. package/dist/src/media/enhance.js +0 -52
  158. package/dist/src/media/enhance.js.map +0 -1
  159. package/dist/src/media/index.js +0 -45
  160. package/dist/src/media/index.js.map +0 -1
  161. package/dist/src/media/internal/httpHelpers.js +0 -76
  162. package/dist/src/media/internal/httpHelpers.js.map +0 -1
  163. package/dist/src/media/internal/jobsHelpers.js +0 -47
  164. package/dist/src/media/internal/jobsHelpers.js.map +0 -1
  165. package/dist/src/media/internal/urls.js +0 -5
  166. package/dist/src/media/internal/urls.js.map +0 -1
  167. package/dist/src/media/io.js +0 -99
  168. package/dist/src/media/io.js.map +0 -1
  169. package/dist/src/media/jobs.js +0 -120
  170. package/dist/src/media/jobs.js.map +0 -1
  171. package/dist/src/media/mastering.js +0 -94
  172. package/dist/src/media/mastering.js.map +0 -1
  173. package/dist/src/media/transcode.js +0 -48
  174. package/dist/src/media/transcode.js.map +0 -1
  175. package/dist/src/media/types/analyze.js +0 -3
  176. package/dist/src/media/types/analyze.js.map +0 -1
  177. package/dist/src/media/types/analyzeSpeech.js +0 -3
  178. package/dist/src/media/types/analyzeSpeech.js.map +0 -1
  179. package/dist/src/media/types/diagnose.js +0 -3
  180. package/dist/src/media/types/diagnose.js.map +0 -1
  181. package/dist/src/media/types/enhance.js +0 -3
  182. package/dist/src/media/types/enhance.js.map +0 -1
  183. package/dist/src/media/types/jobResults.js +0 -3
  184. package/dist/src/media/types/jobResults.js.map +0 -1
  185. package/dist/src/media/types/jobs.js +0 -3
  186. package/dist/src/media/types/jobs.js.map +0 -1
  187. package/dist/src/media/types/mastering.js +0 -3
  188. package/dist/src/media/types/mastering.js.map +0 -1
  189. package/dist/src/media/types/transcode.js +0 -3
  190. package/dist/src/media/types/transcode.js.map +0 -1
  191. package/dist/src/media/types/webhooks.js +0 -3
  192. package/dist/src/media/types/webhooks.js.map +0 -1
  193. package/dist/src/media/webhooks.js +0 -136
  194. package/dist/src/media/webhooks.js.map +0 -1
  195. package/dist/src/types/jwtToken.js +0 -3
  196. package/dist/src/types/jwtToken.js.map +0 -1
@@ -0,0 +1,217 @@
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.sendPut = exports.sendPost = exports.sendGet = exports.sendDelete = exports.download = void 0;
8
+ var _fs = _interopRequireDefault(require("fs"));
9
+ var _followRedirects = require("follow-redirects");
10
+ var _url = require("url");
11
+ var _index = require("../index");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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 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; }
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); } }
15
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ /**
20
+ * Sends a POST request.
21
+ *
22
+ * @param options request options.
23
+ *
24
+ * @returns A JSON payload object through a Promise.
25
+ */
26
+ var sendRequest = function sendRequest(options) {
27
+ return new Promise(function (resolve, reject) {
28
+ var path = options.path;
29
+ if (options.params && Object.keys(options.params).length > 0) {
30
+ var searchParams = new _url.URLSearchParams(options.params);
31
+ path += "?".concat(searchParams);
32
+ }
33
+ var opts = {
34
+ hostname: options.hostname,
35
+ port: 443,
36
+ path: path,
37
+ method: options.method,
38
+ headers: options.headers
39
+ };
40
+
41
+ // Override the User Agent
42
+ opts.headers['User-Agent'] = "DolbyIoRestApiSdk/".concat(_index.version, "; Node/").concat(process.versions.node);
43
+ var req = _followRedirects.https.request(opts, function (res) {
44
+ console.log("[".concat(opts.method, "] ").concat(res.statusCode, " - https://").concat(opts.hostname).concat(opts.path));
45
+ var data = '';
46
+ res.on('data', function (chunk) {
47
+ data = data + chunk.toString();
48
+ });
49
+ res.on('end', function () {
50
+ if (data.length > 0) {
51
+ if (res.statusCode < 200 || res.statusCode >= 400) {
52
+ reject('This request has been rejected with the response code ' + res.statusCode + ' and description: ' + data);
53
+ } else {
54
+ var json = JSON.parse(data);
55
+ resolve(json);
56
+ }
57
+ } else {
58
+ if (res.statusCode < 200 || res.statusCode >= 400) {
59
+ reject('This request has been rejected with the response code ' + res.statusCode);
60
+ } else {
61
+ resolve(null);
62
+ }
63
+ }
64
+ });
65
+ });
66
+ req.on('error', function (error) {
67
+ console.error(error);
68
+ reject(error);
69
+ });
70
+ if (options.body && options.body.length > 0) {
71
+ req.write(options.body);
72
+ }
73
+ req.end();
74
+ });
75
+ };
76
+
77
+ /**
78
+ * Sends a GET request.
79
+ *
80
+ * @param options Request options.
81
+ *
82
+ * @returns A JSON payload object through a Promise.
83
+ */
84
+ var sendGet = function sendGet(options) {
85
+ var sendRequestOptions = _objectSpread({
86
+ method: 'GET'
87
+ }, options);
88
+ return sendRequest(sendRequestOptions);
89
+ };
90
+
91
+ /**
92
+ * Sends a POST request.
93
+ *
94
+ * @param options Request options.
95
+ *
96
+ * @returns A JSON payload object through a Promise.
97
+ */
98
+ exports.sendGet = sendGet;
99
+ var sendPost = function sendPost(options) {
100
+ if (!options.body) {
101
+ // The REST APIs don't support an empty payload
102
+ options.body = '{}';
103
+ options.headers['Content-Type'] = 'application/json';
104
+ }
105
+ options.headers['Content-Length'] = options.body.length;
106
+ var sendRequestOptions = _objectSpread({
107
+ method: 'POST'
108
+ }, options);
109
+ return sendRequest(sendRequestOptions);
110
+ };
111
+
112
+ /**
113
+ * Sends a PUT request.
114
+ *
115
+ * @param options Request options.
116
+ *
117
+ * @returns A JSON payload object through a Promise.
118
+ */
119
+ exports.sendPost = sendPost;
120
+ var sendPut = function sendPut(options) {
121
+ options.headers['Content-Length'] = options.body.length;
122
+ var sendRequestOptions = _objectSpread({
123
+ method: 'PUT'
124
+ }, options);
125
+ return sendRequest(sendRequestOptions);
126
+ };
127
+
128
+ /**
129
+ * Sends a DELETE request.
130
+ *
131
+ * @param options Request options.
132
+ *
133
+ * @returns A JSON payload object through a Promise.
134
+ */
135
+ exports.sendPut = sendPut;
136
+ var sendDelete = /*#__PURE__*/function () {
137
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
138
+ var sendRequestOptions;
139
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
140
+ while (1) {
141
+ switch (_context.prev = _context.next) {
142
+ case 0:
143
+ sendRequestOptions = _objectSpread({
144
+ method: 'DELETE'
145
+ }, options);
146
+ _context.next = 3;
147
+ return sendRequest(sendRequestOptions);
148
+ case 3:
149
+ return _context.abrupt("return", _context.sent);
150
+ case 4:
151
+ case "end":
152
+ return _context.stop();
153
+ }
154
+ }
155
+ }, _callee);
156
+ }));
157
+ return function sendDelete(_x) {
158
+ return _ref.apply(this, arguments);
159
+ };
160
+ }();
161
+
162
+ /**
163
+ * Download a file.
164
+ *
165
+ * @param filepath Where to save the file.
166
+ * @param options Request options.
167
+ */
168
+ exports.sendDelete = sendDelete;
169
+ var download = function download(filepath, options) {
170
+ var sendRequestOptions = _objectSpread({
171
+ method: 'GET'
172
+ }, options);
173
+ return new Promise(function (resolve, reject) {
174
+ var path = sendRequestOptions.path;
175
+ if (sendRequestOptions.params && Object.keys(sendRequestOptions.params).length > 0) {
176
+ var searchParams = new _url.URLSearchParams(sendRequestOptions.params);
177
+ path += "?".concat(searchParams);
178
+ }
179
+ var opts = {
180
+ hostname: sendRequestOptions.hostname,
181
+ port: 443,
182
+ path: path,
183
+ method: sendRequestOptions.method,
184
+ headers: sendRequestOptions.headers
185
+ };
186
+
187
+ // Override the User Agent
188
+ opts.headers['User-Agent'] = "DolbyIoRestApiSdk/".concat(_index.version, "; Node/").concat(process.versions.node);
189
+ var req = _followRedirects.https.request(opts, function (res) {
190
+ console.log("[".concat(opts.method, "] ").concat(res.statusCode, " - https://").concat(opts.hostname).concat(opts.path));
191
+ if (res.statusCode < 200 || res.statusCode >= 400) {
192
+ reject('This request has been rejected with the response code ' + res.statusCode);
193
+ return;
194
+ }
195
+ var fileStream = _fs["default"].createWriteStream(filepath, {
196
+ autoClose: true
197
+ });
198
+ fileStream.on('finish', function () {
199
+ resolve();
200
+ });
201
+ fileStream.on('error', function (error) {
202
+ console.error(error);
203
+ reject(error);
204
+ });
205
+ res.pipe(fileStream);
206
+ });
207
+ req.on('error', function (error) {
208
+ console.error(error);
209
+ reject(error);
210
+ });
211
+ if (options.body && options.body.length > 0) {
212
+ req.write(options.body);
213
+ }
214
+ req.end();
215
+ });
216
+ };
217
+ exports.download = download;
File without changes
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AUTH_HOSTNAME = void 0;
7
+ var AUTH_HOSTNAME = 'api.dolby.io';
8
+ exports.AUTH_HOSTNAME = AUTH_HOSTNAME;
File without changes
@@ -0,0 +1,95 @@
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.getResults = void 0;
8
+ var _jobsHelpers = require("./internal/jobsHelpers");
9
+ 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; }
10
+ 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); } }
11
+ 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); }); }; }
12
+ /**
13
+ * Starts analyzing to learn about your media.
14
+ *
15
+ * The `input` location of your source media file and `output` location of your Analyze JSON results file are required.
16
+ *
17
+ * This is an asynchronous operation so you will receive a `job_id` to be used to get the job status and result.
18
+ *
19
+ * There are additional optional parameters that can be provided to identify the type of content and additional loudness or validation requirements. See the samples for examples of what requests and responses look like.
20
+ *
21
+ * @link https://docs.dolby.io/media-apis/reference/media-analyze-post
22
+ *
23
+ * Beta API
24
+ * This API is being made available as an early preview.
25
+ * If you have feedback on how you'd like to use the API please reach out to share your feedback with our team.
26
+ * https://dolby.io/contact
27
+ *
28
+ * Content Length
29
+ *
30
+ * Media content with duration less than 2 seconds will not be processed. The API will return an ERROR in this case.
31
+ *
32
+ * @param accessToken Access token to use for authentication.
33
+ * @param jobContent Content of the job description as a JSON payload. You can find the definition at this URL: https://docs.dolby.io/media-apis/reference/media-analyze-post
34
+ *
35
+ * @returns The job identifier through a `Promise`.
36
+ */
37
+ var start = /*#__PURE__*/function () {
38
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, jobContent) {
39
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
40
+ while (1) {
41
+ switch (_context.prev = _context.next) {
42
+ case 0:
43
+ _context.next = 2;
44
+ return (0, _jobsHelpers.startJob)(accessToken, '/media/analyze', jobContent);
45
+ case 2:
46
+ return _context.abrupt("return", _context.sent);
47
+ case 3:
48
+ case "end":
49
+ return _context.stop();
50
+ }
51
+ }
52
+ }, _callee);
53
+ }));
54
+ return function start(_x, _x2) {
55
+ return _ref.apply(this, arguments);
56
+ };
57
+ }();
58
+
59
+ /**
60
+ * Gets Analyze Status.
61
+ *
62
+ * For a given job_id, this method will check the job status.
63
+ *
64
+ * When `status==Success` you'll be able to retrieve your result from the output location you provided in the original POST.
65
+ *
66
+ * @link https://docs.dolby.io/media-apis/reference/media-analyze-get
67
+ *
68
+ * @param accessToken Access token to use for authentication.
69
+ * @param jobId Identifier of the job to retrieve.
70
+ *
71
+ * @returns The `AnalyzeJob` object through a `Promise`.
72
+ */
73
+ exports.start = start;
74
+ var getResults = /*#__PURE__*/function () {
75
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, jobId) {
76
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
77
+ while (1) {
78
+ switch (_context2.prev = _context2.next) {
79
+ case 0:
80
+ _context2.next = 2;
81
+ return (0, _jobsHelpers.getJobResults)(accessToken, '/media/analyze', jobId);
82
+ case 2:
83
+ return _context2.abrupt("return", _context2.sent);
84
+ case 3:
85
+ case "end":
86
+ return _context2.stop();
87
+ }
88
+ }
89
+ }, _callee2);
90
+ }));
91
+ return function getResults(_x3, _x4) {
92
+ return _ref2.apply(this, arguments);
93
+ };
94
+ }();
95
+ exports.getResults = getResults;
File without changes
@@ -0,0 +1,89 @@
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.getResults = void 0;
8
+ var _jobsHelpers = require("./internal/jobsHelpers");
9
+ 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; }
10
+ 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); } }
11
+ 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); }); }; }
12
+ /**
13
+ * Starts analyzing to learn about speech in your media.
14
+ *
15
+ * The `input` location of your source media file and `output` location of your Analyze JSON results file are required.
16
+ *
17
+ * This is an asynchronous operation so you will receive a `job_id` to be used to get the job status and result.
18
+ *
19
+ * @link https://docs.dolby.io/media-apis/reference/media-analyze-speech-post
20
+ *
21
+ * Beta API
22
+ * This API is being made available as an early preview.
23
+ * If you have feedback on how you'd like to use the API please reach out to share your feedback with our team.
24
+ * https://dolby.io/contact
25
+ *
26
+ * @param accessToken Access token to use for authentication.
27
+ * @param jobContent Content of the job description as a JSON payload. You can find the definition at this URL: https://docs.dolby.io/media-apis/reference/media-analyze-speech-post
28
+ *
29
+ * @returns The job identifier through a `Promise`.
30
+ */
31
+ var start = /*#__PURE__*/function () {
32
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, jobContent) {
33
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34
+ while (1) {
35
+ switch (_context.prev = _context.next) {
36
+ case 0:
37
+ _context.next = 2;
38
+ return (0, _jobsHelpers.startJob)(accessToken, '/media/analyze/speech', jobContent);
39
+ case 2:
40
+ return _context.abrupt("return", _context.sent);
41
+ case 3:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }
46
+ }, _callee);
47
+ }));
48
+ return function start(_x, _x2) {
49
+ return _ref.apply(this, arguments);
50
+ };
51
+ }();
52
+
53
+ /**
54
+ * Gets Speech Analytics Status.
55
+ *
56
+ * For a given job_id, this method will check if the processing task has completed.
57
+ *
58
+ * When `status` is `Success`, you'll be able to retrieve your result from the `output` location you provided in the original `POST`.
59
+ *
60
+ * @link https://docs.dolby.io/media-apis/reference/media-analyze-speech-get
61
+ *
62
+ * @param accessToken Access token to use for authentication.
63
+ * @param jobId Identifier of the job to retrieve.
64
+ *
65
+ * @returns The `AnalyzeSpeechJob` object through a `Promise`.
66
+ */
67
+ exports.start = start;
68
+ var getResults = /*#__PURE__*/function () {
69
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, jobId) {
70
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
71
+ while (1) {
72
+ switch (_context2.prev = _context2.next) {
73
+ case 0:
74
+ _context2.next = 2;
75
+ return (0, _jobsHelpers.getJobResults)(accessToken, '/media/analyze/speech', jobId);
76
+ case 2:
77
+ return _context2.abrupt("return", _context2.sent);
78
+ case 3:
79
+ case "end":
80
+ return _context2.stop();
81
+ }
82
+ }
83
+ }, _callee2);
84
+ }));
85
+ return function getResults(_x3, _x4) {
86
+ return _ref2.apply(this, arguments);
87
+ };
88
+ }();
89
+ exports.getResults = getResults;
File without changes
@@ -0,0 +1,91 @@
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.getResults = void 0;
8
+ var _jobsHelpers = require("./internal/jobsHelpers");
9
+ 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; }
10
+ 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); } }
11
+ 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); }); }; }
12
+ /**
13
+ * Starts diagnosing to learn about the audio quality of your media.
14
+ *
15
+ * The `input` location of your source media file is required.
16
+ *
17
+ * This is an asynchronous operation so you will receive a `job_id` to be used to get the job status and result.
18
+ *
19
+ * @link https://docs.dolby.io/media-apis/reference/media-diagnose-post
20
+ *
21
+ * Beta API
22
+ * This API is being made available as an early preview.
23
+ * If you have feedback on how you'd like to use the API please reach out to share your feedback with our team.
24
+ * https://dolby.io/contact
25
+ *
26
+ * @param accessToken Access token to use for authentication.
27
+ * @param jobContent Content of the job description as a JSON payload. You can find the definition at this URL: https://docs.dolby.io/media-apis/reference/media-diagnose-post
28
+ *
29
+ * @returns The job identifier through a `Promise`.
30
+ */
31
+ var start = /*#__PURE__*/function () {
32
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessToken, jobContent) {
33
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34
+ while (1) {
35
+ switch (_context.prev = _context.next) {
36
+ case 0:
37
+ _context.next = 2;
38
+ return (0, _jobsHelpers.startJob)(accessToken, '/media/diagnose', jobContent);
39
+ case 2:
40
+ return _context.abrupt("return", _context.sent);
41
+ case 3:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }
46
+ }, _callee);
47
+ }));
48
+ return function start(_x, _x2) {
49
+ return _ref.apply(this, arguments);
50
+ };
51
+ }();
52
+
53
+ /**
54
+ * Gets Diagnose Results.
55
+ *
56
+ * For a given job_id, this method will check if the processing task has completed.
57
+ *
58
+ * The `progress` attribute provides a percentage of job progress.
59
+ *
60
+ * If the `status` is Success then the json result will be returned in the response.
61
+ *
62
+ * @link https://docs.dolby.io/media-apis/reference/media-diagnose-get
63
+ *
64
+ * @param accessToken Access token to use for authentication.
65
+ * @param jobId Identifier of the job to retrieve.
66
+ *
67
+ * @returns The `DiagnoseJob` object through a `Promise`.
68
+ */
69
+ exports.start = start;
70
+ var getResults = /*#__PURE__*/function () {
71
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessToken, jobId) {
72
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
73
+ while (1) {
74
+ switch (_context2.prev = _context2.next) {
75
+ case 0:
76
+ _context2.next = 2;
77
+ return (0, _jobsHelpers.getJobResults)(accessToken, '/media/diagnose', jobId);
78
+ case 2:
79
+ return _context2.abrupt("return", _context2.sent);
80
+ case 3:
81
+ case "end":
82
+ return _context2.stop();
83
+ }
84
+ }
85
+ }, _callee2);
86
+ }));
87
+ return function getResults(_x3, _x4) {
88
+ return _ref2.apply(this, arguments);
89
+ };
90
+ }();
91
+ exports.getResults = getResults;
File without changes