@dolbyio/dolbyio-rest-apis-client 6.1.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 +1 -1
- package/dist/streaming/index.d.ts +6 -0
- package/dist/streaming/index.js +4 -1
- package/dist/streaming/mediaDistributions.d.ts +112 -0
- package/dist/streaming/mediaDistributions.js +337 -0
- package/dist/streaming/types/mediaDistributions.d.ts +112 -0
- package/dist/streaming/types/mediaDistributions.js +5 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,6 +8,12 @@ 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
|
/**
|
package/dist/streaming/index.js
CHANGED
|
@@ -7,6 +7,7 @@ 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,
|
|
@@ -16,7 +17,7 @@ var _exportNames = {
|
|
|
16
17
|
subscribeToken: true,
|
|
17
18
|
webhooks: true
|
|
18
19
|
};
|
|
19
|
-
exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.publishToken = exports.monitoring = 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;
|
|
20
21
|
var _types = require("./types");
|
|
21
22
|
Object.keys(_types).forEach(function (key) {
|
|
22
23
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -33,6 +34,8 @@ var _account = _interopRequireWildcard(require("./account"));
|
|
|
33
34
|
exports.account = _account;
|
|
34
35
|
var _assets = _interopRequireWildcard(require("./assets"));
|
|
35
36
|
exports.assets = _assets;
|
|
37
|
+
var _mediaDistributions = _interopRequireWildcard(require("./mediaDistributions"));
|
|
38
|
+
exports.mediaDistributions = _mediaDistributions;
|
|
36
39
|
var _cluster = _interopRequireWildcard(require("./cluster"));
|
|
37
40
|
exports.cluster = _cluster;
|
|
38
41
|
var _transcoders = _interopRequireWildcard(require("./transcoders"));
|
|
@@ -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,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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dolbyio/dolbyio-rest-apis-client",
|
|
3
|
-
"version": "6.
|
|
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": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
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": "^25.
|
|
48
|
+
"@types/node": "^25.4.0",
|
|
49
49
|
"babel-plugin-inline-replace-variables": "^1.3.1",
|
|
50
50
|
"npm-watch": "^0.13.0",
|
|
51
51
|
"prettier": "^3.8.1",
|