@dolbyio/dolbyio-rest-apis-client 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -36,4 +36,4 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
36
36
  // Expose the logger to control when/where to log
37
37
 
38
38
  /** Gets the version of this library. */
39
- var version = exports.version = "5.0.1";
39
+ var version = exports.version = "5.1.0";
@@ -0,0 +1,47 @@
1
+ import { CreateAssetClipRequest, ListMediaAssetsQueryParams, AssetResponseData } from './types/asset';
2
+ /**
3
+ * Creates a new media asset.
4
+ *
5
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-post
6
+ *
7
+ * @param apiSecret The API Secret used to authenticate this request.
8
+ * @param clipRequest The request body for creating a new media asset.
9
+ * @param idempotencyKey Optional, The unique identifier for this request to prevent duplicate submissions.
10
+ */
11
+ export declare const create: (apiSecret: string, clipRequest: CreateAssetClipRequest, idempotencyKey?: string) => Promise<AssetResponseData>;
12
+ /**
13
+ * Lists media assets.
14
+ *
15
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-get
16
+ *
17
+ * @param apiSecret The API Secret used to authenticate this request.
18
+ * @param params Query parameters for filtering the list of media assets.
19
+ *
20
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link AssetResponseData} objects.
21
+ */
22
+ export declare const list: (apiSecret: string, params: ListMediaAssetsQueryParams) => Promise<AssetResponseData[]>;
23
+ /**
24
+ * Deletes multiple media assets from storage.
25
+ *
26
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-delete
27
+ *
28
+ * @param apiSecret The API Secret used to authenticate this request.
29
+ * @param assetIds The list of asset IDs to delete.
30
+ *
31
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of asset deletion tasks that failed.
32
+ */
33
+ export declare const deleteAssets: (apiSecret: string, assetIds: string[]) => Promise<{
34
+ id?: string;
35
+ error?: string;
36
+ }[]>;
37
+ /**
38
+ * Reads a media asset.
39
+ *
40
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-mediaassetid-get
41
+ *
42
+ * @param apiSecret The API Secret used to authenticate this request.
43
+ * @param assetId The ID of the media asset to read.
44
+ *
45
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link AssetResponseData} object.
46
+ */
47
+ export declare const read: (apiSecret: string, assetId: string) => Promise<AssetResponseData>;
@@ -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.read = exports.list = exports.deleteAssets = exports.create = void 0;
8
+ var Urls = _interopRequireWildcard(require("../urls"));
9
+ var _httpHelpers = require("./internal/httpHelpers");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
12
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
13
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ 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; } }
15
+ 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; }
16
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
18
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
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); }
20
+ 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); }); }; }
21
+ /**
22
+ * Creates a new media asset.
23
+ *
24
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-post
25
+ *
26
+ * @param apiSecret The API Secret used to authenticate this request.
27
+ * @param clipRequest The request body for creating a new media asset.
28
+ * @param idempotencyKey Optional, The unique identifier for this request to prevent duplicate submissions.
29
+ */
30
+ var create = exports.create = /*#__PURE__*/function () {
31
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(apiSecret, clipRequest, idempotencyKey) {
32
+ var options;
33
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34
+ while (1) switch (_context.prev = _context.next) {
35
+ case 0:
36
+ options = {
37
+ hostname: Urls.getRtsHostname(),
38
+ path: "/api/v3/media/assets",
39
+ headers: {
40
+ Accept: 'application/json',
41
+ 'Content-Type': 'application/json',
42
+ Authorization: "Bearer ".concat(apiSecret),
43
+ 'Idempotency-Key': idempotencyKey
44
+ },
45
+ body: JSON.stringify(clipRequest)
46
+ };
47
+ _context.next = 3;
48
+ return (0, _httpHelpers.sendPost)(options);
49
+ case 3:
50
+ return _context.abrupt("return", _context.sent);
51
+ case 4:
52
+ case "end":
53
+ return _context.stop();
54
+ }
55
+ }, _callee);
56
+ }));
57
+ return function create(_x, _x2, _x3) {
58
+ return _ref.apply(this, arguments);
59
+ };
60
+ }();
61
+
62
+ /**
63
+ * Lists media assets.
64
+ *
65
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-get
66
+ *
67
+ * @param apiSecret The API Secret used to authenticate this request.
68
+ * @param params Query parameters for filtering the list of media assets.
69
+ *
70
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link AssetResponseData} objects.
71
+ */
72
+ var list = exports.list = /*#__PURE__*/function () {
73
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(apiSecret, params) {
74
+ var options;
75
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
76
+ while (1) switch (_context2.prev = _context2.next) {
77
+ case 0:
78
+ options = {
79
+ hostname: Urls.getRtsHostname(),
80
+ path: "/api/v3/media/assets",
81
+ headers: {
82
+ Accept: 'application/json',
83
+ 'Content-Type': 'application/json',
84
+ Authorization: "Bearer ".concat(apiSecret)
85
+ },
86
+ params: toDictString(params)
87
+ };
88
+ _context2.next = 3;
89
+ return (0, _httpHelpers.sendGet)(options);
90
+ case 3:
91
+ return _context2.abrupt("return", _context2.sent);
92
+ case 4:
93
+ case "end":
94
+ return _context2.stop();
95
+ }
96
+ }, _callee2);
97
+ }));
98
+ return function list(_x4, _x5) {
99
+ return _ref2.apply(this, arguments);
100
+ };
101
+ }();
102
+
103
+ /**
104
+ * Deletes multiple media assets from storage.
105
+ *
106
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-delete
107
+ *
108
+ * @param apiSecret The API Secret used to authenticate this request.
109
+ * @param assetIds The list of asset IDs to delete.
110
+ *
111
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an array of asset deletion tasks that failed.
112
+ */
113
+ var deleteAssets = exports.deleteAssets = /*#__PURE__*/function () {
114
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(apiSecret, assetIds) {
115
+ var options;
116
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
117
+ while (1) switch (_context3.prev = _context3.next) {
118
+ case 0:
119
+ options = {
120
+ hostname: Urls.getRtsHostname(),
121
+ path: "api/v3/media/assets",
122
+ headers: {
123
+ Accept: 'application/json',
124
+ 'Content-Type': 'application/json',
125
+ Authorization: "Bearer ".concat(apiSecret)
126
+ },
127
+ params: toDictString(assetIds)
128
+ };
129
+ _context3.next = 3;
130
+ return (0, _httpHelpers.sendDelete)(options);
131
+ case 3:
132
+ return _context3.abrupt("return", _context3.sent);
133
+ case 4:
134
+ case "end":
135
+ return _context3.stop();
136
+ }
137
+ }, _callee3);
138
+ }));
139
+ return function deleteAssets(_x6, _x7) {
140
+ return _ref3.apply(this, arguments);
141
+ };
142
+ }();
143
+
144
+ /**
145
+ * Reads a media asset.
146
+ *
147
+ * @link https://docs.dolby.io/streaming-apis/reference/media-assets-mediaassetid-get
148
+ *
149
+ * @param apiSecret The API Secret used to authenticate this request.
150
+ * @param assetId The ID of the media asset to read.
151
+ *
152
+ * @returns A {@link !Promise Promise} whose fulfillment handler receives an {@link AssetResponseData} object.
153
+ */
154
+ var read = exports.read = /*#__PURE__*/function () {
155
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(apiSecret, assetId) {
156
+ var options;
157
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
158
+ while (1) switch (_context4.prev = _context4.next) {
159
+ case 0:
160
+ options = {
161
+ hostname: Urls.getRtsHostname(),
162
+ path: "/api/v3/media/assets/".concat(assetId),
163
+ headers: {
164
+ Accept: 'application/json',
165
+ Authorization: "Bearer ".concat(apiSecret)
166
+ }
167
+ };
168
+ _context4.next = 3;
169
+ return (0, _httpHelpers.sendGet)(options);
170
+ case 3:
171
+ return _context4.abrupt("return", _context4.sent);
172
+ case 4:
173
+ case "end":
174
+ return _context4.stop();
175
+ }
176
+ }, _callee4);
177
+ }));
178
+ return function read(_x8, _x9) {
179
+ return _ref4.apply(this, arguments);
180
+ };
181
+ }();
182
+ function toDictString(obj) {
183
+ var result = {};
184
+ for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
185
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
186
+ _key = _Object$entries$_i[0],
187
+ value = _Object$entries$_i[1];
188
+ result[_key] = String(value); // Ensure all values are converted to strings
189
+ }
190
+ return result;
191
+ }
@@ -1,6 +1,8 @@
1
1
  export * from './types';
