@dolbyio/dolbyio-rest-apis-client 6.0.0 → 6.1.0

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/index.js CHANGED
@@ -34,4 +34,4 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
34
34
  // Expose the logger to control when/where to log
35
35
 
36
36
  /** Gets the version of this library. */
37
- var version = exports.version = "6.0.0";
37
+ var version = exports.version = "6.1.0";
@@ -8,6 +8,12 @@ exports.listAll = exports.list = exports.cancel = void 0;
8
8
  var _httpHelpers = require("./internal/httpHelpers");
9
9
  var Urls = _interopRequireWildcard(require("../urls"));
10
10
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
11
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
12
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
15
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
17
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
12
18
  function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
13
19
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
@@ -73,7 +79,7 @@ var list = exports.list = /*#__PURE__*/function () {
73
79
  */
74
80
  var listAll = exports.listAll = /*#__PURE__*/function () {
75
81
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(accessToken, options) {
76
- var params, requestOptions, result, response, index, object;
82
+ var params, requestOptions, result, response;
77
83
  return _regenerator().w(function (_context2) {
78
84
  while (1) switch (_context2.n) {
79
85
  case 0:
@@ -100,10 +106,7 @@ var listAll = exports.listAll = /*#__PURE__*/function () {
100
106
  return (0, _httpHelpers.sendGet)(requestOptions);
101
107
  case 2:
102
108
  response = _context2.v;
103
- for (index = 0; index < response.jobs.length; index++) {
104
- object = response.jobs[index];
105
- result.push(object);
106
- }
109
+ result.push.apply(result, _toConsumableArray(response.jobs));
107
110
  if (!(!response.next_token || response.next_token.length <= 0)) {
108
111
  _context2.n = 3;
109
112
  break;
@@ -12,14 +12,23 @@ export * as assets from './assets';
12
12
  export * as cluster from './cluster';
13
13
  /**
14
14
  * APIs for the Dolby OptiView cloud transcoders.
15
- * @beta
16
15
  * @remarks Cloud transcoder usage is not currently available for general usage.
17
- * If you would like to opt in, please contact our Sales team
16
+ * If you would like to opt in, please contact our Sales team.
18
17
  */
19
18
  export * as transcoders from './transcoders';
19
+ /** Access the Director APIs. */
20
20
  export * as director from './director';
21
+ /**
22
+ * Access the Dolby OptiView live monitoring APIs.
23
+ * @remarks The live monitoring APIs are not currently available for general usage.
24
+ * If you would like to opt in, please contact our Sales team.
25
+ */
26
+ export * as monitoring from './monitoring';
27
+ /** Access the Publish Token APIs. */
21
28
  export * as publishToken from './publishToken';
29
+ /** Access the Streams APIs. */
22
30
  export * as stream from './stream';
31
+ /** Access the Subscribe Token APIs. */
23
32
  export * as subscribeToken from './subscribeToken';
24
33
  /**
25
34
  * ## Webhooks
@@ -10,12 +10,13 @@ var _exportNames = {
10
10
  cluster: true,
11
11
  transcoders: true,
12
12
  director: true,
13
+ monitoring: true,
13
14
  publishToken: true,
14
15
  stream: true,
15
16
  subscribeToken: true,
16
17
  webhooks: true
17
18
  };
18
- exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.publishToken = exports.director = exports.cluster = exports.assets = exports.account = void 0;
19
+ exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.publishToken = exports.monitoring = exports.director = exports.cluster = exports.assets = exports.account = void 0;
19
20
  var _types = require("./types");
20
21
  Object.keys(_types).forEach(function (key) {
21
22
  if (key === "default" || key === "__esModule") return;
@@ -38,6 +39,8 @@ var _transcoders = _interopRequireWildcard(require("./transcoders"));
38
39
  exports.transcoders = _transcoders;
39
40
  var _director = _interopRequireWildcard(require("./director"));
40
41
  exports.director = _director;
42
+ var _monitoring = _interopRequireWildcard(require("./monitoring"));
43
+ exports.monitoring = _monitoring;
41
44
  var _publishToken = _interopRequireWildcard(require("./publishToken"));
42
45
  exports.publishToken = _publishToken;
43
46
  var _stream = _interopRequireWildcard(require("./stream"));
@@ -0,0 +1,44 @@
1
+ import { GetStreamDetailsOptions, ListAllStreamsSortOptions, ListStreamsResponse, ListStreamsSortOptions, StreamDetails } from './types/monitoring';
2
+ /**
3
+ * ## List Streams
4
+ *
5
+ * List all streams created within last hour with specific sorting and pagination.
6
+ * If the transcoderId is provided, all streams associated with the current or last active instance will be returned,
7
+ * regardless of the stream creation time. If response array is empty, you have reached the end of the list ordering.
8
+ *
9
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/monitoring-list-recent-streams/}
10
+ *
11
+ * @param apiSecret The API Secret used to authenticate this request.
12
+ * @param options Options to sort the response.
13
+ *
14
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link ListStreamsResponse} object.
15
+ */
16
+ export declare const listStreams: (apiSecret: string, options: ListStreamsSortOptions) => Promise<ListStreamsResponse>;
17
+ /**
18
+ * ## List all Streams
19
+ *
20
+ * List all streams created within last hour with specific sorting and pagination.
21
+ * If the transcoderId is provided, all streams associated with the current or last active instance will be returned,
22
+ * regardless of the stream creation time. If response array is empty, you have reached the end of the list ordering.
23
+ *
24
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/monitoring-list-recent-streams/}
25
+ *
26
+ * @param apiSecret The API Secret used to authenticate this request.
27
+ * @param options Options to sort the response.
28
+ *
29
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link StreamDetails} object.
30
+ */
31
+ export declare const listAllStreams: (apiSecret: string, options: ListAllStreamsSortOptions) => Promise<StreamDetails[]>;
32
+ /**
33
+ * ## Stream Details
34
+ *
35
+ * Get stream details by stream name.
36
+ *
37
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/monitoring-get-stream/}
38
+ *
39
+ * @param apiSecret The API Secret used to authenticate this request.
40
+ * @param options Options to sort the response.
41
+ *
42
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link PublishToken} objects.
43
+ */
44
+ export declare const streamDetails: (apiSecret: string, options: GetStreamDetailsOptions) => Promise<StreamDetails>;
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.streamDetails = exports.listStreams = exports.listAllStreams = void 0;
8
+ var _httpHelpers = require("./internal/httpHelpers");
9
+ var Urls = _interopRequireWildcard(require("../urls"));
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
11
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
12
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
15
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
21
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
23
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
24
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
25
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
26
+ /**
27
+ * ## List Streams
28
+ *
29
+ * List all streams created within last hour with specific sorting and pagination.
30
+ * If the transcoderId is provided, all streams associated with the current or last active instance will be returned,
31
+ * regardless of the stream creation time. If response array is empty, you have reached the end of the list ordering.
32
+ *
33
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/monitoring-list-recent-streams/}
34
+ *
35
+ * @param apiSecret The API Secret used to authenticate this request.
36
+ * @param options Options to sort the response.
37
+ *
38
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link ListStreamsResponse} object.
39
+ */
40
+ var listStreams = exports.listStreams = /*#__PURE__*/function () {
41
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(apiSecret, options) {
42
+ var _options$sortBy, _options$page, _options$itemsOnPage, _options$isDescending;
43
+ var params, queryOptions;
44
+ return _regenerator().w(function (_context) {
45
+ while (1) switch (_context.n) {
46
+ case 0:
47
+ params = {
48
+ sortBy: (_options$sortBy = options.sortBy) !== null && _options$sortBy !== void 0 ? _options$sortBy : 'Live',
49
+ page: ((_options$page = options.page) !== null && _options$page !== void 0 ? _options$page : 1).toString(),
50
+ itemsOnPage: ((_options$itemsOnPage = options.itemsOnPage) !== null && _options$itemsOnPage !== void 0 ? _options$itemsOnPage : 10).toString(),
51
+ isDescending: ((_options$isDescending = options.isDescending) !== null && _options$isDescending !== void 0 ? _options$isDescending : false).toString()
52
+ };
53
+ if (options.isActive) {
54
+ params['isActive'] = options.isActive;
55
+ }
56
+ if (options.cluster) {
57
+ params['cluster'] = options.cluster.join(',');
58
+ }
59
+ if (options.isSecure) {
60
+ params['isSecure'] = options.isSecure;
61
+ }
62
+ if (options.isMultisource) {
63
+ params['isMultisource'] = options.isMultisource;
64
+ }
65
+ if (options.hasRedundant) {
66
+ params['hasRedundant'] = options.hasRedundant;
67
+ }
68
+ if (options.searchSubstring) {
69
+ params['searchSubstring'] = options.searchSubstring;
70
+ }
71
+ if (options.isRecordingAllowed) {
72
+ params['isRecordingAllowed'] = options.isRecordingAllowed;
73
+ }
74
+ if (options.isRestreaming) {
75
+ params['isRestreaming'] = options.isRestreaming;
76
+ }
77
+ if (options.transcoderId) {
78
+ params['transcoderId'] = options.transcoderId;
79
+ }
80
+ queryOptions = {
81
+ hostname: Urls.getRtsHostname(),
82
+ path: '/api/monitoring/streams',
83
+ params: params,
84
+ headers: {
85
+ Accept: 'application/json',
86
+ Authorization: "Bearer ".concat(apiSecret)
87
+ }
88
+ };
89
+ _context.n = 1;
90
+ return (0, _httpHelpers.sendGet)(queryOptions);
91
+ case 1:
92
+ return _context.a(2, _context.v);
93
+ }
94
+ }, _callee);
95
+ }));
96
+ return function listStreams(_x, _x2) {
97
+ return _ref.apply(this, arguments);
98
+ };
99
+ }();
100
+
101
+ /**
102
+ * ## List all Streams
103
+ *
104
+ * List all streams created within last hour with specific sorting and pagination.
105
+ * If the transcoderId is provided, all streams associated with the current or last active instance will be returned,
106
+ * regardless of the stream creation time. If response array is empty, you have reached the end of the list ordering.
107
+ *
108
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/monitoring-list-recent-streams/}
109
+ *
110
+ * @param apiSecret The API Secret used to authenticate this request.
111
+ * @param options Options to sort the response.
112
+ *
113
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link StreamDetails} object.
114
+ */
115
+ var listAllStreams = exports.listAllStreams = /*#__PURE__*/function () {
116
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(apiSecret, options) {
117
+ var result, page, listOptions, response;
118
+ return _regenerator().w(function (_context2) {
119
+ while (1) switch (_context2.n) {
120
+ case 0:
121
+ result = [];
122
+ page = 1;
123
+ case 1:
124
+ listOptions = _objectSpread(_objectSpread({}, options), {}, {
125
+ page: page,
126
+ itemsOnPage: 25
127
+ });
128
+ _context2.n = 2;
129
+ return listStreams(apiSecret, listOptions);
130
+ case 2:
131
+ response = _context2.v;
132
+ if (!(response.data.length === 0)) {
133
+ _context2.n = 3;
134
+ break;
135
+ }
136
+ return _context2.a(3, 5);
137
+ case 3:
138
+ result.push.apply(result, _toConsumableArray(response.data));
139
+ page++;
140
+ case 4:
141
+ if (true) {
142
+ _context2.n = 1;
143
+ break;
144
+ }
145
+ case 5:
146
+ return _context2.a(2, result);
147
+ }
148
+ }, _callee2);
149
+ }));
150
+ return function listAllStreams(_x3, _x4) {
151
+ return _ref2.apply(this, arguments);
152
+ };
153
+ }();
154
+
155
+ /**
156
+ * ## Stream Details
157
+ *
158
+ * Get stream details by stream name.
159
+ *
160
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/monitoring-get-stream/}
161
+ *
162
+ * @param apiSecret The API Secret used to authenticate this request.
163
+ * @param options Options to sort the response.
164
+ *
165
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link PublishToken} objects.
166
+ */
167
+ var streamDetails = exports.streamDetails = /*#__PURE__*/function () {
168
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(apiSecret, options) {
169
+ var queryOptions;
170
+ return _regenerator().w(function (_context3) {
171
+ while (1) switch (_context3.n) {
172
+ case 0:
173
+ queryOptions = {
174
+ hostname: Urls.getRtsHostname(),
175
+ path: "/api/monitoring/streams/".concat(options.streamName),
176
+ headers: {
177
+ Accept: 'application/json',
178
+ Authorization: "Bearer ".concat(apiSecret)
179
+ }
180
+ };
181
+ _context3.n = 1;
182
+ return (0, _httpHelpers.sendGet)(queryOptions);
183
+ case 1:
184
+ return _context3.a(2, _context3.v);
185
+ }
186
+ }, _callee3);
187
+ }));
188
+ return function streamDetails(_x5, _x6) {
189
+ return _ref3.apply(this, arguments);
190
+ };
191
+ }();
@@ -2,6 +2,7 @@ export * from './account';
2
2
  export * from './asset';
3
3
  export * from './cluster';
4
4
  export * from './director';
5
+ export * from './monitoring';
5
6
  export * from './publishToken';
6
7
  export * from './stream';
7
8
  export * from './subscribeToken';
@@ -47,6 +47,17 @@ Object.keys(_director).forEach(function (key) {
47
47
  }
48
48
  });
49
49
  });
