@dolbyio/dolbyio-rest-apis-client 4.0.2 → 5.0.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/LICENSE +1 -1
- package/README.md +60 -118
- package/dist/index.d.ts +15 -6
- package/dist/index.js +33 -14
- package/dist/internal/httpHelpers.js +15 -21
- package/dist/media/analyze.d.ts +1 -6
- package/dist/media/analyze.js +3 -8
- package/dist/media/analyzeMusic.d.ts +1 -6
- package/dist/media/analyzeMusic.js +3 -8
- package/dist/media/analyzeSpeech.d.ts +1 -6
- package/dist/media/analyzeSpeech.js +3 -8
- package/dist/media/authentication.d.ts +15 -0
- package/dist/media/authentication.js +65 -0
- package/dist/media/diagnose.d.ts +1 -6
- package/dist/media/diagnose.js +3 -8
- package/dist/media/enhance.d.ts +1 -1
- package/dist/media/enhance.js +3 -3
- package/dist/media/index.d.ts +12 -11
- package/dist/media/index.js +50 -23
- package/dist/media/internal/httpHelpers.d.ts +1 -1
- package/dist/media/internal/httpHelpers.js +2 -2
- package/dist/media/internal/jobsHelpers.d.ts +1 -1
- package/dist/media/internal/jobsHelpers.js +5 -5
- package/dist/media/io.d.ts +1 -1
- package/dist/media/io.js +5 -5
- package/dist/media/jobs.d.ts +1 -1
- package/dist/media/jobs.js +5 -5
- package/dist/media/mastering.d.ts +1 -1
- package/dist/media/mastering.js +3 -3
- package/dist/media/transcode.d.ts +1 -1
- package/dist/media/transcode.js +3 -3
- package/dist/media/types/analyzeMusic.d.ts +43 -50
- package/dist/media/types/diagnose.d.ts +66 -79
- package/dist/media/types/index.d.ts +11 -0
- package/dist/media/types/index.js +126 -0
- package/dist/media/types/jobs.d.ts +2 -0
- package/dist/media/types/jwtToken.d.ts +13 -0
- package/dist/media/types/webhooks.d.ts +6 -7
- package/dist/media/webhooks.d.ts +2 -1
- package/dist/media/webhooks.js +5 -5
- package/dist/streaming/account.d.ts +48 -0
- package/dist/streaming/account.js +184 -0
- package/dist/streaming/cluster.d.ts +19 -0
- package/dist/streaming/cluster.js +25 -5
- package/dist/streaming/director.d.ts +2 -2
- package/dist/streaming/director.js +7 -7
- package/dist/streaming/index.d.ts +18 -7
- package/dist/streaming/index.js +44 -15
- package/dist/streaming/internal/httpHelpers.js +5 -5
- package/dist/streaming/publishToken.d.ts +86 -3
- package/dist/streaming/publishToken.js +96 -6
- package/dist/streaming/recordFiles.d.ts +55 -0
- package/dist/streaming/recordFiles.js +214 -0
- package/dist/streaming/stream.d.ts +24 -2
- package/dist/streaming/stream.js +32 -6
- package/dist/streaming/subscribeToken.d.ts +54 -0
- package/dist/streaming/subscribeToken.js +63 -5
- package/dist/streaming/transcoders.d.ts +143 -0
- package/dist/streaming/transcoders.js +481 -0
- package/dist/streaming/types/account.d.ts +25 -0
- package/dist/streaming/types/cluster.d.ts +17 -0
- package/dist/streaming/types/core.d.ts +1 -0
- package/dist/streaming/types/director.d.ts +15 -6
- package/dist/streaming/types/index.d.ts +9 -0
- package/dist/streaming/types/index.js +104 -0
- package/dist/streaming/types/publishToken.d.ts +273 -12
- package/dist/streaming/types/recordFiles.d.ts +49 -0
- package/dist/streaming/types/stream.d.ts +3 -0
- package/dist/streaming/types/subscribeToken.d.ts +150 -4
- package/dist/streaming/types/transcoders.d.ts +138 -0
- package/dist/streaming/types/webhooks.d.ts +69 -0
- package/dist/streaming/webhooks.d.ts +57 -0
- package/dist/streaming/webhooks.js +224 -0
- package/dist/urls.d.ts +0 -2
- package/dist/urls.js +1 -5
- package/package.json +15 -11
- package/dist/authentication.d.ts +0 -29
- package/dist/authentication.js +0 -82
- package/dist/communications/authentication.d.ts +0 -14
- package/dist/communications/authentication.js +0 -62
- package/dist/communications/conference.d.ts +0 -95
- package/dist/communications/conference.js +0 -404
- package/dist/communications/index.d.ts +0 -6
- package/dist/communications/index.js +0 -19
- package/dist/communications/internal/httpHelpers.d.ts +0 -10
- package/dist/communications/internal/httpHelpers.js +0 -67
- package/dist/communications/monitor/conferences.d.ts +0 -91
- package/dist/communications/monitor/conferences.js +0 -389
- package/dist/communications/monitor/index.d.ts +0 -4
- package/dist/communications/monitor/index.js +0 -15
- package/dist/communications/monitor/recordings.d.ts +0 -77
- package/dist/communications/monitor/recordings.js +0 -287
- package/dist/communications/monitor/webhooks.d.ts +0 -24
- package/dist/communications/monitor/webhooks.js +0 -136
- package/dist/communications/recording.d.ts +0 -44
- package/dist/communications/recording.js +0 -117
- package/dist/communications/remix.js +0 -122
- package/dist/communications/streaming.d.ts +0 -76
- package/dist/communications/streaming.js +0 -217
- package/dist/communications/types/authentication.d.ts +0 -25
- package/dist/communications/types/conference.d.ts +0 -76
- package/dist/communications/types/conferences.d.ts +0 -140
- package/dist/communications/types/core.d.ts +0 -30
- package/dist/communications/types/mixOptions.d.ts +0 -39
- package/dist/communications/types/participant.d.ts +0 -6
- package/dist/communications/types/participant.js +0 -1
- package/dist/communications/types/permission.d.ts +0 -26
- package/dist/communications/types/permission.js +0 -21
- package/dist/communications/types/recordings.d.ts +0 -85
- package/dist/communications/types/recordings.js +0 -5
- package/dist/communications/types/remixStatus.js +0 -1
- package/dist/communications/types/rtcpMode.d.ts +0 -8
- package/dist/communications/types/rtcpMode.js +0 -12
- package/dist/communications/types/rtsStream.d.ts +0 -10
- package/dist/communications/types/rtsStream.js +0 -1
- package/dist/communications/types/spatialAudio.d.ts +0 -18
- package/dist/communications/types/spatialAudio.js +0 -5
- package/dist/communications/types/videoCodec.d.ts +0 -4
- package/dist/communications/types/videoCodec.js +0 -11
- package/dist/communications/types/webhooks.d.ts +0 -38
- package/dist/internal/utils.d.ts +0 -6
- package/dist/internal/utils.js +0 -5
- package/dist/streaming/geo.d.ts +0 -27
- package/dist/streaming/geo.js +0 -106
- package/dist/streaming/types/geo.d.ts +0 -4
- package/dist/streaming/types/geo.js +0 -5
- package/dist/types/jwtToken.d.ts +0 -6
- package/dist/types/jwtToken.js +0 -1
- /package/dist/{communications/types/authentication.js → media/types/jwtToken.js} +0 -0
- /package/dist/{communications/types/conference.js → streaming/types/account.js} +0 -0
- /package/dist/{communications/types/conferences.js → streaming/types/recordFiles.js} +0 -0
- /package/dist/{communications/types/core.js → streaming/types/stream.js} +0 -0
- /package/dist/{communications/types/mixOptions.js → streaming/types/transcoders.js} +0 -0
- /package/dist/{communications → streaming}/types/webhooks.js +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,114 +1,31 @@
|
|
|
1
1
|
[](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/build-package.yml)
|
|
2
|
+
[](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/build-documentation.yml)
|
|
2
3
|
[](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/publish-package.yml)
|
|
3
4
|
[](https://www.npmjs.com/package/@dolbyio/dolbyio-rest-apis-client)
|
|
4
5
|
[](LICENSE)
|
|
6
|
+
[](https://github.com/DolbyIO/dolbyio-rest-apis-client-node)
|
|
7
|
+
[](https://api-references.dolby.io/dolbyio-rest-apis-client-node/)
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
Dolby.io REST APIs Client for Node.JS is wrapper for the [Dolby Millicast](https://docs.dolby.io/streaming-apis/reference) and [Dolby.io Media](https://docs.dolby.io/media-processing/reference/media-enhance-overview) REST APIs.
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Install this project
|
|
11
|
+
# Install this project
|
|
11
12
|
|
|
12
13
|
Run the npm command to install the package `@dolbyio/dolbyio-rest-apis-client` into your Node project:
|
|
13
14
|
|
|
14
15
|
```bash
|
|
15
|
-
npm install @dolbyio/dolbyio-rest-apis-client
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Authentication
|
|
19
|
-
|
|
20
|
-
To get an access token that will be used by your server to perform backend operations like creating a conference, use the following code.
|
|
21
|
-
|
|
22
|
-
```javascript
|
|
23
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
24
|
-
|
|
25
|
-
const APP_KEY = 'YOUR_APP_KEY';
|
|
26
|
-
const APP_SECRET = 'YOUR_APP_SECRET';
|
|
27
|
-
|
|
28
|
-
const jwt = await dolbyio.authentication.getApiAccessToken(APP_KEY, APP_SECRET);
|
|
29
|
-
|
|
30
|
-
console.log(`Access Token: ${jwt.access_token}`);
|
|
16
|
+
npm install @dolbyio/dolbyio-rest-apis-client
|
|
31
17
|
```
|
|
32
18
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
19
|
+
# Dolby Millicast Examples
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
const APP_SECRET = 'YOUR_APP_SECRET';
|
|
40
|
-
|
|
41
|
-
const jwt = await dolbyio.authentication.getApiAccessToken(APP_KEY, APP_SECRET, 3600, ['comms:client_access_token:create']);
|
|
42
|
-
|
|
43
|
-
console.log(`Access Token: ${jwt.access_token}`);
|
|
44
|
-
console.log(`Scope: ${jwt.scope}`);
|
|
45
|
-
```
|
|
21
|
+
## Create a publish token
|
|
46
22
|
|
|
47
|
-
|
|
23
|
+
```ts
|
|
24
|
+
import { streaming } from '@dolbyio/dolbyio-rest-apis-client';
|
|
48
25
|
|
|
49
|
-
|
|
26
|
+
const API_KEY = process.env.DOLBYIO_API_SECRET;
|
|
50
27
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
55
|
-
|
|
56
|
-
const APP_KEY = 'YOUR_APP_KEY';
|
|
57
|
-
const APP_SECRET = 'YOUR_APP_SECRET';
|
|
58
|
-
|
|
59
|
-
// Request an API Token
|
|
60
|
-
const api_token = await dolbyio.authentication.getApiAccessToken(APP_KEY, APP_SECRET, 3600, ['comms:client_access_token:create']);
|
|
61
|
-
|
|
62
|
-
// Request the Client Access Token
|
|
63
|
-
const cat = await dolbyio.communications.authentication.getClientAccessTokenV2({
|
|
64
|
-
accessToken: api_token,
|
|
65
|
-
sessionScope: ['*'],
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
console.log(`Client Access Token: ${cat.access_token}`);
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Create a conference
|
|
72
|
-
|
|
73
|
-
To create a Dolby Voice conference, you first must retrieve an API Access Token, then use the following code to create the conference.
|
|
74
|
-
|
|
75
|
-
```javascript
|
|
76
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
77
|
-
|
|
78
|
-
const APP_KEY = 'YOUR_APP_KEY';
|
|
79
|
-
const APP_SECRET = 'YOUR_APP_SECRET';
|
|
80
|
-
|
|
81
|
-
const ownerExternalId = ''; // Identifier of the owner of the conference
|
|
82
|
-
const alias = ''; // Conference alias
|
|
83
|
-
|
|
84
|
-
const options = {
|
|
85
|
-
ownerExternalId: ownerExternalId,
|
|
86
|
-
alias: alias,
|
|
87
|
-
dolbyVoice: true,
|
|
88
|
-
liveRecording: false,
|
|
89
|
-
participants: [
|
|
90
|
-
{ externalId: 'hostA', permissions: ['JOIN', 'SEND_AUDIO', 'SEND_VIDEO'], notify: true },
|
|
91
|
-
{ externalId: 'listener1', permissions: ['JOIN'], notify: false },
|
|
92
|
-
],
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// Request an API Token
|
|
96
|
-
const jwt = await dolbyio.authentication.getApiAccessToken(APP_KEY, APP_SECRET, 3600, ['comms:conf:create']);
|
|
97
|
-
|
|
98
|
-
// Create the conference
|
|
99
|
-
const conference = await dolbyio.communications.conference.createConference(jwt, options);
|
|
100
|
-
|
|
101
|
-
console.log(`Conference created: ${conference.conferenceId}`);
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Real-time Streaming Examples
|
|
105
|
-
|
|
106
|
-
### Create a publish token
|
|
107
|
-
|
|
108
|
-
```javascript
|
|
109
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
110
|
-
|
|
111
|
-
const publishToken = await dolbyio.streaming.publishToken.create('api_secret', {
|
|
28
|
+
const publishToken = await streaming.publishToken.create(API_KEY, {
|
|
112
29
|
label: 'My token',
|
|
113
30
|
streams: [
|
|
114
31
|
{
|
|
@@ -119,12 +36,14 @@ const publishToken = await dolbyio.streaming.publishToken.create('api_secret', {
|
|
|
119
36
|
console.log(publishToken);
|
|
120
37
|
```
|
|
121
38
|
|
|
122
|
-
|
|
39
|
+
## Create a subscribe token
|
|
123
40
|
|
|
124
|
-
```
|
|
125
|
-
|
|
41
|
+
```ts
|
|
42
|
+
import { streaming } from '@dolbyio/dolbyio-rest-apis-client';
|
|
126
43
|
|
|
127
|
-
const
|
|
44
|
+
const API_KEY = process.env.DOLBYIO_API_SECRET;
|
|
45
|
+
|
|
46
|
+
const subscribeToken = await streaming.subscribeToken.create(API_KEY, {
|
|
128
47
|
label: 'My token',
|
|
129
48
|
streams: [
|
|
130
49
|
{
|
|
@@ -135,43 +54,43 @@ const subscribeToken = await dolbyio.streaming.subscribeToken.create('api_secret
|
|
|
135
54
|
console.log(subscribeToken);
|
|
136
55
|
```
|
|
137
56
|
|
|
138
|
-
|
|
57
|
+
# Media Examples
|
|
139
58
|
|
|
140
59
|
Here is an example on how to upload a file to the Dolby.io temporary cloud storage, enhance that file and download the result.
|
|
141
60
|
|
|
142
|
-
|
|
61
|
+
## Get an API token
|
|
143
62
|
|
|
144
63
|
Get the App Key and Secret from the Dolby.io dashboard and use the following code in your python script.
|
|
145
64
|
|
|
146
|
-
```
|
|
147
|
-
|
|
65
|
+
```ts
|
|
66
|
+
import { media } from '@dolbyio/dolbyio-rest-apis-client';
|
|
148
67
|
|
|
149
|
-
const APP_KEY =
|
|
150
|
-
const APP_SECRET =
|
|
68
|
+
const APP_KEY = process.env.DOLBYIO_APP_KEY;
|
|
69
|
+
const APP_SECRET = process.env.DOLBYIO_APP_SECRET;
|
|
151
70
|
|
|
152
71
|
// Request an Access Token
|
|
153
|
-
const jwt = await
|
|
72
|
+
const jwt = await media.authentication.getApiAccessToken(APP_KEY, APP_SECRET);
|
|
154
73
|
console.log('Access token', jwt);
|
|
155
74
|
```
|
|
156
75
|
|
|
157
|
-
|
|
76
|
+
## Upload a file for processing
|
|
158
77
|
|
|
159
78
|
Upload a media file to the Dolby.io temporary cloud storage for processing:
|
|
160
79
|
|
|
161
|
-
```
|
|
80
|
+
```ts
|
|
162
81
|
// Temporary storage URL that will be used as reference for the job processing
|
|
163
82
|
const inputUrl = 'dlb://in/file.mp4';
|
|
164
83
|
// Local path of the file to upload
|
|
165
84
|
const originalFilePath = '/path/to/original_file.mp4';
|
|
166
85
|
|
|
167
|
-
await
|
|
86
|
+
await media.io.uploadFile(jwt, inputUrl, originalFilePath);
|
|
168
87
|
```
|
|
169
88
|
|
|
170
|
-
|
|
89
|
+
## Start an enhance job
|
|
171
90
|
|
|
172
91
|
Generate a job description and send it to Dolby.io.
|
|
173
92
|
|
|
174
|
-
```
|
|
93
|
+
```ts
|
|
175
94
|
// Temporary storage URL that will be used as reference for the job processing
|
|
176
95
|
const outputUrl = 'dlb://out/file.mp4';
|
|
177
96
|
|
|
@@ -181,23 +100,23 @@ const jobDescription = JSON.stringify({
|
|
|
181
100
|
output: outputUrl,
|
|
182
101
|
});
|
|
183
102
|
|
|
184
|
-
const jobId = await
|
|
103
|
+
const jobId = await media.enhance.start(jwt, jobDescription);
|
|
185
104
|
console.log(`Job ID: ${jobId}`);
|
|
186
105
|
```
|
|
187
106
|
|
|
188
|
-
|
|
107
|
+
## Wait for the job to complete
|
|
189
108
|
|
|
190
109
|
Get the job status and wait until it is completed.
|
|
191
110
|
|
|
192
111
|
```javascript
|
|
193
112
|
const sleep = (delay) => new Promise((r) => setTimeout(r, delay));
|
|
194
113
|
|
|
195
|
-
let result = await
|
|
114
|
+
let result = await media.enhance.getResults(jwt, jobId);
|
|
196
115
|
while (result.status === 'Pending' || result.status === 'Running') {
|
|
197
116
|
console.log(`Job status is ${result.status}, taking a 5 second break...`);
|
|
198
117
|
await sleep(5000);
|
|
199
118
|
|
|
200
|
-
result = await
|
|
119
|
+
result = await media.enhance.getResults(jwt, jobId);
|
|
201
120
|
}
|
|
202
121
|
|
|
203
122
|
if (result.status !== 'Success') {
|
|
@@ -206,7 +125,7 @@ if (result.status !== 'Success') {
|
|
|
206
125
|
}
|
|
207
126
|
```
|
|
208
127
|
|
|
209
|
-
|
|
128
|
+
## Download a processed file
|
|
210
129
|
|
|
211
130
|
At this stage, the file has been processed and written to the temporary storage so we can download it.
|
|
212
131
|
|
|
@@ -214,13 +133,36 @@ At this stage, the file has been processed and written to the temporary storage
|
|
|
214
133
|
// Local path where to download the file to
|
|
215
134
|
const enhancedFilePath = '/path/to/enhanced_file.mp4';
|
|
216
135
|
|
|
217
|
-
await
|
|
136
|
+
await media.io.downloadFile(jwt, outputUrl, enhancedFilePath);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
# Logs
|
|
140
|
+
|
|
141
|
+
You can also print the logs in the console and select the log level by using the following code.
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
import { Logger } from '@dolbyio/dolbyio-rest-apis-client';
|
|
145
|
+
|
|
146
|
+
Logger.useDefaults({
|
|
147
|
+
defaultLevel: Logger.TRACE,
|
|
148
|
+
});
|
|
218
149
|
```
|
|
219
150
|
|
|
220
|
-
|
|
151
|
+
# How to
|
|
221
152
|
|
|
222
153
|
To build the `dist` folder, run the command:
|
|
223
154
|
|
|
224
155
|
```bash
|
|
225
156
|
npm run build
|
|
226
157
|
```
|
|
158
|
+
|
|
159
|
+
The documentation is built on [TypeDoc](https://typedoc.org), to generate the doc, run the following command. You will find the HTML files in the `docs` folder.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm run docs
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Related Projects
|
|
166
|
+
|
|
167
|
+
- [TypeDoc](https://typedoc.org)
|
|
168
|
+
- [js-logger](https://github.com/jonnyreeves/js-logger)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Media APIs.
|
|
3
|
+
* @link https://docs.dolby.io/media-apis/reference
|
|
4
|
+
*/
|
|
5
|
+
export * as media from './media';
|
|
6
|
+
/**
|
|
7
|
+
* Dolby Millicast APIs.
|
|
8
|
+
* @link https://docs.dolby.io/streaming-apis/reference
|
|
9
|
+
*/
|
|
10
|
+
export * as streaming from './streaming';
|
|
11
|
+
/** @ignore */
|
|
12
|
+
export * as urls from './urls';
|
|
13
|
+
export { default as Logger } from 'js-logger';
|
|
14
|
+
/** Gets the version of this library. */
|
|
6
15
|
declare const version: string;
|
|
7
|
-
export {
|
|
16
|
+
export { version };
|
package/dist/index.js
CHANGED
|
@@ -4,17 +4,36 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.media =
|
|
14
|
-
var
|
|
15
|
-
exports.
|
|
16
|
-
var
|
|
17
|
-
exports.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
7
|
+
Object.defineProperty(exports, "Logger", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _jsLogger["default"];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.version = exports.urls = exports.streaming = exports.media = void 0;
|
|
14
|
+
var _media = _interopRequireWildcard(require("./media"));
|
|
15
|
+
exports.media = _media;
|
|
16
|
+
var _streaming = _interopRequireWildcard(require("./streaming"));
|
|
17
|
+
exports.streaming = _streaming;
|
|
18
|
+
var _urls = _interopRequireWildcard(require("./urls"));
|
|
19
|
+
exports.urls = _urls;
|
|
20
|
+
var _jsLogger = _interopRequireDefault(require("js-logger"));
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
/**
|
|
25
|
+
* Media APIs.
|
|
26
|
+
* @link https://docs.dolby.io/media-apis/reference
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Dolby Millicast APIs.
|
|
31
|
+
* @link https://docs.dolby.io/streaming-apis/reference
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** @ignore */
|
|
35
|
+
|
|
36
|
+
// Expose the logger to control when/where to log
|
|
37
|
+
|
|
38
|
+
/** Gets the version of this library. */
|
|
39
|
+
var version = exports.version = "5.0.0";
|
|
@@ -7,18 +7,19 @@ exports.upload = exports.sendPut = exports.sendPost = exports.sendPatch = export
|
|
|
7
7
|
var _fs = _interopRequireDefault(require("fs"));
|
|
8
8
|
var _followRedirects = require("follow-redirects");
|
|
9
9
|
var _https = _interopRequireDefault(require("https"));
|
|
10
|
+
var _jsLogger = _interopRequireDefault(require("js-logger"));
|
|
10
11
|
var _url = require("url");
|
|
11
12
|
var _index = require("../index");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
14
|
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); }
|
|
14
|
-
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
|
|
15
|
-
function asyncGeneratorStep(
|
|
16
|
-
function _asyncToGenerator(
|
|
15
|
+
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; }
|
|
16
|
+
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); }
|
|
17
|
+
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); }); }; }
|
|
17
18
|
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
19
|
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(
|
|
20
|
-
function _toPropertyKey(
|
|
21
|
-
function _toPrimitive(
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
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
23
|
/**
|
|
23
24
|
* Sends a POST request.
|
|
24
25
|
*
|
|
@@ -44,7 +45,7 @@ var sendRequest = function sendRequest(options) {
|
|
|
44
45
|
// Override the User Agent
|
|
45
46
|
opts.headers['User-Agent'] = "DolbyIoRestApiSdk/".concat(_index.version, "; Node/").concat(process.versions.node);
|
|
46
47
|
var req = _followRedirects.https.request(opts, function (res) {
|
|
47
|
-
|
|
48
|
+
_jsLogger["default"].info("[".concat(opts.method, "] ").concat(res.statusCode, " - https://").concat(opts.hostname).concat(opts.path));
|
|
48
49
|
var data = '';
|
|
49
50
|
res.on('data', function (chunk) {
|
|
50
51
|
data = data + chunk.toString();
|
|
@@ -67,7 +68,7 @@ var sendRequest = function sendRequest(options) {
|
|
|
67
68
|
});
|
|
68
69
|
});
|
|
69
70
|
req.on('error', function (error) {
|
|
70
|
-
|
|
71
|
+
_jsLogger["default"].error(error);
|
|
71
72
|
reject(error);
|
|
72
73
|
});
|
|
73
74
|
if (options.body && options.body.length > 0) {
|
|
@@ -99,12 +100,6 @@ var sendGet = exports.sendGet = function sendGet(options) {
|
|
|
99
100
|
* @returns A JSON payload object through a {@link Promise}.
|
|
100
101
|
*/
|
|
101
102
|
var sendPost = exports.sendPost = function sendPost(options) {
|
|
102
|
-
if (!options.body) {
|
|
103
|
-
// The REST APIs don't support an empty payload
|
|
104
|
-
options.body = '{}';
|
|
105
|
-
options.headers['Content-Type'] = 'application/json';
|
|
106
|
-
}
|
|
107
|
-
options.headers['Content-Length'] = options.body.length;
|
|
108
103
|
var sendRequestOptions = _objectSpread({
|
|
109
104
|
method: 'POST'
|
|
110
105
|
}, options);
|
|
@@ -119,7 +114,6 @@ var sendPost = exports.sendPost = function sendPost(options) {
|
|
|
119
114
|
* @returns A JSON payload object through a {@link Promise}.
|
|
120
115
|
*/
|
|
121
116
|
var sendPut = exports.sendPut = function sendPut(options) {
|
|
122
|
-
options.headers['Content-Length'] = options.body.length;
|
|
123
117
|
var sendRequestOptions = _objectSpread({
|
|
124
118
|
method: 'PUT'
|
|
125
119
|
}, options);
|
|
@@ -215,7 +209,7 @@ var download = exports.download = function download(filepath, options) {
|
|
|
215
209
|
// Override the User Agent
|
|
216
210
|
opts.headers['User-Agent'] = "DolbyIoRestApiSdk/".concat(_index.version, "; Node/").concat(process.versions.node);
|
|
217
211
|
var req = _followRedirects.https.request(opts, function (res) {
|
|
218
|
-
|
|
212
|
+
_jsLogger["default"].info("[".concat(opts.method, "] ").concat(res.statusCode, " - https://").concat(opts.hostname).concat(opts.path));
|
|
219
213
|
if (res.statusCode < 200 || res.statusCode >= 400) {
|
|
220
214
|
reject('This request has been rejected with the response code ' + res.statusCode);
|
|
221
215
|
return;
|
|
@@ -227,13 +221,13 @@ var download = exports.download = function download(filepath, options) {
|
|
|
227
221
|
resolve();
|
|
228
222
|
});
|
|
229
223
|
fileStream.on('error', function (error) {
|
|
230
|
-
|
|
224
|
+
_jsLogger["default"].error(error);
|
|
231
225
|
reject(error);
|
|
232
226
|
});
|
|
233
227
|
res.pipe(fileStream);
|
|
234
228
|
});
|
|
235
229
|
req.on('error', function (error) {
|
|
236
|
-
|
|
230
|
+
_jsLogger["default"].error(error);
|
|
237
231
|
reject(error);
|
|
238
232
|
});
|
|
239
233
|
if (options.body && options.body.length > 0) {
|
|
@@ -260,7 +254,7 @@ var upload = exports.upload = function upload(filepath, uploadUrl) {
|
|
|
260
254
|
}
|
|
261
255
|
};
|
|
262
256
|
var req = _https["default"].request(uploadUrl, opts, function (res) {
|
|
263
|
-
|
|
257
|
+
_jsLogger["default"].info("[".concat(opts.method, "] ").concat(res.statusCode, " - ").concat(uploadUrl));
|
|
264
258
|
if (res.statusCode < 200 || res.statusCode >= 400) {
|
|
265
259
|
reject('This request has been rejected with the response code ' + res.statusCode);
|
|
266
260
|
} else {
|
|
@@ -268,7 +262,7 @@ var upload = exports.upload = function upload(filepath, uploadUrl) {
|
|
|
268
262
|
}
|
|
269
263
|
});
|
|
270
264
|
req.on('error', function (error) {
|
|
271
|
-
|
|
265
|
+
_jsLogger["default"].error(error);
|
|
272
266
|
reject(error);
|
|
273
267
|
});
|
|
274
268
|
|
package/dist/media/analyze.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JwtToken from '
|
|
1
|
+
import { JwtToken } from './types/jwtToken';
|
|
2
2
|
import { AnalyzeJob } from './types/analyze';
|
|
3
3
|
/**
|
|
4
4
|
* Starts analyzing to learn about your media.
|
|
@@ -11,11 +11,6 @@ import { AnalyzeJob } from './types/analyze';
|
|
|
11
11
|
*
|
|
12
12
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-post
|
|
13
13
|
*
|
|
14
|
-
* Beta API
|
|
15
|
-
* This API is being made available as an early preview.
|
|
16
|
-
* If you have feedback on how you'd like to use the API please reach out to share your feedback with our team.
|
|
17
|
-
* https://dolby.io/contact
|
|
18
|
-
*
|
|
19
14
|
* Content Length
|
|
20
15
|
*
|
|
21
16
|
* Media content with duration less than 2 seconds will not be processed. The API will return an ERROR in this case.
|
package/dist/media/analyze.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.start = exports.getResults = void 0;
|
|
8
8
|
var _jobsHelpers = require("./internal/jobsHelpers");
|
|
9
|
-
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
|
|
10
|
-
function asyncGeneratorStep(
|
|
11
|
-
function _asyncToGenerator(
|
|
9
|
+
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; }
|
|
10
|
+
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); }
|
|
11
|
+
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); }); }; }
|
|
12
12
|
/**
|
|
13
13
|
* Starts analyzing to learn about your media.
|
|
14
14
|
*
|
|
@@ -20,11 +20,6 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
20
20
|
*
|
|
21
21
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-post
|
|
22
22
|
*
|
|
23
|
-
* Beta API
|
|
24
|
-
* This API is being made available as an early preview.
|
|
25
|
-
* If you have feedback on how you'd like to use the API please reach out to share your feedback with our team.
|
|
26
|
-
* https://dolby.io/contact
|
|
27
|
-
*
|
|
28
23
|
* Content Length
|
|
29
24
|
*
|
|
30
25
|
* Media content with duration less than 2 seconds will not be processed. The API will return an ERROR in this case.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JwtToken from '
|
|
1
|
+
import { JwtToken } from './types/jwtToken';
|
|
2
2
|
import { AnalyzeMusicJob } from './types/analyzeMusic';
|
|
3
3
|
/**
|
|
4
4
|
* Start analyzing to learn about music in your media.
|
|
@@ -9,11 +9,6 @@ import { AnalyzeMusicJob } from './types/analyzeMusic';
|
|
|
9
9
|
*
|
|
10
10
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-music-post
|
|
11
11
|
*
|
|
12
|
-
* Beta API
|
|
13
|
-
* This API is being made available as an early preview.
|
|
14
|
-
* If you have feedback on how you'd like to use the API please reach out to share your feedback with our team.
|
|
15
|
-
* https://dolby.io/contact
|
|
16
|
-
*
|
|
17
12
|
* @param accessToken Access token to use for authentication.
|
|
18
13
|
* @param jobContent Content of the job description as a JSON payload. You can find the definition at this URL: https://docs.dolby.io/media-apis/reference/media-analyze-music-post
|
|
19
14
|
*
|