@dolbyio/dolbyio-rest-apis-client 4.1.0 → 5.0.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/LICENSE +1 -1
- package/README.md +38 -72
- package/dist/index.d.ts +2 -8
- package/dist/index.js +13 -32
- package/dist/internal/httpHelpers.js +14 -20
- 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 +1 -0
- package/dist/media/index.js +5 -2
- package/dist/media/internal/httpHelpers.d.ts +1 -1
- package/dist/media/internal/httpHelpers.js +1 -1
- package/dist/media/internal/jobsHelpers.d.ts +1 -1
- package/dist/media/internal/jobsHelpers.js +4 -4
- package/dist/media/io.d.ts +1 -1
- package/dist/media/io.js +4 -4
- package/dist/media/jobs.d.ts +1 -1
- package/dist/media/jobs.js +4 -4
- 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 +1 -0
- package/dist/media/types/index.js +11 -0
- package/dist/media/types/jobs.d.ts +2 -0
- package/dist/media/types/webhooks.d.ts +6 -7
- package/dist/media/webhooks.d.ts +1 -1
- package/dist/media/webhooks.js +4 -4
- package/dist/streaming/account.d.ts +27 -3
- package/dist/streaming/account.js +98 -7
- package/dist/streaming/cluster.js +4 -4
- package/dist/streaming/director.js +4 -4
- package/dist/streaming/index.d.ts +11 -3
- package/dist/streaming/index.js +12 -6
- package/dist/streaming/internal/httpHelpers.js +4 -4
- package/dist/streaming/publishToken.js +5 -5
- package/dist/streaming/recordFiles.d.ts +55 -0
- package/dist/streaming/recordFiles.js +214 -0
- package/dist/streaming/stream.d.ts +8 -3
- package/dist/streaming/stream.js +18 -10
- package/dist/streaming/subscribeToken.js +14 -14
- package/dist/streaming/transcoders.d.ts +143 -0
- package/dist/streaming/transcoders.js +481 -0
- package/dist/streaming/types/account.d.ts +11 -2
- package/dist/streaming/types/cluster.d.ts +14 -5
- package/dist/streaming/types/core.d.ts +1 -0
- package/dist/streaming/types/director.d.ts +9 -11
- package/dist/streaming/types/index.d.ts +4 -1
- package/dist/streaming/types/index.js +41 -8
- package/dist/streaming/types/publishToken.d.ts +93 -35
- 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 +37 -42
- package/dist/streaming/types/transcoders.d.ts +136 -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 +13 -12
- 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 -38
- 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/core.js +0 -5
- package/dist/communications/types/index.d.ts +0 -13
- package/dist/communications/types/index.js +0 -131
- package/dist/communications/types/mixOptions.d.ts +0 -39
- package/dist/communications/types/mixOptions.js +0 -5
- 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.d.ts +0 -16
- 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 -24
- package/dist/streaming/geo.js +0 -103
- package/dist/streaming/types/geo.d.ts +0 -9
- package/dist/streaming/types/geo.js +0 -5
- /package/dist/{types → media/types}/jwtToken.d.ts +0 -0
- /package/dist/{types → media/types}/jwtToken.js +0 -0
- /package/dist/{communications/types/authentication.js → streaming/types/recordFiles.js} +0 -0
- /package/dist/{communications/types/conference.js → streaming/types/stream.js} +0 -0
- /package/dist/{communications/types/conferences.js → streaming/types/transcoders.js} +0 -0
- /package/dist/{communications → streaming}/types/webhooks.js +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -3,25 +3,29 @@
|
|
|
3
3
|
[](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/publish-package.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@dolbyio/dolbyio-rest-apis-client)
|
|
5
5
|
[](LICENSE)
|
|
6
|
+
[](https://github.com/DolbyIO/dolbyio-rest-apis-client-node)
|
|
7
|
+
[](https://api-references.dolby.io/dolbyio-rest-apis-client-node/)
|
|
6
8
|
|
|
7
|
-
Dolby.io REST APIs Client for Node.JS is wrapper for the
|
|
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.
|
|
8
10
|
|
|
9
11
|
# Install this project
|
|
10
12
|
|
|
11
13
|
Run the npm command to install the package `@dolbyio/dolbyio-rest-apis-client` into your Node project:
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
npm install @dolbyio/dolbyio-rest-apis-client
|
|
16
|
+
npm install @dolbyio/dolbyio-rest-apis-client
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
#
|
|
19
|
+
# Dolby Millicast Examples
|
|
18
20
|
|
|
19
21
|
## Create a publish token
|
|
20
22
|
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
+
```ts
|
|
24
|
+
import { streaming } from '@dolbyio/dolbyio-rest-apis-client';
|
|
25
|
+
|
|
26
|
+
const API_KEY = process.env.DOLBYIO_API_SECRET;
|
|
23
27
|
|
|
24
|
-
const publishToken = await
|
|
28
|
+
const publishToken = await streaming.publishToken.create(API_KEY, {
|
|
25
29
|
label: 'My token',
|
|
26
30
|
streams: [
|
|
27
31
|
{
|
|
@@ -34,10 +38,12 @@ console.log(publishToken);
|
|
|
34
38
|
|
|
35
39
|
## Create a subscribe token
|
|
36
40
|
|
|
37
|
-
```
|
|
38
|
-
|
|
41
|
+
```ts
|
|
42
|
+
import { streaming } from '@dolbyio/dolbyio-rest-apis-client';
|
|
39
43
|
|
|
40
|
-
const
|
|
44
|
+
const API_KEY = process.env.DOLBYIO_API_SECRET;
|
|
45
|
+
|
|
46
|
+
const subscribeToken = await streaming.subscribeToken.create(API_KEY, {
|
|
41
47
|
label: 'My token',
|
|
42
48
|
streams: [
|
|
43
49
|
{
|
|
@@ -56,14 +62,14 @@ Here is an example on how to upload a file to the Dolby.io temporary cloud stora
|
|
|
56
62
|
|
|
57
63
|
Get the App Key and Secret from the Dolby.io dashboard and use the following code in your python script.
|
|
58
64
|
|
|
59
|
-
```
|
|
60
|
-
|
|
65
|
+
```ts
|
|
66
|
+
import { media } from '@dolbyio/dolbyio-rest-apis-client';
|
|
61
67
|
|
|
62
|
-
const APP_KEY =
|
|
63
|
-
const APP_SECRET =
|
|
68
|
+
const APP_KEY = process.env.DOLBYIO_APP_KEY;
|
|
69
|
+
const APP_SECRET = process.env.DOLBYIO_APP_SECRET;
|
|
64
70
|
|
|
65
71
|
// Request an Access Token
|
|
66
|
-
const jwt = await
|
|
72
|
+
const jwt = await media.authentication.getApiAccessToken(APP_KEY, APP_SECRET);
|
|
67
73
|
console.log('Access token', jwt);
|
|
68
74
|
```
|
|
69
75
|
|
|
@@ -71,20 +77,20 @@ console.log('Access token', jwt);
|
|
|
71
77
|
|
|
72
78
|
Upload a media file to the Dolby.io temporary cloud storage for processing:
|
|
73
79
|
|
|
74
|
-
```
|
|
80
|
+
```ts
|
|
75
81
|
// Temporary storage URL that will be used as reference for the job processing
|
|
76
82
|
const inputUrl = 'dlb://in/file.mp4';
|
|
77
83
|
// Local path of the file to upload
|
|
78
84
|
const originalFilePath = '/path/to/original_file.mp4';
|
|
79
85
|
|
|
80
|
-
await
|
|
86
|
+
await media.io.uploadFile(jwt, inputUrl, originalFilePath);
|
|
81
87
|
```
|
|
82
88
|
|
|
83
89
|
## Start an enhance job
|
|
84
90
|
|
|
85
91
|
Generate a job description and send it to Dolby.io.
|
|
86
92
|
|
|
87
|
-
```
|
|
93
|
+
```ts
|
|
88
94
|
// Temporary storage URL that will be used as reference for the job processing
|
|
89
95
|
const outputUrl = 'dlb://out/file.mp4';
|
|
90
96
|
|
|
@@ -94,7 +100,7 @@ const jobDescription = JSON.stringify({
|
|
|
94
100
|
output: outputUrl,
|
|
95
101
|
});
|
|
96
102
|
|
|
97
|
-
const jobId = await
|
|
103
|
+
const jobId = await media.enhance.start(jwt, jobDescription);
|
|
98
104
|
console.log(`Job ID: ${jobId}`);
|
|
99
105
|
```
|
|
100
106
|
|
|
@@ -105,12 +111,12 @@ Get the job status and wait until it is completed.
|
|
|
105
111
|
```javascript
|
|
106
112
|
const sleep = (delay) => new Promise((r) => setTimeout(r, delay));
|
|
107
113
|
|
|
108
|
-
let result = await
|
|
114
|
+
let result = await media.enhance.getResults(jwt, jobId);
|
|
109
115
|
while (result.status === 'Pending' || result.status === 'Running') {
|
|
110
116
|
console.log(`Job status is ${result.status}, taking a 5 second break...`);
|
|
111
117
|
await sleep(5000);
|
|
112
118
|
|
|
113
|
-
result = await
|
|
119
|
+
result = await media.enhance.getResults(jwt, jobId);
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
if (result.status !== 'Success') {
|
|
@@ -127,64 +133,19 @@ At this stage, the file has been processed and written to the temporary storage
|
|
|
127
133
|
// Local path where to download the file to
|
|
128
134
|
const enhancedFilePath = '/path/to/enhanced_file.mp4';
|
|
129
135
|
|
|
130
|
-
await
|
|
136
|
+
await media.io.downloadFile(jwt, outputUrl, enhancedFilePath);
|
|
131
137
|
```
|
|
132
138
|
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
## Authenticate
|
|
136
|
-
|
|
137
|
-
To get an access token that will be used by the client SDK for an end user to open a session against dolby.io, use the following code:
|
|
139
|
+
# Logs
|
|
138
140
|
|
|
139
|
-
|
|
140
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
141
|
-
|
|
142
|
-
const APP_KEY = 'YOUR_APP_KEY';
|
|
143
|
-
const APP_SECRET = 'YOUR_APP_SECRET';
|
|
141
|
+
You can also print the logs in the console and select the log level by using the following code.
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
```ts
|
|
144
|
+
import { Logger } from '@dolbyio/dolbyio-rest-apis-client';
|
|
147
145
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
accessToken: api_token,
|
|
151
|
-
sessionScope: ['*'],
|
|
146
|
+
Logger.useDefaults({
|
|
147
|
+
defaultLevel: Logger.TRACE,
|
|
152
148
|
});
|
|
153
|
-
|
|
154
|
-
console.log(`Client Access Token: ${cat.access_token}`);
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## Create a conference
|
|
158
|
-
|
|
159
|
-
To create a Dolby Voice conference, you first must retrieve an API Access Token, then use the following code to create the conference.
|
|
160
|
-
|
|
161
|
-
```javascript
|
|
162
|
-
const dolbyio = require('@dolbyio/dolbyio-rest-apis-client');
|
|
163
|
-
|
|
164
|
-
const APP_KEY = 'YOUR_APP_KEY';
|
|
165
|
-
const APP_SECRET = 'YOUR_APP_SECRET';
|
|
166
|
-
|
|
167
|
-
const ownerExternalId = ''; // Identifier of the owner of the conference
|
|
168
|
-
const alias = ''; // Conference alias
|
|
169
|
-
|
|
170
|
-
const options = {
|
|
171
|
-
ownerExternalId: ownerExternalId,
|
|
172
|
-
alias: alias,
|
|
173
|
-
dolbyVoice: true,
|
|
174
|
-
liveRecording: false,
|
|
175
|
-
participants: [
|
|
176
|
-
{ externalId: 'hostA', permissions: ['JOIN', 'SEND_AUDIO', 'SEND_VIDEO'], notify: true },
|
|
177
|
-
{ externalId: 'listener1', permissions: ['JOIN'], notify: false },
|
|
178
|
-
],
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
// Request an API Token
|
|
182
|
-
const jwt = await dolbyio.authentication.getApiAccessToken(APP_KEY, APP_SECRET, 3600, ['comms:conf:create']);
|
|
183
|
-
|
|
184
|
-
// Create the conference
|
|
185
|
-
const conference = await dolbyio.communications.conference.createConference(jwt, options);
|
|
186
|
-
|
|
187
|
-
console.log(`Conference created: ${conference.conferenceId}`);
|
|
188
149
|
```
|
|
189
150
|
|
|
190
151
|
# How to
|
|
@@ -200,3 +161,8 @@ The documentation is built on [TypeDoc](https://typedoc.org), to generate the do
|
|
|
200
161
|
```bash
|
|
201
162
|
npm run docs
|
|
202
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,22 +1,16 @@
|
|
|
1
|
-
export * as authentication from './authentication';
|
|
2
|
-
export * from './types/jwtToken';
|
|
3
|
-
/**
|
|
4
|
-
* Communications APIs.
|
|
5
|
-
* @link https://docs.dolby.io/communications-apis/reference
|
|
6
|
-
*/
|
|
7
|
-
export * as communications from './communications';
|
|
8
1
|
/**
|
|
9
2
|
* Media APIs.
|
|
10
3
|
* @link https://docs.dolby.io/media-apis/reference
|
|
11
4
|
*/
|
|
12
5
|
export * as media from './media';
|
|
13
6
|
/**
|
|
14
|
-
*
|
|
7
|
+
* Dolby Millicast APIs.
|
|
15
8
|
* @link https://docs.dolby.io/streaming-apis/reference
|
|
16
9
|
*/
|
|
17
10
|
export * as streaming from './streaming';
|
|
18
11
|
/** @ignore */
|
|
19
12
|
export * as urls from './urls';
|
|
13
|
+
export { default as Logger } from 'js-logger';
|
|
20
14
|
/** Gets the version of this library. */
|
|
21
15
|
declare const version: string;
|
|
22
16
|
export { version };
|
package/dist/index.js
CHANGED
|
@@ -4,55 +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
|
-
streaming: true,
|
|
13
|
-
urls: true
|
|
14
|
-
};
|
|
15
|
-
exports.version = exports.urls = exports.streaming = exports.media = exports.communications = exports.authentication = void 0;
|
|
16
|
-
var _authentication = _interopRequireWildcard(require("./authentication"));
|
|
17
|
-
exports.authentication = _authentication;
|
|
18
|
-
var _jwtToken = require("./types/jwtToken");
|
|
19
|
-
Object.keys(_jwtToken).forEach(function (key) {
|
|
20
|
-
if (key === "default" || key === "__esModule") return;
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
22
|
-
if (key in exports && exports[key] === _jwtToken[key]) return;
|
|
23
|
-
Object.defineProperty(exports, key, {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function get() {
|
|
26
|
-
return _jwtToken[key];
|
|
27
|
-
}
|
|
28
|
-
});
|
|
7
|
+
Object.defineProperty(exports, "Logger", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _jsLogger["default"];
|
|
11
|
+
}
|
|
29
12
|
});
|
|
30
|
-
|
|
31
|
-
exports.communications = _communications;
|
|
13
|
+
exports.version = exports.urls = exports.streaming = exports.media = void 0;
|
|
32
14
|
var _media = _interopRequireWildcard(require("./media"));
|
|
33
15
|
exports.media = _media;
|
|
34
16
|
var _streaming = _interopRequireWildcard(require("./streaming"));
|
|
35
17
|
exports.streaming = _streaming;
|
|
36
18
|
var _urls = _interopRequireWildcard(require("./urls"));
|
|
37
19
|
exports.urls = _urls;
|
|
20
|
+
var _jsLogger = _interopRequireDefault(require("js-logger"));
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
38
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); }
|
|
39
|
-
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 &&
|
|
40
|
-
/**
|
|
41
|
-
* Communications APIs.
|
|
42
|
-
* @link https://docs.dolby.io/communications-apis/reference
|
|
43
|
-
*/
|
|
44
|
-
|
|
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; }
|
|
45
24
|
/**
|
|
46
25
|
* Media APIs.
|
|
47
26
|
* @link https://docs.dolby.io/media-apis/reference
|
|
48
27
|
*/
|
|
49
28
|
|
|
50
29
|
/**
|
|
51
|
-
*
|
|
30
|
+
* Dolby Millicast APIs.
|
|
52
31
|
* @link https://docs.dolby.io/streaming-apis/reference
|
|
53
32
|
*/
|
|
54
33
|
|
|
55
34
|
/** @ignore */
|
|
56
35
|
|
|
36
|
+
// Expose the logger to control when/where to log
|
|
37
|
+
|
|
57
38
|
/** Gets the version of this library. */
|
|
58
|
-
var version = exports.version = "
|
|
39
|
+
var version = exports.version = "5.0.1";
|
|
@@ -7,17 +7,18 @@ 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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i :
|
|
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 + ""; }
|
|
21
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.
|
|
@@ -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
|
*
|