2
2
  /** APIs for the Dolby Millicast account level settings. */
3
3
  export * as account from './account';
4
+ /** APIs to access the media assets. */
5
+ export * as assets from './assets';
4
6
  /** APIs for the Dolby Millicast clusters for the account. */
5
7
  export * as cluster from './cluster';
6
8
  /**
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  var _exportNames = {
8
8
  account: true,
9
+ assets: true,
9
10
  cluster: true,
10
11
  transcoders: true,
11
12
  director: true,
@@ -15,7 +16,7 @@ var _exportNames = {
15
16
  subscribeToken: true,
16
17
  webhooks: true
17
18
  };
18
- exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.recordFiles = exports.publishToken = exports.director = exports.cluster = exports.account = void 0;
19
+ exports.webhooks = exports.transcoders = exports.subscribeToken = exports.stream = exports.recordFiles = exports.publishToken = exports.director = exports.cluster = exports.assets = exports.account = void 0;
19
20
  var _types = require("./types");
20
21
  Object.keys(_types).forEach(function (key) {
21
22
  if (key === "default" || key === "__esModule") return;
@@ -30,6 +31,8 @@ Object.keys(_types).forEach(function (key) {
30
31
  });
31
32
  var _account = _interopRequireWildcard(require("./account"));
32
33
  exports.account = _account;
34
+ var _assets = _interopRequireWildcard(require("./assets"));
35
+ exports.assets = _assets;
33
36
  var _cluster = _interopRequireWildcard(require("./cluster"));
34
37
  exports.cluster = _cluster;
35
38
  var _transcoders = _interopRequireWildcard(require("./transcoders"));
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Storage types supported by Dolby.
3
+ */
4
+ export type MediaAssetStorageType = "awsS3" | "gcs" | "dolbyStorage";
5
+ /**
6
+ * Additional options for the storage location.
7
+ */
8
+ export interface UpdateStorageOptionsModel {
9
+ /** Optional, prefix to prepend to assets names in storage. */
10
+ objectPrefix?: string | null;
11
+ /** Optional, name of the bucket to use for storage. */
12
+ bucketName?: string | null;
13
+ /** Optional, region of the bucket to use for storage. */
14
+ bucketRegion?: string | null;
15
+ }
16
+ /**
17
+ * The allowable parameters for updating the storage location of an asset when requesting clip creation.
18
+ */
19
+ export interface MediaAssetStorageModel {
20
+ /** The id of a previously created storage profile. */
21
+ profileId?: string | null;
22
+ /** The type of storage to use. */
23
+ type?: MediaAssetStorageType | null;
24
+ /** Additional options for the storage location. */
25
+ options?: UpdateStorageOptionsModel | null;
26
+ /** ISO 8601 date string, only used for DolbyIO storage. Sets the date to delete the asset automatically. */
27
+ expiration?: string | null;
28
+ }
29
+ /**
30
+ * The allowable parameters for requesting the creation of an asset clip.
31
+ */
32
+ export interface CreateAssetClipRequest {
33
+ /** Required, length ≥ 1, Name of the stream you want to clip. */
34
+ streamName: string;
35
+ /** Optional, Token ID of the stream you want to clip. */
36
+ tokenId?: number | null;
37
+ /** Optional, source identifier. */
38
+ sourceId?: string | null;
39
+ /** Optional, Simulcast ID if required. */
40
+ simulcastId?: string | null;
41
+ /** Optional, int32, The requests with the highest priority are processed first. */
42
+ priority?: number | null;
43
+ /** Required, ISO 8601 date string, Start time of the clip. */
44
+ startTime: string;
45
+ /** Optional, ISO 8601 date string, End time of the clip. If not required defaults to current time. */
46
+ stopTime?: string | null;
47
+ /** Optional, Name of the asset once clipped. If not provided it will be generated. */
48
+ name?: string | null;
49
+ /** Optional, storage information. */
50
+ storage?: MediaAssetStorageModel | null;
51
+ }
52
+ /**
53
+ * Response data for the Clip storage.
54
+ */
55
+ export interface MediaAssetStorageResponseModel {
56
+ /** Storage type. */
57
+ type: MediaAssetStorageType;
58
+ /** Optional, Path to clip storage location. */
59
+ path?: string | null;
60
+ }
61
+ /**
62
+ * Response Data for the Metadata for a clip.
63
+ */
64
+ export interface RecordMetadata {
65
+ /** Format of the clip */
66
+ format: string;
67
+ /** Optional, additional fields expected, sizes available. */
68
+ sizes?: Record<string, any> | null;
69
+ /** Duration in seconds of clip. */
70
+ duration: number;
71
+ /** Array of tracks. */
72
+ tracks: {
73
+ /** Track type */
74
+ type: string;
75
+ /** Track Codec */
76
+ codec: string;
77
+ /** Bitrate of the track. */
78
+ bitrate: number;
79
+ /** Optional, int32, Width of track. */
80
+ width?: number | null;
81
+ /** Optional, int32 Height of track. */
82
+ height?: number | null;
83
+ /** Optional, int32, Framerate of Track. */
84
+ framerate?: number | null;
85
+ /** Optional, int32, Number of channels. */
86
+ channels?: number | null;
87
+ /** Optional, int64, Sample rate of track. */
88
+ samplerate?: number | null;
89
+ }[];
90
+ /** Array of thumbnail URLs */
91
+ thumbnails: string[];
92
+ }
93
+ /**
94
+ * Response data for the feed selection from where the clip was created.
95
+ */
96
+ export interface MediaAssetFeedSelectionModel {
97
+ /** Optional, Token ID of the stream if provided. */
98
+ tokenId?: number | null;
99
+ /** Required, The name of the stream the clip belongs to. */
100
+ streamName: string;
101
+ /** Optional, The SourceId of the stream the clip belongs to. */
102
+ sourceId?: string | null;
103
+ /** Optional, The simulcastId of the stream the clip belongs to. */
104
+ simulcastId?: string | null;
105
+ /** Optional, int32, the priority of the clip request. */
106
+ priority?: number | null;
107
+ }
108
+ /**
109
+ * Response data for a clip.
110
+ */
111
+ export interface AssetResponseData {
112
+ /** Optional, ID of the object. */
113
+ id?: string | null;
114
+ /** Required, type of the object. */
115
+ type: "recording" | "clip" | "storageValidation" | "timeline" | "feed";
116
+ /** Optional, information about the asset. */
117
+ feed?: MediaAssetFeedSelectionModel;
118
+ /** Required, ISO 8601 date string, Start time of clip. */
119
+ startTime: string;
120
+ /** Optional, ISO 8601 date string, End time of clip. */
121
+ stopTime?: string | null;
122
+ /** Optional, name of the asset. */
123
+ name?: string;
124
+ /** Storage information. */
125
+ storage: MediaAssetStorageResponseModel;
126
+ /** The status of the Clip request. */
127
+ status: "processing" | "complete" | "error" | "deleting" | "deleted";
128
+ /** Optional, error details. */
129
+ error?: string | null;
130
+ /** Optional, ISO 8601 date string, Created Date. */
131
+ created?: string | null;
132
+ /** Optional, ISO 8601 date string, Expiration Date. */
133
+ expiration?: string | null;
134
+ /** Optional, ISO 8601 date string, Deleted Date. */
135
+ removed?: string | null;
136
+ /** Optional, asset metadata. */
137
+ metadata?: RecordMetadata;
138
+ }
139
+ /**
140
+ * The allowable sort options for listing media assets.
141
+ */
142
+ export type ListMediaAssetSortBy = "startTime" | "endTime" | "name";
143
+ /**
144
+ * The allowable parameters for listing and filtering media assets.
145
+ */
146
+ export interface ListMediaAssetsQueryParams {
147
+ /** Defaults to "startTime". */
148
+ sort?: ListMediaAssetSortBy;
149
+ /** Defaults to ["Processing", "Complete"] unless specified. */
150
+ status?: string[] | null;
151
+ /** Defaults to ["Clip", "Recording"] unless specified. */
152
+ type?: string[] | null;
153
+ /** Optional. Filter by media asset name. */
154
+ name?: string | null;
155
+ /** Optional, Name of the stream to filter by. */
156
+ streamName?: string | null;
157
+ /** Optional, Token ID of the stream to filter by. */
158
+ tokenId?: number | null;
159
+ /** Optional, Source ID of the stream to filter by. */
160
+ sourceId?: string | null;
161
+ /** Optional, with behavior for empty string, Simulcast ID of the stream to filter by. */
162
+ simulcastId?: string | null;
163
+ /** Optional, int32, Priority of the clip request to filter by. */
164
+ priority?: number | null;
165
+ /** Optional, integer, 1 to 2147483647, defaults to 1 */
166
+ page?: number;
167
+ /** Optional, integer, 1 to 100, defaults to 25. */
168
+ limit?: number;
169
+ /** Optional, defaults to `false`, sort descending boolean. */
170
+ desc?: boolean;
171
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -19,6 +19,11 @@ export interface Cluster {
19
19
  /** Country of the cluster. */
20
20
  country: string;
21
21
  };
22
+ /** Features available in this cluster. */
23
+ features: {
24
+ /** Indicates whether the Transcoder feature is supported in the corresponding cluster. */
25
+ transcoding: boolean;
26
+ };
22
27
  }
23
28
  /**
24
29
  * Represents the response to a {@link read} or {@link update} request.
@@ -1,4 +1,5 @@
1
1
  export * from './account';
2
+ export * from './asset';
2
3
  export * from './cluster';
3
4
  export * from './director';
4
5
  export * from './publishToken';
@@ -14,6 +14,17 @@ Object.keys(_account).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
+ var _asset = require("./asset");
18
+ Object.keys(_asset).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _asset[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _asset[key];
25
+ }
26
+ });
27
+ });
17
28
  var _cluster = require("./cluster");
18
29
  Object.keys(_cluster).forEach(function (key) {
19
30
  if (key === "default" || key === "__esModule") return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolbyio/dolbyio-rest-apis-client",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "Node.JS wrapper for the Dolby.io REST APIs",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {