@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,22 +1,21 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.download = exports.sendDelete = exports.sendPut = exports.sendPost = exports.sendGet = void 0;
16
- const fs_1 = __importDefault(require("fs"));
17
- const follow_redirects_1 = require("follow-redirects");
18
- const url_1 = require("url");
19
- const version_1 = __importDefault(require("./version"));
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; }
20
19
  /**
21
20
  * Sends a POST request.
22
21
  *
@@ -24,58 +23,57 @@ const version_1 = __importDefault(require("./version"));
24
23
  *
25
24
  * @returns A JSON payload object through a Promise.
26
25
  */
27
- const sendRequest = (options) => {
28
- return new Promise((resolve, reject) => {
29
- let path = options.path;
30
- if (options.params && Object.keys(options.params).length > 0) {
31
- const searchParams = new url_1.URLSearchParams(options.params);
32
- path += `?${searchParams}`;
33
- }
34
- const opts = {
35
- hostname: options.hostname,
36
- port: 443,
37
- path: path,
38
- method: options.method,
39
- headers: options.headers,
40
- };
41
- // Override the User Agent
42
- opts.headers['User-Agent'] = `DolbyIoRestApiSdk/${version_1.default}; Node/${process.versions.node}`;
43
- const req = follow_redirects_1.https.request(opts, (res) => {
44
- console.log(`[${opts.method}] ${res.statusCode} - https://${opts.hostname}${opts.path}`);
45
- let data = '';
46
- res.on('data', (chunk) => {
47
- data = data + chunk.toString();
48
- });
49
- res.on('end', () => {
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
- }
54
- else {
55
- const json = JSON.parse(data);
56
- resolve(json);
57
- }
58
- }
59
- else {
60
- if (res.statusCode < 200 || res.statusCode >= 400) {
61
- reject('This request has been rejected with the response code ' + res.statusCode);
62
- }
63
- else {
64
- resolve(null);
65
- }
66
- }
67
- });
68
- });
69
- req.on('error', (error) => {
70
- console.error(error);
71
- reject(error);
72
- });
73
- if (options.body && options.body.length > 0) {
74
- req.write(options.body);
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
+ }
75
63
  }
76
- req.end();
64
+ });
77
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
+ });
78
75
  };
76
+
79
77
  /**
80
78
  * Sends a GET request.
81
79
  *
@@ -83,11 +81,13 @@ const sendRequest = (options) => {
83
81
  *
84
82
  * @returns A JSON payload object through a Promise.
85
83
  */
86
- const sendGet = (options) => {
87
- const sendRequestOptions = Object.assign({ method: 'GET' }, options);
88
- return sendRequest(sendRequestOptions);
84
+ var sendGet = function sendGet(options) {
85
+ var sendRequestOptions = _objectSpread({
86
+ method: 'GET'
87
+ }, options);
88
+ return sendRequest(sendRequestOptions);
89
89
  };
90
- exports.sendGet = sendGet;
90
+
91
91
  /**
92
92
  * Sends a POST request.
93
93
  *
@@ -95,17 +95,20 @@ exports.sendGet = sendGet;
95
95
  *
96
96
  * @returns A JSON payload object through a Promise.
97
97
  */
98
- const sendPost = (options) => {
99
- if (!options.body) {
100
- // The REST APIs don't support an empty payload
101
- options.body = '{}';
102
- options.headers['Content-Type'] = 'application/json';
103
- }
104
- options.headers['Content-Length'] = options.body.length;
105
- const sendRequestOptions = Object.assign({ method: 'POST' }, options);
106
- return sendRequest(sendRequestOptions);
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);
107
110
  };
108
- exports.sendPost = sendPost;
111
+
109
112
  /**
110
113
  * Sends a PUT request.
111
114
  *
@@ -113,12 +116,15 @@ exports.sendPost = sendPost;
113
116
  *
114
117
  * @returns A JSON payload object through a Promise.
115
118
  */
116
- const sendPut = (options) => {
117
- options.headers['Content-Length'] = options.body.length;
118
- const sendRequestOptions = Object.assign({ method: 'PUT' }, options);
119
- return sendRequest(sendRequestOptions);
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);
120
126
  };
