@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.
- package/dist/authentication.js +49 -33
- package/dist/communications/authentication.js +49 -33
- package/dist/communications/conference.js +306 -181
- package/dist/communications/index.js +11 -29
- package/dist/communications/internal/httpHelpers.js +56 -34
- package/dist/communications/internal/urls.js +8 -4
- package/dist/communications/monitor/conferences.js +322 -194
- package/dist/communications/monitor/index.js +9 -27
- package/dist/communications/monitor/recordings.js +274 -144
- package/dist/communications/monitor/webhooks.js +119 -83
- package/dist/communications/recording.js +74 -43
- package/dist/communications/remix.js +107 -0
- package/dist/communications/streaming.js +145 -77
- package/dist/communications/types/conference.js +4 -2
- package/dist/communications/types/conferences.js +4 -2
- package/dist/communications/types/core.js +4 -2
- package/dist/communications/types/participant.js +1 -3
- package/dist/communications/types/permission.js +18 -27
- package/dist/communications/types/recordings.js +4 -2
- package/dist/communications/types/remixStatus.js +1 -0
- package/dist/communications/types/rtcpMode.js +9 -9
- package/dist/communications/types/spatialAudio.js +4 -2
- package/dist/communications/types/videoCodec.js +8 -5
- package/dist/communications/types/webhooks.js +4 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -28
- package/dist/internal/httpHelpers.js +167 -134
- package/dist/internal/urls.js +6 -3
- package/dist/media/analyze.js +55 -21
- package/dist/media/analyzeSpeech.js +55 -21
- package/dist/media/diagnose.js +55 -21
- package/dist/media/enhance.js +55 -21
- package/dist/media/index.js +15 -33
- package/dist/media/internal/httpHelpers.js +27 -42
- package/dist/media/internal/jobsHelpers.js +82 -44
- package/dist/media/internal/urls.js +6 -3
- package/dist/media/io.js +131 -54
- package/dist/media/jobs.js +150 -88
- package/dist/media/mastering.js +101 -29
- package/dist/media/transcode.js +55 -21
- package/dist/media/types/analyze.js +4 -2
- package/dist/media/types/analyzeSpeech.js +4 -2
- package/dist/media/types/diagnose.js +4 -2
- package/dist/media/types/enhance.js +4 -2
- package/dist/media/types/jobResults.js +4 -2
- package/dist/media/types/jobs.js +4 -2
- package/dist/media/types/mastering.js +4 -2
- package/dist/media/types/transcode.js +4 -2
- package/dist/media/types/webhooks.js +4 -2
- package/dist/media/webhooks.js +176 -96
- package/dist/types/jwtToken.js +1 -3
- package/package.json +8 -3
- package/dist/authentication.js.map +0 -1
- package/dist/communications/authentication.js.map +0 -1
- package/dist/communications/conference.js.map +0 -1
- package/dist/communications/index.js.map +0 -1
- package/dist/communications/internal/httpHelpers.js.map +0 -1
- package/dist/communications/internal/urls.js.map +0 -1
- package/dist/communications/monitor/conferences.js.map +0 -1
- package/dist/communications/monitor/index.js.map +0 -1
- package/dist/communications/monitor/recordings.js.map +0 -1
- package/dist/communications/monitor/webhooks.js.map +0 -1
- package/dist/communications/recording.js.map +0 -1
- package/dist/communications/streaming.js.map +0 -1
- package/dist/communications/types/conference.js.map +0 -1
- package/dist/communications/types/conferences.js.map +0 -1
- package/dist/communications/types/core.js.map +0 -1
- package/dist/communications/types/participant.js.map +0 -1
- package/dist/communications/types/permission.js.map +0 -1
- package/dist/communications/types/recordings.js.map +0 -1
- package/dist/communications/types/rtcpMode.js.map +0 -1
- package/dist/communications/types/spatialAudio.js.map +0 -1
- package/dist/communications/types/videoCodec.js.map +0 -1
- package/dist/communications/types/webhooks.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/httpHelpers.js.map +0 -1
- package/dist/internal/urls.js.map +0 -1
- package/dist/internal/version.d.ts +0 -5
- package/dist/internal/version.js +0 -31
- package/dist/internal/version.js.map +0 -1
- package/dist/media/analyze.js.map +0 -1
- package/dist/media/analyzeSpeech.js.map +0 -1
- package/dist/media/diagnose.js.map +0 -1
- package/dist/media/enhance.js.map +0 -1
- package/dist/media/index.js.map +0 -1
- package/dist/media/internal/httpHelpers.js.map +0 -1
- package/dist/media/internal/jobsHelpers.js.map +0 -1
- package/dist/media/internal/urls.js.map +0 -1
- package/dist/media/io.js.map +0 -1
- package/dist/media/jobs.js.map +0 -1
- package/dist/media/mastering.js.map +0 -1
- package/dist/media/transcode.js.map +0 -1
- package/dist/media/types/analyze.js.map +0 -1
- package/dist/media/types/analyzeSpeech.js.map +0 -1
- package/dist/media/types/diagnose.js.map +0 -1
- package/dist/media/types/enhance.js.map +0 -1
- package/dist/media/types/jobResults.js.map +0 -1
- package/dist/media/types/jobs.js.map +0 -1
- package/dist/media/types/mastering.js.map +0 -1
- package/dist/media/types/transcode.js.map +0 -1
- package/dist/media/types/webhooks.js.map +0 -1
- package/dist/media/webhooks.js.map +0 -1
- package/dist/types/jwtToken.js.map +0 -1
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
var sendGet = function sendGet(options) {
|
|
85
|
+
var sendRequestOptions = _objectSpread({
|
|
86
|
+
method: 'GET'
|
|
87
|
+
}, options);
|
|
88
|
+
return sendRequest(sendRequestOptions);
|
|
89
89
|
};
|
|
90
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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;
|
package/dist/internal/urls.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.AUTH_HOSTNAME = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
var AUTH_HOSTNAME = 'api.dolby.io';
|
|
8
|
+
exports.AUTH_HOSTNAME = AUTH_HOSTNAME;
|
package/dist/media/analyze.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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;
|