@dolbyio/dolbyio-rest-apis-client 2.1.1 → 3.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/README.md +12 -12
- package/dist/communications/authentication.d.ts +10 -10
- package/dist/communications/authentication.js +16 -16
- package/dist/communications/authentication.js.map +1 -1
- package/dist/communications/conference.d.ts +0 -12
- package/dist/communications/conference.js +1 -26
- package/dist/communications/conference.js.map +1 -1
- package/dist/communications/streaming.d.ts +8 -55
- package/dist/communications/streaming.js +19 -114
- package/dist/communications/streaming.js.map +1 -1
- package/dist/internal/httpHelpers.d.ts +6 -6
- package/dist/internal/httpHelpers.js +7 -7
- package/dist/internal/httpHelpers.js.map +1 -1
- package/dist/media/analyze.d.ts +4 -4
- package/dist/media/analyze.js +6 -6
- package/dist/media/analyze.js.map +1 -1
- package/dist/media/analyzeSpeech.d.ts +4 -4
- package/dist/media/analyzeSpeech.js +6 -6
- package/dist/media/analyzeSpeech.js.map +1 -1
- package/dist/media/diagnose.d.ts +4 -4
- package/dist/media/diagnose.js +6 -6
- package/dist/media/diagnose.js.map +1 -1
- package/dist/media/enhance.d.ts +4 -4
- package/dist/media/enhance.js +6 -6
- package/dist/media/enhance.js.map +1 -1
- package/dist/media/internal/httpHelpers.d.ts +5 -5
- package/dist/media/internal/httpHelpers.js +5 -30
- package/dist/media/internal/httpHelpers.js.map +1 -1
- package/dist/media/io.d.ts +4 -4
- package/dist/media/io.js +6 -6
- package/dist/media/io.js.map +1 -1
- package/dist/media/jobs.d.ts +6 -6
- package/dist/media/jobs.js +9 -9
- package/dist/media/jobs.js.map +1 -1
- package/dist/media/mastering.d.ts +8 -8
- package/dist/media/mastering.js +12 -12
- package/dist/media/mastering.js.map +1 -1
- package/dist/media/platform.d.ts +5 -8
- package/dist/media/platform.js +13 -13
- package/dist/media/platform.js.map +1 -1
- package/dist/media/transcode.d.ts +4 -4
- package/dist/media/transcode.js +6 -6
- package/dist/media/transcode.js.map +1 -1
- package/dist/media/webhooks.d.ts +8 -8
- package/dist/media/webhooks.js +12 -12
- package/dist/media/webhooks.js.map +1 -1
- package/package.json +5 -1
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.download = exports.sendDelete = exports.sendPut = exports.sendPost = exports.sendGet = void 0;
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const
|
|
17
|
+
const follow_redirects_1 = require("follow-redirects");
|
|
18
18
|
const url_1 = require("url");
|
|
19
19
|
/**
|
|
20
20
|
* Sends a POST request.
|
|
@@ -24,7 +24,7 @@ const url_1 = require("url");
|
|
|
24
24
|
* @returns A JSON payload object through a Promise.
|
|
25
25
|
*/
|
|
26
26
|
const sendRequest = (options) => {
|
|
27
|
-
return new Promise(
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
28
|
let path = options.path;
|
|
29
29
|
if (options.params && Object.keys(options.params).length > 0) {
|
|
30
30
|
const searchParams = new url_1.URLSearchParams(options.params);
|
|
@@ -37,8 +37,8 @@ const sendRequest = (options) => {
|
|
|
37
37
|
method: options.method,
|
|
38
38
|
headers: options.headers,
|
|
39
39
|
};
|
|
40
|
-
const req =
|
|
41
|
-
console.log(`[${
|
|
40
|
+
const req = follow_redirects_1.https.request(opts, (res) => {
|
|
41
|
+
console.log(`[${opts.method}] ${res.statusCode} - https://${opts.hostname}${opts.path}`);
|
|
42
42
|
let data = '';
|
|
43
43
|
res.on('data', (chunk) => {
|
|
44
44
|
data = data + chunk.toString();
|
|
@@ -125,7 +125,7 @@ exports.sendDelete = sendDelete;
|
|
|
125
125
|
*/
|
|
126
126
|
const download = (filepath, options) => {
|
|
127
127
|
const sendRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
128
|
-
return new Promise(
|
|
128
|
+
return new Promise((resolve, reject) => {
|
|
129
129
|
let path = sendRequestOptions.path;
|
|
130
130
|
if (sendRequestOptions.params && Object.keys(sendRequestOptions.params).length > 0) {
|
|
131
131
|
const searchParams = new url_1.URLSearchParams(sendRequestOptions.params);
|
|
@@ -138,8 +138,8 @@ const download = (filepath, options) => {
|
|
|
138
138
|
method: sendRequestOptions.method,
|
|
139
139
|
headers: sendRequestOptions.headers,
|
|
140
140
|
};
|
|
141
|
-
const req =
|
|
142
|
-
console.log(`[${
|
|
141
|
+
const req = follow_redirects_1.https.request(opts, (res) => {
|
|
142
|
+
console.log(`[${opts.method}] ${res.statusCode} - https://${opts.hostname}${opts.path}`);
|
|
143
143
|
const fileStream = fs_1.default.createWriteStream(filepath, { autoClose: true });
|
|
144
144
|
fileStream.on('finish', () => {
|
|
145
145
|
resolve();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../../src/internal/httpHelpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,
|
|
1
|
+
{"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../../src/internal/httpHelpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,uDAAyC;AAGzC,6BAAsC;AActC;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,CAAC,OAA2B,EAAE,EAAE;IAChD,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACxB,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1D,MAAM,YAAY,GAAG,IAAI,qBAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACzD,IAAI,IAAI,IAAI,YAAY,EAAE,CAAC;SAC9B;QAED,MAAM,IAAI,GAA6B;YACnC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IA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,CAAC;gBACrB,MAAM,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,MAAM,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACzC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC3B;QAED,GAAG,CAAC,GAAG,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAjDW,QAAA,QAAQ,YAiDnB"}
|
package/dist/media/analyze.d.ts
CHANGED
|
@@ -20,12 +20,12 @@ import { AnalyzeJob } from './types/analyze';
|
|
|
20
20
|
*
|
|
21
21
|
* Media content with duration less than 2 seconds will not be processed. The API will return an ERROR in this case.
|
|
22
22
|
*
|
|
23
|
-
* @param
|
|
23
|
+
* @param accessToken Access token to use for authentication.
|
|
24
24
|
* @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-post
|
|
25
25
|
*
|
|
26
26
|
* @returns The job identifier through a `Promise`.
|
|
27
27
|
*/
|
|
28
|
-
export declare const start: (
|
|
28
|
+
export declare const start: (accessToken: JwtToken, jobContent: string) => Promise<string | null>;
|
|
29
29
|
/**
|
|
30
30
|
* Gets Analyze Status.
|
|
31
31
|
*
|
|
@@ -35,9 +35,9 @@ export declare const start: (auth: string | JwtToken, jobContent: string) => Pro
|
|
|
35
35
|
*
|
|
36
36
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-get
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
38
|
+
* @param accessToken Access token to use for authentication.
|
|
39
39
|
* @param jobId Identifier of the job to retrieve.
|
|
40
40
|
*
|
|
41
41
|
* @returns The `AnalyzeJob` object through a `Promise`.
|
|
42
42
|
*/
|
|
43
|
-
export declare const getResults: (
|
|
43
|
+
export declare const getResults: (accessToken: JwtToken, jobId: string) => Promise<AnalyzeJob>;
|
package/dist/media/analyze.js
CHANGED
|
@@ -31,17 +31,17 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
31
31
|
*
|
|
32
32
|
* Media content with duration less than 2 seconds will not be processed. The API will return an ERROR in this case.
|
|
33
33
|
*
|
|
34
|
-
* @param
|
|
34
|
+
* @param accessToken Access token to use for authentication.
|
|
35
35
|
* @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-post
|
|
36
36
|
*
|
|
37
37
|
* @returns The job identifier through a `Promise`.
|
|
38
38
|
*/
|
|
39
|
-
const start = (
|
|
39
|
+
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
40
|
const requestOptions = {
|
|
41
41
|
hostname: 'api.dolby.com',
|
|
42
42
|
path: '/media/analyze',
|
|
43
43
|
headers: {},
|
|
44
|
-
|
|
44
|
+
accessToken,
|
|
45
45
|
body: jobContent,
|
|
46
46
|
};
|
|
47
47
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -60,12 +60,12 @@ exports.start = start;
|
|
|
60
60
|
*
|
|
61
61
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-get
|
|
62
62
|
*
|
|
63
|
-
* @param
|
|
63
|
+
* @param accessToken Access token to use for authentication.
|
|
64
64
|
* @param jobId Identifier of the job to retrieve.
|
|
65
65
|
*
|
|
66
66
|
* @returns The `AnalyzeJob` object through a `Promise`.
|
|
67
67
|
*/
|
|
68
|
-
const getResults = (
|
|
68
|
+
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
69
|
const requestOptions = {
|
|
70
70
|
hostname: 'api.dolby.com',
|
|
71
71
|
path: '/media/analyze',
|
|
@@ -73,7 +73,7 @@ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function*
|
|
|
73
73
|
job_id: jobId,
|
|
74
74
|
},
|
|
75
75
|
headers: {},
|
|
76
|
-
|
|
76
|
+
accessToken,
|
|
77
77
|
};
|
|
78
78
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
79
79
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/media/analyze.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,KAAK,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/media/analyze.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,EAAE;QACX,WAAW;QACX,IAAI,EAAE,UAAU;KACnB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAQ,EAAC,cAAc,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACnC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC7B;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAfW,QAAA,KAAK,SAehB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAuB,EAAE;IAC1F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE;YACJ,MAAM,EAAE,KAAK;SAChB;QACD,OAAO,EAAE,EAAE;QACX,WAAW;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAO,EAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,QAAsB,CAAC;AAClC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
|
@@ -14,12 +14,12 @@ import { AnalyzeSpeechJob } from './types/analyzeSpeech';
|
|
|
14
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
15
|
* https://dolby.io/contact
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
17
|
+
* @param accessToken Access token to use for authentication.
|
|
18
18
|
* @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-speech-post
|
|
19
19
|
*
|
|
20
20
|
* @returns The job identifier through a `Promise`.
|
|
21
21
|
*/
|
|
22
|
-
export declare const start: (
|
|
22
|
+
export declare const start: (accessToken: JwtToken, jobContent: string) => Promise<string | null>;
|
|
23
23
|
/**
|
|
24
24
|
* Gets Speech Analytics Status.
|
|
25
25
|
*
|
|
@@ -29,9 +29,9 @@ export declare const start: (auth: string | JwtToken, jobContent: string) => Pro
|
|
|
29
29
|
*
|
|
30
30
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-speech-get
|
|
31
31
|
*
|
|
32
|
-
* @param
|
|
32
|
+
* @param accessToken Access token to use for authentication.
|
|
33
33
|
* @param jobId Identifier of the job to retrieve.
|
|
34
34
|
*
|
|
35
35
|
* @returns The `AnalyzeSpeechJob` object through a `Promise`.
|
|
36
36
|
*/
|
|
37
|
-
export declare const getResults: (
|
|
37
|
+
export declare const getResults: (accessToken: JwtToken, jobId: string) => Promise<AnalyzeSpeechJob>;
|
|
@@ -25,17 +25,17 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
25
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
26
|
* https://dolby.io/contact
|
|
27
27
|
*
|
|
28
|
-
* @param
|
|
28
|
+
* @param accessToken Access token to use for authentication.
|
|
29
29
|
* @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-speech-post
|
|
30
30
|
*
|
|
31
31
|
* @returns The job identifier through a `Promise`.
|
|
32
32
|
*/
|
|
33
|
-
const start = (
|
|
33
|
+
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
34
|
const requestOptions = {
|
|
35
35
|
hostname: 'api.dolby.com',
|
|
36
36
|
path: '/media/analyze/speech',
|
|
37
37
|
headers: {},
|
|
38
|
-
|
|
38
|
+
accessToken,
|
|
39
39
|
body: jobContent,
|
|
40
40
|
};
|
|
41
41
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -54,12 +54,12 @@ exports.start = start;
|
|
|
54
54
|
*
|
|
55
55
|
* @link https://docs.dolby.io/media-apis/reference/media-analyze-speech-get
|
|
56
56
|
*
|
|
57
|
-
* @param
|
|
57
|
+
* @param accessToken Access token to use for authentication.
|
|
58
58
|
* @param jobId Identifier of the job to retrieve.
|
|
59
59
|
*
|
|
60
60
|
* @returns The `AnalyzeSpeechJob` object through a `Promise`.
|
|
61
61
|
*/
|
|
62
|
-
const getResults = (
|
|
62
|
+
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
63
|
const requestOptions = {
|
|
64
64
|
hostname: 'api.dolby.com',
|
|
65
65
|
path: '/media/analyze/speech',
|
|
@@ -67,7 +67,7 @@ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function*
|
|
|
67
67
|
job_id: jobId,
|
|
68
68
|
},
|
|
69
69
|
headers: {},
|
|
70
|
-
|
|
70
|
+
accessToken,
|
|
71
71
|
};
|
|
72
72
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
73
73
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeSpeech.js","sourceRoot":"","sources":["../../src/media/analyzeSpeech.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"analyzeSpeech.js","sourceRoot":"","sources":["../../src/media/analyzeSpeech.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,EAAE;QACX,WAAW;QACX,IAAI,EAAE,UAAU;KACnB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAQ,EAAC,cAAc,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACnC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC7B;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAfW,QAAA,KAAK,SAehB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAA6B,EAAE;IAChG,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE;YACJ,MAAM,EAAE,KAAK;SAChB;QACD,OAAO,EAAE,EAAE;QACX,WAAW;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAO,EAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,QAA4B,CAAC;AACxC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
package/dist/media/diagnose.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ import { DiagnoseJob } from './types/diagnose';
|
|
|
14
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
15
|
* https://dolby.io/contact
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
17
|
+
* @param accessToken Access token to use for authentication.
|
|
18
18
|
* @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-diagnose-post
|
|
19
19
|
*
|
|
20
20
|
* @returns The job identifier through a `Promise`.
|
|
21
21
|
*/
|
|
22
|
-
export declare const start: (
|
|
22
|
+
export declare const start: (accessToken: JwtToken, jobContent: string) => Promise<string | null>;
|
|
23
23
|
/**
|
|
24
24
|
* Gets Diagnose Results.
|
|
25
25
|
*
|
|
@@ -31,9 +31,9 @@ export declare const start: (auth: string | JwtToken, jobContent: string) => Pro
|
|
|
31
31
|
*
|
|
32
32
|
* @link https://docs.dolby.io/media-apis/reference/media-diagnose-get
|
|
33
33
|
*
|
|
34
|
-
* @param
|
|
34
|
+
* @param accessToken Access token to use for authentication.
|
|
35
35
|
* @param jobId Identifier of the job to retrieve.
|
|
36
36
|
*
|
|
37
37
|
* @returns The `DiagnoseJob` object through a `Promise`.
|
|
38
38
|
*/
|
|
39
|
-
export declare const getResults: (
|
|
39
|
+
export declare const getResults: (accessToken: JwtToken, jobId: string) => Promise<DiagnoseJob>;
|
package/dist/media/diagnose.js
CHANGED
|
@@ -25,17 +25,17 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
25
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
26
|
* https://dolby.io/contact
|
|
27
27
|
*
|
|
28
|
-
* @param
|
|
28
|
+
* @param accessToken Access token to use for authentication.
|
|
29
29
|
* @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-diagnose-post
|
|
30
30
|
*
|
|
31
31
|
* @returns The job identifier through a `Promise`.
|
|
32
32
|
*/
|
|
33
|
-
const start = (
|
|
33
|
+
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
34
|
const requestOptions = {
|
|
35
35
|
hostname: 'api.dolby.com',
|
|
36
36
|
path: '/media/diagnose',
|
|
37
37
|
headers: {},
|
|
38
|
-
|
|
38
|
+
accessToken,
|
|
39
39
|
body: jobContent,
|
|
40
40
|
};
|
|
41
41
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -56,12 +56,12 @@ exports.start = start;
|
|
|
56
56
|
*
|
|
57
57
|
* @link https://docs.dolby.io/media-apis/reference/media-diagnose-get
|
|
58
58
|
*
|
|
59
|
-
* @param
|
|
59
|
+
* @param accessToken Access token to use for authentication.
|
|
60
60
|
* @param jobId Identifier of the job to retrieve.
|
|
61
61
|
*
|
|
62
62
|
* @returns The `DiagnoseJob` object through a `Promise`.
|
|
63
63
|
*/
|
|
64
|
-
const getResults = (
|
|
64
|
+
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
65
|
const requestOptions = {
|
|
66
66
|
hostname: 'api.dolby.com',
|
|
67
67
|
path: '/media/diagnose',
|
|
@@ -69,7 +69,7 @@ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function*
|
|
|
69
69
|
job_id: jobId,
|
|
70
70
|
},
|
|
71
71
|
headers: {},
|
|
72
|
-
|
|
72
|
+
accessToken,
|
|
73
73
|
};
|
|
74
74
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
75
75
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/media/diagnose.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/media/diagnose.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,EAAE;QACX,WAAW;QACX,IAAI,EAAE,UAAU;KACnB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAQ,EAAC,cAAc,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACnC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC7B;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAfW,QAAA,KAAK,SAehB;AAEF;;;;;;;;;;;;;;;GAeG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAwB,EAAE;IAC3F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE;YACJ,MAAM,EAAE,KAAK;SAChB;QACD,OAAO,EAAE,EAAE;QACX,WAAW;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAO,EAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,QAAuB,CAAC;AACnC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
package/dist/media/enhance.d.ts
CHANGED
|
@@ -11,12 +11,12 @@ import { EnhanceJob } from './types/enhance';
|
|
|
11
11
|
*
|
|
12
12
|
* @link https://docs.dolby.io/media-apis/reference/media-enhance-post
|
|
13
13
|
*
|
|
14
|
-
* @param
|
|
14
|
+
* @param accessToken Access token to use for authentication.
|
|
15
15
|
* @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-enhance-post
|
|
16
16
|
*
|
|
17
17
|
* @returns The job identifier through a `Promise`.
|
|
18
18
|
*/
|
|
19
|
-
export declare const start: (
|
|
19
|
+
export declare const start: (accessToken: JwtToken, jobContent: string) => Promise<string | null>;
|
|
20
20
|
/**
|
|
21
21
|
* Gets Enhance Results
|
|
22
22
|
*
|
|
@@ -26,9 +26,9 @@ export declare const start: (auth: string | JwtToken, jobContent: string) => Pro
|
|
|
26
26
|
*
|
|
27
27
|
* @link https://docs.dolby.io/media-apis/reference/media-enhance-get
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
29
|
+
* @param accessToken Access token to use for authentication.
|
|
30
30
|
* @param jobId Identifier of the job to retrieve.
|
|
31
31
|
*
|
|
32
32
|
* @returns The `EnhanceJob` object through a `Promise`.
|
|
33
33
|
*/
|
|
34
|
-
export declare const getResults: (
|
|
34
|
+
export declare const getResults: (accessToken: JwtToken, jobId: string) => Promise<EnhanceJob>;
|
package/dist/media/enhance.js
CHANGED
|
@@ -22,17 +22,17 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
22
22
|
*
|
|
23
23
|
* @link https://docs.dolby.io/media-apis/reference/media-enhance-post
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
25
|
+
* @param accessToken Access token to use for authentication.
|
|
26
26
|
* @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-enhance-post
|
|
27
27
|
*
|
|
28
28
|
* @returns The job identifier through a `Promise`.
|
|
29
29
|
*/
|
|
30
|
-
const start = (
|
|
30
|
+
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
31
|
const requestOptions = {
|
|
32
32
|
hostname: 'api.dolby.com',
|
|
33
33
|
path: '/media/enhance',
|
|
34
34
|
headers: {},
|
|
35
|
-
|
|
35
|
+
accessToken,
|
|
36
36
|
body: jobContent,
|
|
37
37
|
};
|
|
38
38
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -51,12 +51,12 @@ exports.start = start;
|
|
|
51
51
|
*
|
|
52
52
|
* @link https://docs.dolby.io/media-apis/reference/media-enhance-get
|
|
53
53
|
*
|
|
54
|
-
* @param
|
|
54
|
+
* @param accessToken Access token to use for authentication.
|
|
55
55
|
* @param jobId Identifier of the job to retrieve.
|
|
56
56
|
*
|
|
57
57
|
* @returns The `EnhanceJob` object through a `Promise`.
|
|
58
58
|
*/
|
|
59
|
-
const getResults = (
|
|
59
|
+
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
60
|
const requestOptions = {
|
|
61
61
|
hostname: 'api.dolby.com',
|
|
62
62
|
path: '/media/enhance',
|
|
@@ -64,7 +64,7 @@ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function*
|
|
|
64
64
|
job_id: jobId,
|
|
65
65
|
},
|
|
66
66
|
headers: {},
|
|
67
|
-
|
|
67
|
+
accessToken,
|
|
68
68
|
};
|
|
69
69
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
70
70
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.js","sourceRoot":"","sources":["../../src/media/enhance.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;GAeG;AACI,MAAM,KAAK,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"enhance.js","sourceRoot":"","sources":["../../src/media/enhance.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;GAeG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,EAAE;QACX,WAAW;QACX,IAAI,EAAE,UAAU;KACnB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAQ,EAAC,cAAc,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACnC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC7B;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAfW,QAAA,KAAK,SAehB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAuB,EAAE;IAC1F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE;YACJ,MAAM,EAAE,KAAK;SAChB;QACD,OAAO,EAAE,EAAE;QACX,WAAW;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAO,EAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,QAAsB,CAAC;AAClC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as httpHelpers from '../../internal/httpHelpers';
|
|
2
2
|
import JwtToken from '../types/jwtToken';
|
|
3
3
|
export interface AuthRequestOptions extends httpHelpers.RequestOptions {
|
|
4
|
-
|
|
4
|
+
accessToken: JwtToken;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Sends a GET request.
|
|
@@ -10,7 +10,7 @@ export interface AuthRequestOptions extends httpHelpers.RequestOptions {
|
|
|
10
10
|
*
|
|
11
11
|
* @returns A JSON payload object through a Promise.
|
|
12
12
|
*/
|
|
13
|
-
export declare const sendGet: (options: AuthRequestOptions) => Promise<
|
|
13
|
+
export declare const sendGet: (options: AuthRequestOptions) => Promise<any>;
|
|
14
14
|
/**
|
|
15
15
|
* Sends a POST request.
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@ export declare const sendGet: (options: AuthRequestOptions) => Promise<unknown>;
|
|
|
18
18
|
*
|
|
19
19
|
* @returns A JSON payload object through a Promise.
|
|
20
20
|
*/
|
|
21
|
-
export declare const sendPost: (options: AuthRequestOptions) => Promise<
|
|
21
|
+
export declare const sendPost: (options: AuthRequestOptions) => Promise<any>;
|
|
22
22
|
/**
|
|
23
23
|
* Sends a PUT request.
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ export declare const sendPost: (options: AuthRequestOptions) => Promise<unknown>
|
|
|
26
26
|
*
|
|
27
27
|
* @returns A JSON payload object through a Promise.
|
|
28
28
|
*/
|
|
29
|
-
export declare const sendPut: (options: AuthRequestOptions) => Promise<
|
|
29
|
+
export declare const sendPut: (options: AuthRequestOptions) => Promise<any>;
|
|
30
30
|
/**
|
|
31
31
|
* Sends a DELETE request.
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ export declare const sendPut: (options: AuthRequestOptions) => Promise<unknown>;
|
|
|
34
34
|
*
|
|
35
35
|
* @returns A JSON payload object through a Promise.
|
|
36
36
|
*/
|
|
37
|
-
export declare const sendDelete: (options: AuthRequestOptions) => Promise<
|
|
37
|
+
export declare const sendDelete: (options: AuthRequestOptions) => Promise<any>;
|
|
38
38
|
/**
|
|
39
39
|
* Download a file.
|
|
40
40
|
*
|
|
@@ -33,12 +33,7 @@ const httpHelpers = __importStar(require("../../internal/httpHelpers"));
|
|
|
33
33
|
* @returns A JSON payload object through a Promise.
|
|
34
34
|
*/
|
|
35
35
|
const sendGet = (options) => {
|
|
36
|
-
|
|
37
|
-
options.headers['x-api-key'] = options.auth;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
41
|
-
}
|
|
36
|
+
options.headers['Authorization'] = `Bearer ${options.accessToken.access_token}`;
|
|
42
37
|
return httpHelpers.sendGet(options);
|
|
43
38
|
};
|
|
44
39
|
exports.sendGet = sendGet;
|
|
@@ -50,12 +45,7 @@ exports.sendGet = sendGet;
|
|
|
50
45
|
* @returns A JSON payload object through a Promise.
|
|
51
46
|
*/
|
|
52
47
|
const sendPost = (options) => {
|
|
53
|
-
|
|
54
|
-
options.headers['x-api-key'] = options.auth;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
58
|
-
}
|
|
48
|
+
options.headers['Authorization'] = `Bearer ${options.accessToken.access_token}`;
|
|
59
49
|
return httpHelpers.sendPost(options);
|
|
60
50
|
};
|
|
61
51
|
exports.sendPost = sendPost;
|
|
@@ -67,12 +57,7 @@ exports.sendPost = sendPost;
|
|
|
67
57
|
* @returns A JSON payload object through a Promise.
|
|
68
58
|
*/
|
|
69
59
|
const sendPut = (options) => {
|
|
70
|
-
|
|
71
|
-
options.headers['x-api-key'] = options.auth;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
75
|
-
}
|
|
60
|
+
options.headers['Authorization'] = `Bearer ${options.accessToken.access_token}`;
|
|
76
61
|
return httpHelpers.sendPut(options);
|
|
77
62
|
};
|
|
78
63
|
exports.sendPut = sendPut;
|
|
@@ -84,12 +69,7 @@ exports.sendPut = sendPut;
|
|
|
84
69
|
* @returns A JSON payload object through a Promise.
|
|
85
70
|
*/
|
|
86
71
|
const sendDelete = (options) => {
|
|
87
|
-
|
|
88
|
-
options.headers['x-api-key'] = options.auth;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
92
|
-
}
|
|
72
|
+
options.headers['Authorization'] = `Bearer ${options.accessToken.access_token}`;
|
|
93
73
|
return httpHelpers.sendDelete(options);
|
|
94
74
|
};
|
|
95
75
|
exports.sendDelete = sendDelete;
|
|
@@ -102,12 +82,7 @@ exports.sendDelete = sendDelete;
|
|
|
102
82
|
* @returns A JSON payload object through a Promise.
|
|
103
83
|
*/
|
|
104
84
|
const download = (filepath, options) => {
|
|
105
|
-
|
|
106
|
-
options.headers['x-api-key'] = options.auth;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
110
|
-
}
|
|
85
|
+
options.headers['Authorization'] = `Bearer ${options.accessToken.access_token}`;
|
|
111
86
|
return httpHelpers.download(filepath, options);
|
|
112
87
|
};
|
|
113
88
|
exports.download = download;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../../../src/media/internal/httpHelpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAA0D;AAO1D;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,CAAC,OAA2B,EAAE,EAAE;IACnD,
|
|
1
|
+
{"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../../../src/media/internal/httpHelpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAA0D;AAO1D;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,CAAC,OAA2B,EAAE,EAAE;IACnD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAEhF,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAJW,QAAA,OAAO,WAIlB;AAEF;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,OAA2B,EAAE,EAAE;IACpD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAEhF,OAAO,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC;AAJW,QAAA,QAAQ,YAInB;AAEF;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,CAAC,OAA2B,EAAE,EAAE;IACnD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAEhF,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAJW,QAAA,OAAO,WAIlB;AAEF;;;;;;GAMG;AACI,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAE,EAAE;IACtD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAEhF,OAAO,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AAJW,QAAA,UAAU,cAIrB;AAEF;;;;;;;GAOG;AACI,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,OAA2B,EAAE,EAAE;IACtE,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAEhF,OAAO,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAJW,QAAA,QAAQ,YAInB"}
|
package/dist/media/io.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ import JwtToken from './types/jwtToken';
|
|
|
10
10
|
*
|
|
11
11
|
* @link https://docs.dolby.io/media-apis/reference/media-input
|
|
12
12
|
*
|
|
13
|
-
* @param
|
|
13
|
+
* @param accessToken Access token to use for authentication.
|
|
14
14
|
* @param dlbUrl The `url` should be in the form `dlb://object-key` where the object-key can be any alpha-numeric string. The object-key is unique to your account API Key so there is no risk of collision with other users.
|
|
15
15
|
*
|
|
16
16
|
* @returns The upload URL through a `Promise`.
|
|
17
17
|
*/
|
|
18
|
-
export declare const getUploadUrl: (
|
|
18
|
+
export declare const getUploadUrl: (accessToken: JwtToken, dlbUrl: string) => Promise<string | null>;
|
|
19
19
|
/**
|
|
20
20
|
* Starts Media Download
|
|
21
21
|
*
|
|
@@ -25,8 +25,8 @@ export declare const getUploadUrl: (auth: string | JwtToken, dlbUrl: string) =>
|
|
|
25
25
|
*
|
|
26
26
|
* @link https://docs.dolby.io/media-apis/reference/media-output-get
|
|
27
27
|
*
|
|
28
|
-
* @param
|
|
28
|
+
* @param accessToken Access token to use for authentication.
|
|
29
29
|
* @param dlbUrl The `url` should be in the form `dlb://object-key` where the object-key can be any alpha-numeric string. The object-key is unique to your account API Key so there is no risk of collision with other users.
|
|
30
30
|
* @param filePath Local file path where to download the file to.
|
|
31
31
|
*/
|
|
32
|
-
export declare const downloadFile: (
|
|
32
|
+
export declare const downloadFile: (accessToken: JwtToken, dlbUrl: string, filePath: string) => Promise<void>;
|
package/dist/media/io.js
CHANGED
|
@@ -22,12 +22,12 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
22
22
|
*
|
|
23
23
|
* @link https://docs.dolby.io/media-apis/reference/media-input
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
25
|
+
* @param accessToken Access token to use for authentication.
|
|
26
26
|
* @param dlbUrl The `url` should be in the form `dlb://object-key` where the object-key can be any alpha-numeric string. The object-key is unique to your account API Key so there is no risk of collision with other users.
|
|
27
27
|
*
|
|
28
28
|
* @returns The upload URL through a `Promise`.
|
|
29
29
|
*/
|
|
30
|
-
const getUploadUrl = (
|
|
30
|
+
const getUploadUrl = (accessToken, dlbUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
31
|
const payload = {
|
|
32
32
|
url: dlbUrl,
|
|
33
33
|
};
|
|
@@ -35,7 +35,7 @@ const getUploadUrl = (auth, dlbUrl) => __awaiter(void 0, void 0, void 0, functio
|
|
|
35
35
|
hostname: 'api.dolby.com',
|
|
36
36
|
path: '/media/input',
|
|
37
37
|
headers: {},
|
|
38
|
-
|
|
38
|
+
accessToken,
|
|
39
39
|
body: JSON.stringify(payload, null, ' '),
|
|
40
40
|
};
|
|
41
41
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -54,11 +54,11 @@ exports.getUploadUrl = getUploadUrl;
|
|
|
54
54
|
*
|
|
55
55
|
* @link https://docs.dolby.io/media-apis/reference/media-output-get
|
|
56
56
|
*
|
|
57
|
-
* @param
|
|
57
|
+
* @param accessToken Access token to use for authentication.
|
|
58
58
|
* @param dlbUrl The `url` should be in the form `dlb://object-key` where the object-key can be any alpha-numeric string. The object-key is unique to your account API Key so there is no risk of collision with other users.
|
|
59
59
|
* @param filePath Local file path where to download the file to.
|
|
60
60
|
*/
|
|
61
|
-
const downloadFile = (
|
|
61
|
+
const downloadFile = (accessToken, dlbUrl, filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
62
|
const requestOptions = {
|
|
63
63
|
hostname: 'api.dolby.com',
|
|
64
64
|
path: '/media/output',
|
|
@@ -66,7 +66,7 @@ const downloadFile = (auth, dlbUrl, filePath) => __awaiter(void 0, void 0, void
|
|
|
66
66
|
url: dlbUrl,
|
|
67
67
|
},
|
|
68
68
|
headers: {},
|
|
69
|
-
|
|
69
|
+
accessToken,
|
|
70
70
|
};
|
|
71
71
|
(0, httpHelpers_1.download)(filePath, requestOptions);
|
|
72
72
|
});
|
package/dist/media/io.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/media/io.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAgF;AAGhF;;;;;;;;;;;;;;;GAeG;AACI,MAAM,YAAY,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/media/io.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAgF;AAGhF;;;;;;;;;;;;;;;GAeG;AACI,MAAM,YAAY,GAAG,CAAO,WAAqB,EAAE,MAAc,EAA0B,EAAE;IAChG,MAAM,OAAO,GAAG;QACZ,GAAG,EAAE,MAAM;KACd,CAAC;IAEF,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,WAAW;QACX,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;KAC5C,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAQ,EAAC,cAAc,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;QAChC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC1B;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAnBW,QAAA,YAAY,gBAmBvB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,YAAY,GAAG,CAAO,WAAqB,EAAE,MAAc,EAAE,QAAgB,EAAiB,EAAE;IACzG,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE;YACJ,GAAG,EAAE,MAAM;SACd;QACD,OAAO,EAAE,EAAE;QACX,WAAW;KACd,CAAC;IAEF,IAAA,sBAAQ,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACvC,CAAC,CAAA,CAAC;AAZW,QAAA,YAAY,gBAYvB"}
|