50
+ var _monitoring = require("./monitoring");
51
+ Object.keys(_monitoring).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _monitoring[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _monitoring[key];
58
+ }
59
+ });
60
+ });
50
61
  var _publishToken = require("./publishToken");
51
62
  Object.keys(_publishToken).forEach(function (key) {
52
63
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,202 @@
1
+ import { ListSortOptions } from './core';
2
+ export interface ListStreamsResponse {
3
+ /** Pagination object. */
4
+ pagination?: {
5
+ /** Total number of items. */
6
+ totalItems: number;
7
+ /** Total number of pages. */
8
+ totalPages: number;
9
+ /** Number of items in that page. */
10
+ itemsOnPage: number;
11
+ };
12
+ /** Array of stream details. */
13
+ data: StreamDetails[];
14
+ }
15
+ /** Represents a stream details. */
16
+ export interface StreamDetails {
17
+ /** Identifier of the stream. */
18
+ streamId: string;
19
+ /** Name of the stream. */
20
+ streamName: string;
21
+ /** Identifier of the cluster. */
22
+ clusterId: string;
23
+ /** List of clusters. */
24
+ clusters: string[];
25
+ /** Secure stream. */
26
+ secureStream: boolean;
27
+ /** Is recording allowed for this stream. */
28
+ isRecordingAllowed: boolean;
29
+ /** Is multisource enabled. */
30
+ multisource: boolean;
31
+ /** Is the stream live. */
32
+ live: boolean;
33
+ /** Stream publishing start time. */
34
+ startTime: string;
35
+ /** Stream publishing end time. */
36
+ endTime: string;
37
+ /** Viewer count. */
38
+ viewerCount: number;
39
+ /** Has redundant stream. */
40
+ hasRedundant: boolean;
41
+ /** Restreaming enabled. */
42
+ restreaming: boolean;
43
+ /** Feeds. */
44
+ feeds: {
45
+ /** Identifier of the stream. */
46
+ streamId: string;
47
+ /** Identifier of the feed. */
48
+ feedId: string;
49
+ /** Identifier of the cluster. */
50
+ clusterId: string;
51
+ /** Identifier of the source. */
52
+ sourceId: string;
53
+ /** Simulcast ID. */
54
+ simulcastId: string;
55
+ /** Server ID. */
56
+ serverId: string;
57
+ /** Is the feed active. */
58
+ active: boolean;
59
+ /** Stream publishing start time. */
60
+ startTime: string;
61
+ /** Stream publishing end time. */
62
+ endTime?: string;
63
+ /** Is recording allowed for this stream. */
64
+ isRecordingAllowed: boolean;
65
+ /** Packet loss percentage over last five minutes. */
66
+ packetLoss: number;
67
+ /** Is the feed redundant. */
68
+ isRedundant?: boolean;
69
+ /** Feed priority. */
70
+ priority?: number;
71
+ /** Framerate. */
72
+ frameRate: number;
73
+ /** Feed type. */
74
+ type: string;
75
+ /** Identifier of the token. */
76
+ tokenId: number;
77
+ /** Client. */
78
+ client: {
79
+ /** Country. */
80
+ country: string;
81
+ /** City. */
82
+ city: string;
83
+ /** Continent. */
84
+ continent: string;
85
+ /** coordinates. */
86
+ coordinates: number[];
87
+ /** Sub. */
88
+ sub: string[];
89
+ /** IP Address. */
90
+ ip: string;
91
+ };
92
+ /** Restream information. */
93
+ restreams: Restream[];
94
+ /** Feed statistics. */
95
+ feedStats: FeedStats[];
96
+ /** Details for all tracks. */
97
+ trackDetails: {
98
+ /** Idenitfier of the track. */
99
+ trackId: string;
100
+ /** Encoding details. */
101
+ encodingDetails: {
102
+ /** Encoding ID. */
103
+ encodingId: string;
104
+ /** I-frame rate. */
105
+ iFrameRate: number;
106
+ /** B-frame rate. */
107
+ bFrameRate: number;
108
+ /** P-frame rate. */
109
+ pFrameRate: number;
110
+ /** Encoding statistics. */
111
+ encodingStats: {
112
+ /** Timestamp of the entry. */
113
+ timestamp: string;
114
+ /** Timestamp of the entry. */
115
+ resolution: {
116
+ /** Height of the frame. */
117
+ height: number;
118
+ /** Width of the frame. */
119
+ width: number;
120
+ };
121
+ /** Bitrate. */
122
+ bitRate: {
123
+ /** Audio bitrate. */
124
+ audioBitrate: number;
125
+ /** Video bitrate. */
126
+ videoBitrate: number;
127
+ };
128
+ /** Video codec. */
129
+ videoCodec: number;
130
+ /** Audio codec. */
131
+ audioCodec: number;
132
+ /** Frames. */
133
+ frames?: number;
134
+ /** RTT. */
135
+ rtt?: number;
136
+ /** Buffer Time. */
137
+ bufferTime?: number;
138
+ /** B-frames. */
139
+ bFrames?: number;
140
+ }[];
141
+ }[];
142
+ }[];
143
+ }[];
144
+ }
145
+ /** Represents the restream information. */
146
+ export interface Restream {
147
+ /** Name of the restream. */
148
+ label: string;
149
+ /** Index of the restream. */
150
+ index: number;
151
+ /** URL of the restream. */
152
+ url: string;
153
+ /** Is the restream active. */
154
+ active: boolean;
155
+ /** List of events. */
156
+ events: {
157
+ /** Start time of the event. */
158
+ started: string;
159
+ /** End time of the event. */
160
+ ended?: string;
161
+ /** Error message. */
162
+ error: string;
163
+ }[];
164
+ }
165
+ /** Represents the feed statistics. */
166
+ export interface FeedStats {
167
+ /** Timestamp of the feed stats. */
168
+ timestamp: string;
169
+ /** Packet loss percentage over last five seconds. */
170
+ packetLoss: number;
171
+ }
172
+ /** Represents the options to sort the response for listing all the streams. */
173
+ export interface ListAllStreamsSortOptions {
174
+ /** How to sort the response. */
175
+ sortBy: 'Live';
176
+ /** Active streams. */
177
+ isActive?: boolean;
178
+ /** Filter the list of clusters. */
179
+ cluster?: string[];
180
+ /** Secure streams. */
181
+ isSecure?: boolean;
182
+ /** Multi source streams. */
183
+ isMultisource?: boolean;
184
+ /** Redundant streams. */
185
+ hasRedundant?: boolean;
186
+ /** Filter the stream names. */
187
+ searchSubstring?: string;
188
+ /** Recorded allowed. */
189
+ isRecordingAllowed?: boolean;
190
+ /** Restreaming streams. */
191
+ isRestreaming?: boolean;
192
+ /** Identifier of the transcoder. */
193
+ transcoderId?: string;
194
+ }
195
+ /** Represents the options to sort the response for listing streams. */
196
+ export interface ListStreamsSortOptions extends ListAllStreamsSortOptions, ListSortOptions<'Live'> {
197
+ }
198
+ /** Represents the options to query the stream details. */
199
+ export interface GetStreamDetailsOptions {
200
+ /** Name of the stream to query. */
201
+ streamName: string;
202
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolbyio/dolbyio-rest-apis-client",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Node.JS wrapper for the Dolby OptiView REST APIs",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -40,17 +40,17 @@
40
40
  }
41
41
  },
42
42
  "devDependencies": {
43
- "@babel/cli": "^7.28.3",
44
- "@babel/core": "^7.28.3",
45
- "@babel/preset-env": "^7.28.3",
43
+ "@babel/cli": "^7.28.6",
44
+ "@babel/core": "^7.29.0",
45
+ "@babel/preset-env": "^7.29.0",
46
46
  "@babel/preset-typescript": "^7.28.5",
47
47
  "@types/follow-redirects": "^1.14.4",
48
- "@types/node": "^24.10.0",
48
+ "@types/node": "^25.3.0",
49
49
  "babel-plugin-inline-replace-variables": "^1.3.1",
50
50
  "npm-watch": "^0.13.0",
51
- "prettier": "^3.6.2",
52
- "typedoc": "^0.28.14",
53
- "typedoc-plugin-mdn-links": "^5.0.10",
51
+ "prettier": "^3.8.1",
52
+ "typedoc": "^0.28.17",
53
+ "typedoc-plugin-mdn-links": "^5.1.1",
54
54
  "typescript": "^5.9.3"
55
55
  },
56
56
  "dependencies": {