121
- exports.sendPut = sendPut;
127
+
122
128
  /**
123
129
  * Sends a DELETE request.
124
130
  *
@@ -126,59 +132,86 @@ exports.sendPut = sendPut;
126
132
  *
127
133
  * @returns A JSON payload object through a Promise.
128
134
  */
129
- const sendDelete = (options) => __awaiter(void 0, void 0, void 0, function* () {
130
- const sendRequestOptions = Object.assign({ method: 'DELETE' }, options);
131
- return yield sendRequest(sendRequestOptions);
132
- });
133
- exports.sendDelete = sendDelete;
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
+
134
162
  /**
135
163
  * Download a file.
136
164
  *
137
165
  * @param filepath Where to save the file.
138
166
  * @param options Request options.
139
167
  */
140
- const download = (filepath, options) => {
141
- const sendRequestOptions = Object.assign({ method: 'GET' }, options);
142
- return new Promise((resolve, reject) => {
143
- let path = sendRequestOptions.path;
144
- if (sendRequestOptions.params && Object.keys(sendRequestOptions.params).length > 0) {
145
- const searchParams = new url_1.URLSearchParams(sendRequestOptions.params);
146
- path += `?${searchParams}`;
147
- }
148
- const opts = {
149
- hostname: sendRequestOptions.hostname,
150
- port: 443,
151
- path: path,
152
- method: sendRequestOptions.method,
153
- headers: sendRequestOptions.headers,
154
- };
155
- // Override the User Agent
156
- opts.headers['User-Agent'] = `DolbyIoRestApiSdk/${version_1.default}; Node/${process.versions.node}`;
157
- const req = follow_redirects_1.https.request(opts, (res) => {
158
- console.log(`[${opts.method}] ${res.statusCode} - https://${opts.hostname}${opts.path}`);
159
- if (res.statusCode < 200 || res.statusCode >= 400) {
160
- reject('This request has been rejected with the response code ' + res.statusCode);
161
- return;
162
- }
163
- const fileStream = fs_1.default.createWriteStream(filepath, { autoClose: true });
164
- fileStream.on('finish', () => {
165
- resolve();
166
- });
167
- fileStream.on('error', (error) => {
168
- console.error(error);
169
- reject(error);
170
- });
171
- res.pipe(fileStream);
172
- });
173
- req.on('error', (error) => {
174
- console.error(error);
175
- reject(error);
176
- });
177
- if (options.body && options.body.length > 0) {
178
- req.write(options.body);
179
- }
180
- req.end();
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);
181
210
  });
211
+ if (options.body && options.body.length > 0) {
212
+ req.write(options.body);
213
+ }
214
+ req.end();
215
+ });
182
216
  };
183
- exports.download = download;
184
- //# sourceMappingURL=httpHelpers.js.map
217
+ exports.download = download;
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.AUTH_HOSTNAME = void 0;
4
- exports.AUTH_HOSTNAME = 'api.dolby.io';
5
- //# sourceMappingURL=urls.js.map
7
+ var AUTH_HOSTNAME = 'api.dolby.io';
8
+ exports.AUTH_HOSTNAME = AUTH_HOSTNAME;
@@ -1,16 +1,14 @@
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.getResults = exports.start = void 0;
13
- const jobsHelpers_1 = require("./internal/jobsHelpers");
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); }); }; }
14
12
  /**
15
13
  * Starts analyzing to learn about your media.
16
14
  *
@@ -36,10 +34,28 @@ const jobsHelpers_1 = require("./internal/jobsHelpers");
36
34
  *
37
35
  * @returns The job identifier through a `Promise`.
38
36
  */
39
- const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
40
- return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/analyze', jobContent);
41
- });
42
- exports.start = start;
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
+
43
59
  /**
44
60
  * Gets Analyze Status.
45
61
  *
@@ -54,8 +70,26 @@ exports.start = start;
54
70
  *
55
71
  * @returns The `AnalyzeJob` object through a `Promise`.
56
72
  */
57
- const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
58
- return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/analyze', jobId);
59
- });
60
- exports.getResults = getResults;
61
- //# sourceMappingURL=analyze.js.map
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;