@dolbyio/dolbyio-rest-apis-client 6.0.0 → 6.2.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.2.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;
@@ -8,18 +8,33 @@ export * as account from './account';
8
8
  * Read about {@link https://optiview.dolby.com/docs/millicast/distribution/stream-recordings/ | Stream Recordings} in the documentation.
9
9
  */
10
10
  export * as assets from './assets';
11
+ /**
12
+ * ## Media Distributions
13
+ *
14
+ * APIs to manage the media distributions.
15
+ */
16
+ export * as mediaDistributions from './mediaDistributions';
11
17
  /** APIs to update the default and list the Dolby OptiView clusters of the account. */
12
18
  export * as cluster from './cluster';
13
19
  /**
14
20
  * APIs for the Dolby OptiView cloud transcoders.
15
- * @beta
16
21
  * @remarks Cloud transcoder usage is not currently available for general usage.
17
- * If you would like to opt in, please contact our Sales team
22
+ * If you would like to opt in, please contact our Sales team.
18
23
  */
19
24
  export * as transcoders from './transcoders';
25
+ /** Access the Director APIs. */
20
26
  export * as director from './director';
27
+ /**
28
+ * Access the Dolby OptiView live monitoring APIs.
29
+ * @remarks The live monitoring APIs are not currently available for general usage.
30
+ * If you would like to opt in, please contact our Sales team.
31
+ */
32
+ export * as monitoring from './monitoring';
33
+ /** Access the Publish Token APIs. */
21
34
  export * as publishToken from './publishToken';
35
+ /** Access the Streams APIs. */
22
36
  export * as stream from './stream';
37
+ /** Access the Subscribe Token APIs. */
23
38
  export * as subscribeToken from './subscribeToken';
24
39
  /**
25
40
  * ## Webhooks
@@ -7,15 +7,17 @@ Object.defineProperty(exports, "__esModule", {
7
7
  var _exportNames = {
8
8
  account: true,
9
9
  assets: true,
10
+ mediaDistributions: true,
10
11
  cluster: true,
11
12
  transcoders: true,
12
13
  director: true,
14
+ monitoring: true,
13
15
  publishToken: true,
14
16
  stream: true,
15
17
  subscribeToken: true,
16
18
  webhooks: true
17
19
  };
18
- exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.publishToken = exports.director = exports.cluster = exports.assets = exports.account = void 0;
20
+ exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.publishToken = exports.monitoring = exports.mediaDistributions = exports.director = exports.cluster = exports.assets = exports.account = void 0;
19
21
  var _types = require("./types");
20
22
  Object.keys(_types).forEach(function (key) {
21
23
  if (key === "default" || key === "__esModule") return;
@@ -32,12 +34,16 @@ var _account = _interopRequireWildcard(require("./account"));
32
34
  exports.account = _account;
33
35
  var _assets = _interopRequireWildcard(require("./assets"));
34
36
  exports.assets = _assets;
37
+ var _mediaDistributions = _interopRequireWildcard(require("./mediaDistributions"));
38
+ exports.mediaDistributions = _mediaDistributions;
35
39
  var _cluster = _interopRequireWildcard(require("./cluster"));
36
40
  exports.cluster = _cluster;
37
41
  var _transcoders = _interopRequireWildcard(require("./transcoders"));
38
42
  exports.transcoders = _transcoders;
39
43
  var _director = _interopRequireWildcard(require("./director"));
40
44
  exports.director = _director;
45
+ var _monitoring = _interopRequireWildcard(require("./monitoring"));
46
+ exports.monitoring = _monitoring;
41
47
  var _publishToken = _interopRequireWildcard(require("./publishToken"));
42
48
  exports.publishToken = _publishToken;
43
49
  var _stream = _interopRequireWildcard(require("./stream"));
@@ -0,0 +1,112 @@
1
+ import { CreateMediaDistributionRequest, UpdateMediaDistributionRequest, MediaDistribution, ListMediaDistributionsQueryParams, ListMediaDistributionsResponse, SecurityKey, CreaseSecurityKeyRequest } from './types/mediaDistributions';
2
+ /**
3
+ * ## Creates Media Distribution
4
+ *
5
+ * Creates a new media distribution for viewing HLS media assets.
6
+ *
7
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-create-media-distribution/}
8
+ *
9
+ * @param apiSecret The API Secret used to authenticate this request.
10
+ * @param createRequest The request body for creating a new media asset.
11
+ *
12
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
13
+ */
14
+ export declare const create: (apiSecret: string, createRequest: CreateMediaDistributionRequest) => Promise<MediaDistribution>;
15
+ /**
16
+ * ## Lists Media Distribution
17
+ *
18
+ * List all media distributions with specific sorting and pagination.
19
+ *
20
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-list-media-distribution/}
21
+ *
22
+ * @param apiSecret The API Secret used to authenticate this request.
23
+ * @param params Query parameters for filtering the list of media distributions.
24
+ *
25
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link ListMediaDistributionsResponse} objects.
26
+ */
27
+ export declare const list: (apiSecret: string, params: ListMediaDistributionsQueryParams) => Promise<ListMediaDistributionsResponse[]>;
28
+ /**
29
+ * ## Reads Media Distribution
30
+ *
31
+ * Gets media distribution specified by `mediaDistributionId`.
32
+ *
33
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-read-media-distribution/}
34
+ *
35
+ * @param apiSecret The API Secret used to authenticate this request.
36
+ * @param mediaDistributionId The ID of the media distribution to read.
37
+ *
38
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
39
+ */
40
+ export declare const read: (apiSecret: string, mediaDistributionId: string) => Promise<MediaDistribution>;
41
+ /**
42
+ * ## Deletes Media Distribution
43
+ *
44
+ * Deletes media distribution specified by a `mediaDistributionId`.
45
+ *
46
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-delete-media-distribution/}
47
+ *
48
+ * @param apiSecret The API Secret used to authenticate this request.
49
+ * @param mediaDistributionId The ID of the media distribution to delete.
50
+ *
51
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of asset deletion tasks that failed.
52
+ */
53
+ export declare const deleteMediaDistribution: (apiSecret: string, mediaDistributionId: string) => Promise<{
54
+ id?: string;
55
+ error?: string;
56
+ }[]>;
57
+ /**
58
+ * ## Updates Media Asset
59
+ *
60
+ * Update media asset settings.
61
+ *
62
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-update-media-distribution/}
63
+ *
64
+ * @param apiSecret The API Secret used to authenticate this request.
65
+ * @param updateRequest The request body for creating a new media asset.
66
+ *
67
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
68
+ */
69
+ export declare const updateMediaDistribution: (apiSecret: string, updateRequest: UpdateMediaDistributionRequest) => Promise<MediaDistribution>;
70
+ /**
71
+ * ## Gets all security keys of a media distribution by ID
72
+ *
73
+ * Get all security keys of a media distribution by ID.
74
+ *
75
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-get-security-keys/}
76
+ *
77
+ * @param apiSecret The API Secret used to authenticate this request.
78
+ * @param mediaDistributionId The ID of the media distribution to get the security keys from.
79
+ *
80
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
81
+ */
82
+ export declare const getSecurityKey: (apiSecret: string, mediaDistributionId: string) => Promise<SecurityKey[]>;
83
+ /**
84
+ * ## Creates a Security Key
85
+ *
86
+ * Creates a new security key for a media distribution. Each media distribution may have up to 2 security keys.
87
+ *
88
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-create-security-key/}
89
+ *
90
+ * @param apiSecret The API Secret used to authenticate this request.
91
+ * @param createRequest The request body for creating a new security key.
92
+ *
93
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
94
+ */
95
+ export declare const createSecurityKey: (apiSecret: string, createRequest: CreaseSecurityKeyRequest) => Promise<SecurityKey>;
96
+ /**
97
+ * ## Deletes Media Distribution Security Key
98
+ *
99
+ * Deletes a media distribution security key.
100
+ *
101
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-delete-security-key/}
102
+ *
103
+ * @param apiSecret The API Secret used to authenticate this request.
104
+ * @param mediaDistributionId The ID of the media distribution to get the key from.
105
+ * @param securityKeyId The ID of the security key to delete.
106
+ *
107
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of asset deletion tasks that failed.
108
+ */
109
+ export declare const deleteSecurityKey: (apiSecret: string, mediaDistributionId: string, securityKeyId: string) => Promise<{
110
+ status?: string;
111
+ message?: string;
112
+ }[]>;
@@ -0,0 +1,337 @@
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.updateMediaDistribution = exports.read = exports.list = exports.getSecurityKey = exports.deleteSecurityKey = exports.deleteMediaDistribution = exports.createSecurityKey = exports.create = void 0;
8
+ var Urls = _interopRequireWildcard(require("../urls"));
9
+ var _httpHelpers = require("./internal/httpHelpers");
10
+ var _stringHelpers = require("./internal/stringHelpers");
11
+ 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); }
12
+ 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 }; })(); }
13
+ 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); }
14
+ 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); }
15
+ 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); }); }; }
16
+ /**
17
+ * ## Creates Media Distribution
18
+ *
19
+ * Creates a new media distribution for viewing HLS media assets.
20
+ *
21
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-create-media-distribution/}
22
+ *
23
+ * @param apiSecret The API Secret used to authenticate this request.
24
+ * @param createRequest The request body for creating a new media asset.
25
+ *
26
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
27
+ */
28
+ var create = exports.create = /*#__PURE__*/function () {
29
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(apiSecret, createRequest) {
30
+ var options;
31
+ return _regenerator().w(function (_context) {
32
+ while (1) switch (_context.n) {
33
+ case 0:
34
+ options = {
35
+ hostname: Urls.getRtsHostname(),
36
+ path: '/api/v3/media/distributions',
37
+ headers: {
38
+ Accept: 'application/json',
39
+ 'Content-Type': 'application/json',
40
+ Authorization: "Bearer ".concat(apiSecret)
41
+ },
42
+ body: JSON.stringify(createRequest)
43
+ };
44
+ _context.n = 1;
45
+ return (0, _httpHelpers.sendPost)(options);
46
+ case 1:
47
+ return _context.a(2, _context.v);
48
+ }
49
+ }, _callee);
50
+ }));
51
+ return function create(_x, _x2) {
52
+ return _ref.apply(this, arguments);
53
+ };
54
+ }();
55
+
56
+ /**
57
+ * ## Lists Media Distribution
58
+ *
59
+ * List all media distributions with specific sorting and pagination.
60
+ *
61
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-list-media-distribution/}
62
+ *
63
+ * @param apiSecret The API Secret used to authenticate this request.
64
+ * @param params Query parameters for filtering the list of media distributions.
65
+ *
66
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link ListMediaDistributionsResponse} objects.
67
+ */
68
+ var list = exports.list = /*#__PURE__*/function () {
69
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(apiSecret, params) {
70
+ var options;
71
+ return _regenerator().w(function (_context2) {
72
+ while (1) switch (_context2.n) {
73
+ case 0:
74
+ options = {
75
+ hostname: Urls.getRtsHostname(),
76
+ path: '/api/v3/media/distributions',
77
+ headers: {
78
+ Accept: 'application/json',
79
+ 'Content-Type': 'application/json',
80
+ Authorization: "Bearer ".concat(apiSecret)
81
+ },
82
+ params: (0, _stringHelpers.toDictString)(params)
83
+ };
84
+ _context2.n = 1;
85
+ return (0, _httpHelpers.sendGet)(options);
86
+ case 1:
87
+ return _context2.a(2, _context2.v);
88
+ }
89
+ }, _callee2);
90
+ }));
91
+ return function list(_x3, _x4) {
92
+ return _ref2.apply(this, arguments);
93
+ };
94
+ }();
95
+
96
+ /**
97
+ * ## Reads Media Distribution
98
+ *
99
+ * Gets media distribution specified by `mediaDistributionId`.
100
+ *
101
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-read-media-distribution/}
102
+ *
103
+ * @param apiSecret The API Secret used to authenticate this request.
104
+ * @param mediaDistributionId The ID of the media distribution to read.
105
+ *
106
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
107
+ */
108
+ var read = exports.read = /*#__PURE__*/function () {
109
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(apiSecret, mediaDistributionId) {
110
+ var options;
111
+ return _regenerator().w(function (_context3) {
112
+ while (1) switch (_context3.n) {
113
+ case 0:
114
+ options = {
115
+ hostname: Urls.getRtsHostname(),
116
+ path: "/api/v3/media/distributions/".concat(mediaDistributionId),
117
+ headers: {
118
+ Accept: 'application/json',
119
+ Authorization: "Bearer ".concat(apiSecret)
120
+ }
121
+ };
122
+ _context3.n = 1;
123
+ return (0, _httpHelpers.sendGet)(options);
124
+ case 1:
125
+ return _context3.a(2, _context3.v);
126
+ }
127
+ }, _callee3);
128
+ }));
129
+ return function read(_x5, _x6) {
130
+ return _ref3.apply(this, arguments);
131
+ };
132
+ }();
133
+
134
+ /**
135
+ * ## Deletes Media Distribution
136
+ *
137
+ * Deletes media distribution specified by a `mediaDistributionId`.
138
+ *
139
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-delete-media-distribution/}
140
+ *
141
+ * @param apiSecret The API Secret used to authenticate this request.
142
+ * @param mediaDistributionId The ID of the media distribution to delete.
143
+ *
144
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of asset deletion tasks that failed.
145
+ */
146
+ var deleteMediaDistribution = exports.deleteMediaDistribution = /*#__PURE__*/function () {
147
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(apiSecret, mediaDistributionId) {
148
+ var options;
149
+ return _regenerator().w(function (_context4) {
150
+ while (1) switch (_context4.n) {
151
+ case 0:
152
+ options = {
153
+ hostname: Urls.getRtsHostname(),
154
+ path: "/api/v3/media/distributions/".concat(mediaDistributionId),
155
+ headers: {
156
+ Accept: 'application/json',
157
+ 'Content-Type': 'application/json',
158
+ Authorization: "Bearer ".concat(apiSecret)
159
+ }
160
+ };
161
+ _context4.n = 1;
162
+ return (0, _httpHelpers.sendDelete)(options);
163
+ case 1:
164
+ return _context4.a(2, _context4.v);
165
+ }
166
+ }, _callee4);
167
+ }));
168
+ return function deleteMediaDistribution(_x7, _x8) {
169
+ return _ref4.apply(this, arguments);
170
+ };
171
+ }();
172
+
173
+ /**
174
+ * ## Updates Media Asset
175
+ *
176
+ * Update media asset settings.
177
+ *
178
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-update-media-distribution/}
179
+ *
180
+ * @param apiSecret The API Secret used to authenticate this request.
181
+ * @param updateRequest The request body for creating a new media asset.
182
+ *
183
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
184
+ */
185
+ var updateMediaDistribution = exports.updateMediaDistribution = /*#__PURE__*/function () {
186
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(apiSecret, updateRequest) {
187
+ var body, options;
188
+ return _regenerator().w(function (_context5) {
189
+ while (1) switch (_context5.n) {
190
+ case 0:
191
+ body = {
192
+ name: updateRequest.name,
193
+ "default": updateRequest["default"]
194
+ };
195
+ options = {
196
+ hostname: Urls.getRtsHostname(),
197
+ path: "/api/v3/media/distributions/".concat(updateRequest.id),
198
+ headers: {
199
+ Accept: 'application/json',
200
+ 'Content-Type': 'application/json',
201
+ Authorization: "Bearer ".concat(apiSecret)
202
+ },
203
+ body: JSON.stringify(body)
204
+ };
205
+ _context5.n = 1;
206
+ return (0, _httpHelpers.sendPatch)(options);
207
+ case 1:
208
+ return _context5.a(2, _context5.v);
209
+ }
210
+ }, _callee5);
211
+ }));
212
+ return function updateMediaDistribution(_x9, _x0) {
213
+ return _ref5.apply(this, arguments);
214
+ };
215
+ }();
216
+
217
+ /**
218
+ * ## Gets all security keys of a media distribution by ID
219
+ *
220
+ * Get all security keys of a media distribution by ID.
221
+ *
222
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-get-security-keys/}
223
+ *
224
+ * @param apiSecret The API Secret used to authenticate this request.
225
+ * @param mediaDistributionId The ID of the media distribution to get the security keys from.
226
+ *
227
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
228
+ */
229
+ var getSecurityKey = exports.getSecurityKey = /*#__PURE__*/function () {
230
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(apiSecret, mediaDistributionId) {
231
+ var options;
232
+ return _regenerator().w(function (_context6) {
233
+ while (1) switch (_context6.n) {
234
+ case 0:
235
+ options = {
236
+ hostname: Urls.getRtsHostname(),
237
+ path: "/api/v3/media/distributions/".concat(mediaDistributionId, "/security/keys"),
238
+ headers: {
239
+ Accept: 'application/json',
240
+ Authorization: "Bearer ".concat(apiSecret)
241
+ }
242
+ };
243
+ _context6.n = 1;
244
+ return (0, _httpHelpers.sendGet)(options);
245
+ case 1:
246
+ return _context6.a(2, _context6.v);
247
+ }
248
+ }, _callee6);
249
+ }));
250
+ return function getSecurityKey(_x1, _x10) {
251
+ return _ref6.apply(this, arguments);
252
+ };
253
+ }();
254
+
255
+ /**
256
+ * ## Creates a Security Key
257
+ *
258
+ * Creates a new security key for a media distribution. Each media distribution may have up to 2 security keys.
259
+ *
260
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-create-security-key/}
261
+ *
262
+ * @param apiSecret The API Secret used to authenticate this request.
263
+ * @param createRequest The request body for creating a new security key.
264
+ *
265
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link MediaDistribution} object.
266
+ */
267
+ var createSecurityKey = exports.createSecurityKey = /*#__PURE__*/function () {
268
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(apiSecret, createRequest) {
269
+ var body, options;
270
+ return _regenerator().w(function (_context7) {
271
+ while (1) switch (_context7.n) {
272
+ case 0:
273
+ body = {
274
+ name: createRequest.name,
275
+ key: createRequest.key
276
+ };
277
+ options = {
278
+ hostname: Urls.getRtsHostname(),
279
+ path: "/api/v3/media/distributions/".concat(createRequest.mediaDistributionId, "/security/keys"),
280
+ headers: {
281
+ Accept: 'application/json',
282
+ 'Content-Type': 'application/json',
283
+ Authorization: "Bearer ".concat(apiSecret)
284
+ },
285
+ body: JSON.stringify(body)
286
+ };
287
+ _context7.n = 1;
288
+ return (0, _httpHelpers.sendPost)(options);
289
+ case 1:
290
+ return _context7.a(2, _context7.v);
291
+ }
292
+ }, _callee7);
293
+ }));
294
+ return function createSecurityKey(_x11, _x12) {
295
+ return _ref7.apply(this, arguments);
296
+ };
297
+ }();
298
+
299
+ /**
300
+ * ## Deletes Media Distribution Security Key
301
+ *
302
+ * Deletes a media distribution security key.
303
+ *
304
+ * @see {@link https://optiview.dolby.com/docs/millicast/api/media-distributions-delete-security-key/}
305
+ *
306
+ * @param apiSecret The API Secret used to authenticate this request.
307
+ * @param mediaDistributionId The ID of the media distribution to get the key from.
308
+ * @param securityKeyId The ID of the security key to delete.
309
+ *
310
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of asset deletion tasks that failed.
311
+ */
312
+ var deleteSecurityKey = exports.deleteSecurityKey = /*#__PURE__*/function () {
313
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(apiSecret, mediaDistributionId, securityKeyId) {
314
+ var options;
315
+ return _regenerator().w(function (_context8) {
316
+ while (1) switch (_context8.n) {
317
+ case 0:
318
+ options = {
319
+ hostname: Urls.getRtsHostname(),
320
+ path: "/api/v3/media/distributions/".concat(mediaDistributionId, "/security/keys/").concat(securityKeyId),
321
+ headers: {
322
+ Accept: 'application/json',
323
+ 'Content-Type': 'application/json',
324
+ Authorization: "Bearer ".concat(apiSecret)
325
+ }
326
+ };
327
+ _context8.n = 1;
328
+ return (0, _httpHelpers.sendDelete)(options);
329
+ case 1:
330
+ return _context8.a(2, _context8.v);
331
+ }
332
+ }, _callee8);
333
+ }));
334
+ return function deleteSecurityKey(_x13, _x14, _x15) {
335
+ return _ref8.apply(this, arguments);
336
+ };
337
+ }();
@@ -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,112 @@
1
+ /**
2
+ * The allowable parameters for requesting the creation of a media distribution.
3
+ */
4
+ export interface CreateMediaDistributionRequest {
5
+ /** User-friendly name for the media distribution. The '*' character is not allowed. */
6
+ name: string;
7
+ /**
8
+ * Set this as the default media distribution that will be associated with
9
+ * all future media assets created without an explicit MediaDistributionId set.
10
+ */
11
+ default?: boolean;
12
+ /** Optional. Specify security settings for your media distribution. */
13
+ security?: {
14
+ /**
15
+ * Security keys that can be used to sign a JWT to authenticate media asset views.
16
+ * If no keys are provided the media distribution will be unsecured.
17
+ * This means any associated assets can be viewed without a token, and if a token is
18
+ * provided the signing key will not be validated.
19
+ * If a key is specified the media distribution will be secured and a valid token
20
+ * signed with one of the provided keys will be required to view associated media assets.
21
+ */
22
+ keys?: {
23
+ /** Name for the security key. */
24
+ name?: string | null;
25
+ /** Optional, key for the security key. */
26
+ key: string;
27
+ }[];
28
+ };
29
+ }
30
+ /**
31
+ * The allowable sort options for listing media distributions.
32
+ */
33
+ export type ListMediaDistributionsSortBy = 'createdAt';
34
+ /**
35
+ * The allowable parameters for listing and filtering media distributions.
36
+ */
37
+ export interface ListMediaDistributionsQueryParams {
38
+ /** Defaults to "createdAt". */
39
+ sort?: ListMediaDistributionsSortBy;
40
+ /** Optional. Case insensitive. */
41
+ name?: string | null;
42
+ /** Optional, search for default media distribution. */
43
+ default?: boolean;
44
+ /**
45
+ * Used for pagination.
46
+ * Do not include on the first request.
47
+ * For subsequent requests use the `pagination.cursor` field from the previous response.
48
+ * You must use the same sort option when requesting each page
49
+ */
50
+ cursor?: string | null;
51
+ /** Optional, integer, 1 to 100, defaults to 25. */
52
+ limit?: number;
53
+ /** Optional, defaults to `false`, sort descending boolean. */
54
+ desc?: boolean;
55
+ }
56
+ /**
57
+ * Response data for the list media distributions requests.
58
+ */
59
+ export interface ListMediaDistributionsResponse {
60
+ /** Defaults to "createdAt". */
61
+ data: MediaDistribution[];
62
+ /** Pagination object. */
63
+ pagination?: {
64
+ /** Has more pages. */
65
+ hasMore: boolean;
66
+ /** Cursor to go to the next page. */
67
+ cursor: string;
68
+ };
69
+ }
70
+ /**
71
+ * Response data for the creation of a media distribution.
72
+ */
73
+ export interface MediaDistribution extends CreateMediaDistributionRequest {
74
+ /** Identifier of the media distribution */
75
+ id: string;
76
+ /** When was the media distribution created. */
77
+ createdAt: string;
78
+ }
79
+ /**
80
+ * The allowable parameters for requesting the update of a media distribution.
81
+ */
82
+ export interface UpdateMediaDistributionRequest {
83
+ /** Identifier of the media distribution. */
84
+ id: string;
85
+ /** User-friendly name for the media distribution. The '*' character is not allowed. */
86
+ name: string;
87
+ /**
88
+ * Set this as the default media distribution that will be associated with
89
+ * all future media assets created without an explicit MediaDistributionId set.
90
+ */
91
+ default?: boolean;
92
+ }
93
+ /**
94
+ * Represents a security key.
95
+ */
96
+ export interface SecurityKey {
97
+ /** Identifier of the security key. */
98
+ id: string;
99
+ /** Name of the security key. */
100
+ name?: string;
101
+ }
102
+ /**
103
+ * Represents a security key.
104
+ */
105
+ export interface CreaseSecurityKeyRequest {
106
+ /** Identifier of the media distribution */
107
+ mediaDistributionId: string;
108
+ /** Key of the security key. */
109
+ key: string;
110
+ /** Name of the security key. */
111
+ name?: string;
112
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -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.2.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.4.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": {