@dolbyio/dolbyio-rest-apis-client 6.2.2 → 6.3.1
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/assets.js +5 -2
- package/dist/streaming/types/asset.d.ts +23 -2
- package/dist/streaming/types/monitoring.d.ts +108 -100
- package/dist/streaming/types/webhooks.d.ts +10 -5
- package/dist/streaming/webhooks.d.ts +3 -3
- package/dist/streaming/webhooks.js +8 -4
- package/package.json +9 -9
package/dist/index.js
CHANGED
package/dist/streaming/assets.js
CHANGED
|
@@ -50,11 +50,14 @@ var create = exports.create = /*#__PURE__*/function () {
|
|
|
50
50
|
headers: {
|
|
51
51
|
Accept: 'application/json',
|
|
52
52
|
'Content-Type': 'application/json',
|
|
53
|
-
Authorization: "Bearer ".concat(apiSecret)
|
|
54
|
-
'Idempotency-Key': idempotencyKey
|
|
53
|
+
Authorization: "Bearer ".concat(apiSecret)
|
|
55
54
|
},
|
|
56
55
|
body: JSON.stringify(clipRequest)
|
|
57
56
|
};
|
|
57
|
+
if (idempotencyKey) {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
options.headers['Idempotency-Key'] = idempotencyKey;
|
|
60
|
+
}
|
|
58
61
|
_context.n = 1;
|
|
59
62
|
return (0, _httpHelpers.sendPost)(options);
|
|
60
63
|
case 1:
|
|
@@ -48,6 +48,21 @@ export interface CreateAssetClipRequest {
|
|
|
48
48
|
storage?: MediaAssetStorageModel | null;
|
|
49
49
|
/** Optional. Provide expiry time for live recording clip. */
|
|
50
50
|
expiration?: string | null;
|
|
51
|
+
/** Optional. Id of the OptiView Live channel to create live clip. */
|
|
52
|
+
channelId?: string | null;
|
|
53
|
+
/** Optional. Format of the media asset. */
|
|
54
|
+
targetFormat?: 'mp4' | 'hls' | null;
|
|
55
|
+
/** Optional. ID of the media distribution used to authenticate viewing of this media asset. */
|
|
56
|
+
mediaDistributionId?: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Optional.
|
|
59
|
+
* Customize the download url path.
|
|
60
|
+
* Typically the download url has format `https://<domain>/<orgId>/<mediaAssetId>/<fileName>`.
|
|
61
|
+
* The customPath replaces the mediaAssetId so that the url looks like `https://<domain>/<orgId>/<customPath>/<fileName>`. The `customPath` must be unique.
|
|
62
|
+
*
|
|
63
|
+
* Possible values: non-empty and <= 512 characters.
|
|
64
|
+
*/
|
|
65
|
+
customPath?: string | null;
|
|
51
66
|
}
|
|
52
67
|
/**
|
|
53
68
|
* Response data for the Clip storage.
|
|
@@ -113,8 +128,10 @@ export interface MediaAssetFeedSelectionModel {
|
|
|
113
128
|
sourceId?: string | null;
|
|
114
129
|
/** Optional, The simulcastId of the stream the clip belongs to. */
|
|
115
130
|
simulcastId?: string | null;
|
|
116
|
-
/** Optional,
|
|
131
|
+
/** Optional, the priority of the clip request. */
|
|
117
132
|
priority?: number | null;
|
|
133
|
+
/** Optional, the identifier of the OptiView Live channel. */
|
|
134
|
+
channelId?: number | null;
|
|
118
135
|
}
|
|
119
136
|
/**
|
|
120
137
|
* Response data for a clip.
|
|
@@ -243,6 +260,10 @@ export interface UpdateMediaAssetRequest {
|
|
|
243
260
|
* Updates may take up to an hour to take effect.
|
|
244
261
|
*/
|
|
245
262
|
mediaDistributionId?: string;
|
|
246
|
-
/**
|
|
263
|
+
/**
|
|
264
|
+
* Customize a portion of the download url path.
|
|
265
|
+
* As an example assets are returned in a url such as `https://cdn.optiview.dolby.com/vod/<orgId>/<mediaAssetId>/<fileName>`.
|
|
266
|
+
* `customPath` will replace `mediaAssetId` in order for a more predictable path.
|
|
267
|
+
*/
|
|
247
268
|
customPath?: string;
|
|
248
269
|
}
|
|
@@ -50,6 +50,113 @@ export interface StreamSummary {
|
|
|
50
50
|
/** Viewer count. */
|
|
51
51
|
viewerCount: number;
|
|
52
52
|
}
|
|
53
|
+
/** Represents a Feed object. */
|
|
54
|
+
export interface Feed {
|
|
55
|
+
/** Identifier of the stream. */
|
|
56
|
+
streamId: string;
|
|
57
|
+
/** Identifier of the feed. */
|
|
58
|
+
feedId: string;
|
|
59
|
+
/** Identifier of the cluster. */
|
|
60
|
+
clusterId: string;
|
|
61
|
+
/** Identifier of the source. */
|
|
62
|
+
sourceId: string;
|
|
63
|
+
/** Simulcast ID. */
|
|
64
|
+
simulcastId: string;
|
|
65
|
+
/** Server ID. */
|
|
66
|
+
serverId: string;
|
|
67
|
+
/** Is the feed active. */
|
|
68
|
+
active: boolean;
|
|
69
|
+
/** Stream publishing start time. */
|
|
70
|
+
startTime: string;
|
|
71
|
+
/** Stream publishing end time. */
|
|
72
|
+
endTime?: string;
|
|
73
|
+
/** Is recording allowed for this stream. */
|
|
74
|
+
isRecordingAllowed: boolean;
|
|
75
|
+
/** Packet loss percentage over last five minutes. */
|
|
76
|
+
packetLoss: number;
|
|
77
|
+
/** Is the feed redundant. */
|
|
78
|
+
isRedundant?: boolean;
|
|
79
|
+
/** Feed priority. */
|
|
80
|
+
priority?: number;
|
|
81
|
+
/** Framerate. */
|
|
82
|
+
frameRate: number;
|
|
83
|
+
/** Feed type. */
|
|
84
|
+
type: string;
|
|
85
|
+
/** Identifier of the token. */
|
|
86
|
+
tokenId: number;
|
|
87
|
+
/** Client. */
|
|
88
|
+
client: {
|
|
89
|
+
/** Country. */
|
|
90
|
+
country: string;
|
|
91
|
+
/** City. */
|
|
92
|
+
city: string;
|
|
93
|
+
/** Continent. */
|
|
94
|
+
continent: string;
|
|
95
|
+
/** coordinates. */
|
|
96
|
+
coordinates: number[];
|
|
97
|
+
/** Sub. */
|
|
98
|
+
sub: string[];
|
|
99
|
+
/** IP Address. */
|
|
100
|
+
ip: string;
|
|
101
|
+
};
|
|
102
|
+
/** Restream information. */
|
|
103
|
+
restreams: Restream[];
|
|
104
|
+
/** Feed statistics. */
|
|
105
|
+
feedStats: FeedStats[];
|
|
106
|
+
/** Details for all tracks. */
|
|
107
|
+
trackDetails: TrackDetails[];
|
|
108
|
+
}
|
|
109
|
+
/** Represents the details of a track object. */
|
|
110
|
+
export interface TrackDetails {
|
|
111
|
+
/** Idenitfier of the track. */
|
|
112
|
+
trackId: string;
|
|
113
|
+
/** Encoding details. */
|
|
114
|
+
encodingDetails: EncodingDetails[];
|
|
115
|
+
}
|
|
116
|
+
/** Represents the encoding details of a track. */
|
|
117
|
+
export interface EncodingDetails {
|
|
118
|
+
/** Encoding ID. */
|
|
119
|
+
encodingId: string;
|
|
120
|
+
/** I-frame rate. */
|
|
121
|
+
iFrameRate: number;
|
|
122
|
+
/** B-frame rate. */
|
|
123
|
+
bFrameRate: number;
|
|
124
|
+
/** P-frame rate. */
|
|
125
|
+
pFrameRate: number;
|
|
126
|
+
/** Encoding statistics. */
|
|
127
|
+
encodingStats: EncodingStats[];
|
|
128
|
+
}
|
|
129
|
+
/** Represents the encoding statistic of a track. */
|
|
130
|
+
export interface EncodingStats {
|
|
131
|
+
/** Timestamp of the entry. */
|
|
132
|
+
timestamp: string;
|
|
133
|
+
/** Timestamp of the entry. */
|
|
134
|
+
resolution: {
|
|
135
|
+
/** Height of the frame. */
|
|
136
|
+
height: number;
|
|
137
|
+
/** Width of the frame. */
|
|
138
|
+
width: number;
|
|
139
|
+
};
|
|
140
|
+
/** Bitrate. */
|
|
141
|
+
bitRate: {
|
|
142
|
+
/** Audio bitrate. */
|
|
143
|
+
audioBitrate: number;
|
|
144
|
+
/** Video bitrate. */
|
|
145
|
+
videoBitrate: number;
|
|
146
|
+
};
|
|
147
|
+
/** Video codec. */
|
|
148
|
+
videoCodec: number;
|
|
149
|
+
/** Audio codec. */
|
|
150
|
+
audioCodec: number;
|
|
151
|
+
/** Frames. */
|
|
152
|
+
frames?: number;
|
|
153
|
+
/** RTT. */
|
|
154
|
+
rtt?: number;
|
|
155
|
+
/** Buffer Time. */
|
|
156
|
+
bufferTime?: number;
|
|
157
|
+
/** B-frames. */
|
|
158
|
+
bFrames?: number;
|
|
159
|
+
}
|
|
53
160
|
/** Represents a stream details. */
|
|
54
161
|
export interface StreamDetails extends StreamSummary {
|
|
55
162
|
/** Has redundant stream. */
|
|
@@ -57,106 +164,7 @@ export interface StreamDetails extends StreamSummary {
|
|
|
57
164
|
/** Restreaming enabled. */
|
|
58
165
|
restreaming: boolean;
|
|
59
166
|
/** Feeds. */
|
|
60
|
-
feeds:
|
|
61
|
-
/** Identifier of the stream. */
|
|
62
|
-
streamId: string;
|
|
63
|
-
/** Identifier of the feed. */
|
|
64
|
-
feedId: string;
|
|
65
|
-
/** Identifier of the cluster. */
|
|
66
|
-
clusterId: string;
|
|
67
|
-
/** Identifier of the source. */
|
|
68
|
-
sourceId: string;
|
|
69
|
-
/** Simulcast ID. */
|
|
70
|
-
simulcastId: string;
|
|
71
|
-
/** Server ID. */
|
|
72
|
-
serverId: string;
|
|
73
|
-
/** Is the feed active. */
|
|
74
|
-
active: boolean;
|
|
75
|
-
/** Stream publishing start time. */
|
|
76
|
-
startTime: string;
|
|
77
|
-
/** Stream publishing end time. */
|
|
78
|
-
endTime?: string;
|
|
79
|
-
/** Is recording allowed for this stream. */
|
|
80
|
-
isRecordingAllowed: boolean;
|
|
81
|
-
/** Packet loss percentage over last five minutes. */
|
|
82
|
-
packetLoss: number;
|
|
83
|
-
/** Is the feed redundant. */
|
|
84
|
-
isRedundant?: boolean;
|
|
85
|
-
/** Feed priority. */
|
|
86
|
-
priority?: number;
|
|
87
|
-
/** Framerate. */
|
|
88
|
-
frameRate: number;
|
|
89
|
-
/** Feed type. */
|
|
90
|
-
type: string;
|
|
91
|
-
/** Identifier of the token. */
|
|
92
|
-
tokenId: number;
|
|
93
|
-
/** Client. */
|
|
94
|
-
client: {
|
|
95
|
-
/** Country. */
|
|
96
|
-
country: string;
|
|
97
|
-
/** City. */
|
|
98
|
-
city: string;
|
|
99
|
-
/** Continent. */
|
|
100
|
-
continent: string;
|
|
101
|
-
/** coordinates. */
|
|
102
|
-
coordinates: number[];
|
|
103
|
-
/** Sub. */
|
|
104
|
-
sub: string[];
|
|
105
|
-
/** IP Address. */
|
|
106
|
-
ip: string;
|
|
107
|
-
};
|
|
108
|
-
/** Restream information. */
|
|
109
|
-
restreams: Restream[];
|
|
110
|
-
/** Feed statistics. */
|
|
111
|
-
feedStats: FeedStats[];
|
|
112
|
-
/** Details for all tracks. */
|
|
113
|
-
trackDetails: {
|
|
114
|
-
/** Idenitfier of the track. */
|
|
115
|
-
trackId: string;
|
|
116
|
-
/** Encoding details. */
|
|
117
|
-
encodingDetails: {
|
|
118
|
-
/** Encoding ID. */
|
|
119
|
-
encodingId: string;
|
|
120
|
-
/** I-frame rate. */
|
|
121
|
-
iFrameRate: number;
|
|
122
|
-
/** B-frame rate. */
|
|
123
|
-
bFrameRate: number;
|
|
124
|
-
/** P-frame rate. */
|
|
125
|
-
pFrameRate: number;
|
|
126
|
-
/** Encoding statistics. */
|
|
127
|
-
encodingStats: {
|
|
128
|
-
/** Timestamp of the entry. */
|
|
129
|
-
timestamp: string;
|
|
130
|
-
/** Timestamp of the entry. */
|
|
131
|
-
resolution: {
|
|
132
|
-
/** Height of the frame. */
|
|
133
|
-
height: number;
|
|
134
|
-
/** Width of the frame. */
|
|
135
|
-
width: number;
|
|
136
|
-
};
|
|
137
|
-
/** Bitrate. */
|
|
138
|
-
bitRate: {
|
|
139
|
-
/** Audio bitrate. */
|
|
140
|
-
audioBitrate: number;
|
|
141
|
-
/** Video bitrate. */
|
|
142
|
-
videoBitrate: number;
|
|
143
|
-
};
|
|
144
|
-
/** Video codec. */
|
|
145
|
-
videoCodec: number;
|
|
146
|
-
/** Audio codec. */
|
|
147
|
-
audioCodec: number;
|
|
148
|
-
/** Frames. */
|
|
149
|
-
frames?: number;
|
|
150
|
-
/** RTT. */
|
|
151
|
-
rtt?: number;
|
|
152
|
-
/** Buffer Time. */
|
|
153
|
-
bufferTime?: number;
|
|
154
|
-
/** B-frames. */
|
|
155
|
-
bFrames?: number;
|
|
156
|
-
}[];
|
|
157
|
-
}[];
|
|
158
|
-
}[];
|
|
159
|
-
}[];
|
|
167
|
+
feeds: Feed[];
|
|
160
168
|
}
|
|
161
169
|
/** Represents the restream information. */
|
|
162
170
|
export interface Restream {
|
|
@@ -8,8 +8,6 @@ export interface Webhook {
|
|
|
8
8
|
secret: string;
|
|
9
9
|
/** If `true` sends webhook events on feeds `start/stop`. */
|
|
10
10
|
isFeedHooks: boolean;
|
|
11
|
-
/** If `true` sends webhook events on recording `start/error/complete/deleted`. */
|
|
12
|
-
isRecordingHooks: boolean;
|
|
13
11
|
/** If `true` sends webhook events on thumbnail generation. */
|
|
14
12
|
isThumbnailHooks: boolean;
|
|
15
13
|
/** If `true` sends webhook events on transcoder instance updates. */
|
|
@@ -46,8 +44,6 @@ export interface UpdateWebhookRequest {
|
|
|
46
44
|
refreshSecret?: boolean;
|
|
47
45
|
/** Set to `true` to send webhook events on feeds `start/stop`. */
|
|
48
46
|
isFeedHooks?: boolean;
|
|
49
|
-
/** Set to `true` to send webhook events on recording `start/error/complete/deleted`. */
|
|
50
|
-
isRecordingHooks?: boolean;
|
|
51
47
|
/** Set to `true` to send webhook events on thumbnail generation. */
|
|
52
48
|
isThumbnailHooks?: boolean;
|
|
53
49
|
/** Set to `true` to send webhook events on transcoder instance updates. */
|
|
@@ -109,5 +105,14 @@ export interface AddWebhookRequest {
|
|
|
109
105
|
*/
|
|
110
106
|
filter?: string;
|
|
111
107
|
}
|
|
108
|
+
/** Represents a webhook test request. */
|
|
109
|
+
export interface TestWebhookRequest {
|
|
110
|
+
/** Type of webhook event to test. */
|
|
111
|
+
webhookType: WebhookType;
|
|
112
|
+
/** StreamName to include in test webhook payload. If not provided a default value will be used. */
|
|
113
|
+
streamName?: string;
|
|
114
|
+
/** TranscoderName to include in test webhook payload. If not provided a default value will be used.. */
|
|
115
|
+
transcoderName?: string;
|
|
116
|
+
}
|
|
112
117
|
/** Types of webhook events. */
|
|
113
|
-
export type WebhookType = '
|
|
118
|
+
export type WebhookType = 'Thumbnail' | 'Transcoder' | 'Media' | 'Feeds' | 'ViewerConnection';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Webhook, UpdateWebhookRequest, ListWebhooksRequest, AddWebhookRequest,
|
|
1
|
+
import { Webhook, UpdateWebhookRequest, ListWebhooksRequest, AddWebhookRequest, TestWebhookRequest } from './types/webhooks';
|
|
2
2
|
/**
|
|
3
3
|
* Gets the specified webhook.
|
|
4
4
|
*
|
|
@@ -61,8 +61,8 @@ export declare const add: (apiSecret: string, webhook: AddWebhookRequest) => Pro
|
|
|
61
61
|
* @see {@link https://optiview.dolby.com/docs/millicast/api/webhooks-test-webhook/}
|
|
62
62
|
*
|
|
63
63
|
* @param apiSecret The API Secret used to authenticate this request.
|
|
64
|
-
* @param
|
|
64
|
+
* @param testRequest Test request for the webhook.
|
|
65
65
|
*
|
|
66
66
|
* @returns A {@link !Promise Promise} whose fulfillment handler receives a flag indicating if the operation was successful or not.
|
|
67
67
|
*/
|
|
68
|
-
export declare const test: (apiSecret: string,
|
|
68
|
+
export declare const test: (apiSecret: string, testRequest: TestWebhookRequest) => Promise<boolean>;
|
|
@@ -214,24 +214,28 @@ var add = exports.add = /*#__PURE__*/function () {
|
|
|
214
214
|
* @see {@link https://optiview.dolby.com/docs/millicast/api/webhooks-test-webhook/}
|
|
215
215
|
*
|
|
216
216
|
* @param apiSecret The API Secret used to authenticate this request.
|
|
217
|
-
* @param
|
|
217
|
+
* @param testRequest Test request for the webhook.
|
|
218
218
|
*
|
|
219
219
|
* @returns A {@link !Promise Promise} whose fulfillment handler receives a flag indicating if the operation was successful or not.
|
|
220
220
|
*/
|
|
221
221
|
var test = exports.test = /*#__PURE__*/function () {
|
|
222
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(apiSecret,
|
|
222
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(apiSecret, testRequest) {
|
|
223
223
|
var options;
|
|
224
224
|
return _regenerator().w(function (_context6) {
|
|
225
225
|
while (1) switch (_context6.n) {
|
|
226
226
|
case 0:
|
|
227
227
|
options = {
|
|
228
228
|
hostname: Urls.getRtsHostname(),
|
|
229
|
-
path: "/api/webhooks/test/".concat(webhookType),
|
|
229
|
+
path: "/api/webhooks/test/".concat(testRequest.webhookType),
|
|
230
230
|
headers: {
|
|
231
231
|
Accept: 'application/json',
|
|
232
232
|
'Content-Type': 'application/json',
|
|
233
233
|
Authorization: "Bearer ".concat(apiSecret)
|
|
234
|
-
}
|
|
234
|
+
},
|
|
235
|
+
body: JSON.stringify({
|
|
236
|
+
streamName: testRequest.streamName,
|
|
237
|
+
transcoderName: testRequest.transcoderName
|
|
238
|
+
})
|
|
235
239
|
};
|
|
236
240
|
_context6.n = 1;
|
|
237
241
|
return (0, _httpHelpers.sendPost)(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dolbyio/dolbyio-rest-apis-client",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.1",
|
|
4
4
|
"description": "Node.JS wrapper for the Dolby OptiView REST APIs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@babel/cli": "^7
|
|
44
|
-
"@babel/core": "^7
|
|
45
|
-
"@babel/preset-env": "^7
|
|
46
|
-
"@babel/preset-typescript": "^7
|
|
43
|
+
"@babel/cli": "^7",
|
|
44
|
+
"@babel/core": "^7",
|
|
45
|
+
"@babel/preset-env": "^7",
|
|
46
|
+
"@babel/preset-typescript": "^7",
|
|
47
47
|
"@types/follow-redirects": "^1.14.4",
|
|
48
|
-
"@types/node": "^
|
|
48
|
+
"@types/node": "^26.1.1",
|
|
49
49
|
"babel-plugin-inline-replace-variables": "^1.3.1",
|
|
50
50
|
"npm-watch": "^0.13.0",
|
|
51
|
-
"prettier": "^3.
|
|
52
|
-
"typedoc": "^0.28.
|
|
51
|
+
"prettier": "^3.9.5",
|
|
52
|
+
"typedoc": "^0.28.20",
|
|
53
53
|
"typedoc-plugin-mdn-links": "^5.1.1",
|
|
54
|
-
"typescript": "^6
|
|
54
|
+
"typescript": "^6"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"follow-redirects": "^1.16.0",
|