@dolbyio/dolbyio-rest-apis-client 3.3.3 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authentication.d.ts +1 -0
- package/dist/authentication.js +1 -0
- package/dist/authentication.js.map +1 -1
- package/dist/communications/conference.js +1 -1
- package/dist/communications/conference.js.map +1 -1
- package/dist/communications/index.d.ts +3 -2
- package/dist/communications/index.js +5 -3
- package/dist/communications/index.js.map +1 -1
- package/dist/communications/monitor/conferences.js +1 -1
- package/dist/communications/monitor/conferences.js.map +1 -1
- package/dist/communications/monitor/recordings.d.ts +5 -1
- package/dist/communications/monitor/recordings.js +5 -1
- package/dist/communications/monitor/recordings.js.map +1 -1
- package/dist/communications/recording.d.ts +27 -0
- package/dist/communications/recording.js +69 -0
- package/dist/communications/recording.js.map +1 -0
- package/dist/communications/streaming.d.ts +20 -12
- package/dist/communications/streaming.js +34 -23
- package/dist/communications/streaming.js.map +1 -1
- package/dist/communications/types/conference.d.ts +1 -1
- package/dist/communications/types/conferences.d.ts +4 -4
- package/dist/communications/types/permission.d.ts +1 -1
- package/dist/communications/types/permission.js +1 -1
- package/dist/communications/types/permission.js.map +1 -1
- package/dist/communications/types/recordings.d.ts +2 -2
- package/dist/communications/types/webhooks.d.ts +1 -1
- package/dist/media/analyze.js +3 -28
- package/dist/media/analyze.js.map +1 -1
- package/dist/media/analyzeSpeech.js +3 -28
- package/dist/media/analyzeSpeech.js.map +1 -1
- package/dist/media/diagnose.js +3 -28
- package/dist/media/diagnose.js.map +1 -1
- package/dist/media/enhance.js +3 -28
- package/dist/media/enhance.js.map +1 -1
- package/dist/media/internal/httpHelpers.d.ts +0 -9
- package/dist/media/internal/httpHelpers.js +1 -14
- package/dist/media/internal/httpHelpers.js.map +1 -1
- package/dist/media/internal/jobsHelpers.d.ts +3 -0
- package/dist/media/internal/jobsHelpers.js +47 -0
- package/dist/media/internal/jobsHelpers.js.map +1 -0
- package/dist/media/io.d.ts +17 -2
- package/dist/media/io.js +48 -27
- package/dist/media/io.js.map +1 -1
- package/dist/media/mastering.d.ts +2 -2
- package/dist/media/mastering.js +7 -56
- package/dist/media/mastering.js.map +1 -1
- package/dist/media/transcode.js +3 -28
- package/dist/media/transcode.js.map +1 -1
- package/dist/media/types/mastering.d.ts +6 -4
- package/package.json +5 -5
package/dist/media/analyze.js
CHANGED
|
@@ -10,8 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getResults = exports.start = void 0;
|
|
13
|
-
const
|
|
14
|
-
const urls_1 = require("./internal/urls");
|
|
13
|
+
const jobsHelpers_1 = require("./internal/jobsHelpers");
|
|
15
14
|
/**
|
|
16
15
|
* Starts analyzing to learn about your media.
|
|
17
16
|
*
|
|
@@ -38,21 +37,7 @@ const urls_1 = require("./internal/urls");
|
|
|
38
37
|
* @returns The job identifier through a `Promise`.
|
|
39
38
|
*/
|
|
40
39
|
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
-
|
|
42
|
-
hostname: urls_1.API_HOSTNAME,
|
|
43
|
-
path: '/media/analyze',
|
|
44
|
-
headers: {
|
|
45
|
-
Accept: 'application/json',
|
|
46
|
-
'Content-Type': 'application/json',
|
|
47
|
-
},
|
|
48
|
-
accessToken,
|
|
49
|
-
body: jobContent,
|
|
50
|
-
};
|
|
51
|
-
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
52
|
-
if (response.hasOwnProperty('job_id')) {
|
|
53
|
-
return response['job_id'];
|
|
54
|
-
}
|
|
55
|
-
return null;
|
|
40
|
+
return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/analyze', jobContent);
|
|
56
41
|
});
|
|
57
42
|
exports.start = start;
|
|
58
43
|
/**
|
|
@@ -70,17 +55,7 @@ exports.start = start;
|
|
|
70
55
|
* @returns The `AnalyzeJob` object through a `Promise`.
|
|
71
56
|
*/
|
|
72
57
|
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
-
|
|
74
|
-
hostname: urls_1.API_HOSTNAME,
|
|
75
|
-
path: '/media/analyze',
|
|
76
|
-
params: {
|
|
77
|
-
job_id: jobId,
|
|
78
|
-
},
|
|
79
|
-
headers: {},
|
|
80
|
-
accessToken,
|
|
81
|
-
};
|
|
82
|
-
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
83
|
-
return response;
|
|
58
|
+
return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/analyze', jobId);
|
|
84
59
|
});
|
|
85
60
|
exports.getResults = getResults;
|
|
86
61
|
//# sourceMappingURL=analyze.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/media/analyze.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/media/analyze.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAiE;AAIjE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,OAAO,MAAM,IAAA,sBAAQ,EAAC,WAAW,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;AACrE,CAAC,CAAA,CAAC;AAFW,QAAA,KAAK,SAEhB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAuB,EAAE;IAC1F,OAAO,MAAM,IAAA,2BAAa,EAAa,WAAW,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACjF,CAAC,CAAA,CAAC;AAFW,QAAA,UAAU,cAErB"}
|
|
@@ -10,8 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getResults = exports.start = void 0;
|
|
13
|
-
const
|
|
14
|
-
const urls_1 = require("./internal/urls");
|
|
13
|
+
const jobsHelpers_1 = require("./internal/jobsHelpers");
|
|
15
14
|
/**
|
|
16
15
|
* Starts analyzing to learn about speech in your media.
|
|
17
16
|
*
|
|
@@ -32,21 +31,7 @@ const urls_1 = require("./internal/urls");
|
|
|
32
31
|
* @returns The job identifier through a `Promise`.
|
|
33
32
|
*/
|
|
34
33
|
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
|
|
36
|
-
hostname: urls_1.API_HOSTNAME,
|
|
37
|
-
path: '/media/analyze/speech',
|
|
38
|
-
headers: {
|
|
39
|
-
Accept: 'application/json',
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
},
|
|
42
|
-
accessToken,
|
|
43
|
-
body: jobContent,
|
|
44
|
-
};
|
|
45
|
-
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
46
|
-
if (response.hasOwnProperty('job_id')) {
|
|
47
|
-
return response['job_id'];
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
34
|
+
return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/analyze/speech', jobContent);
|
|
50
35
|
});
|
|
51
36
|
exports.start = start;
|
|
52
37
|
/**
|
|
@@ -64,17 +49,7 @@ exports.start = start;
|
|
|
64
49
|
* @returns The `AnalyzeSpeechJob` object through a `Promise`.
|
|
65
50
|
*/
|
|
66
51
|
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
-
|
|
68
|
-
hostname: urls_1.API_HOSTNAME,
|
|
69
|
-
path: '/media/analyze/speech',
|
|
70
|
-
params: {
|
|
71
|
-
job_id: jobId,
|
|
72
|
-
},
|
|
73
|
-
headers: {},
|
|
74
|
-
accessToken,
|
|
75
|
-
};
|
|
76
|
-
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
77
|
-
return response;
|
|
52
|
+
return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/analyze/speech', jobId);
|
|
78
53
|
});
|
|
79
54
|
exports.getResults = getResults;
|
|
80
55
|
//# sourceMappingURL=analyzeSpeech.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeSpeech.js","sourceRoot":"","sources":["../../src/media/analyzeSpeech.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"analyzeSpeech.js","sourceRoot":"","sources":["../../src/media/analyzeSpeech.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAiE;AAIjE;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,OAAO,MAAM,IAAA,sBAAQ,EAAC,WAAW,EAAE,uBAAuB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC,CAAA,CAAC;AAFW,QAAA,KAAK,SAEhB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAA6B,EAAE;IAChG,OAAO,MAAM,IAAA,2BAAa,EAAmB,WAAW,EAAE,uBAAuB,EAAE,KAAK,CAAC,CAAC;AAC9F,CAAC,CAAA,CAAC;AAFW,QAAA,UAAU,cAErB"}
|
package/dist/media/diagnose.js
CHANGED
|
@@ -10,8 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getResults = exports.start = void 0;
|
|
13
|
-
const
|
|
14
|
-
const urls_1 = require("./internal/urls");
|
|
13
|
+
const jobsHelpers_1 = require("./internal/jobsHelpers");
|
|
15
14
|
/**
|
|
16
15
|
* Starts diagnosing to learn about the audio quality of your media.
|
|
17
16
|
*
|
|
@@ -32,21 +31,7 @@ const urls_1 = require("./internal/urls");
|
|
|
32
31
|
* @returns The job identifier through a `Promise`.
|
|
33
32
|
*/
|
|
34
33
|
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
|
|
36
|
-
hostname: urls_1.API_HOSTNAME,
|
|
37
|
-
path: '/media/diagnose',
|
|
38
|
-
headers: {
|
|
39
|
-
Accept: 'application/json',
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
},
|
|
42
|
-
accessToken,
|
|
43
|
-
body: jobContent,
|
|
44
|
-
};
|
|
45
|
-
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
46
|
-
if (response.hasOwnProperty('job_id')) {
|
|
47
|
-
return response['job_id'];
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
34
|
+
return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/diagnose', jobContent);
|
|
50
35
|
});
|
|
51
36
|
exports.start = start;
|
|
52
37
|
/**
|
|
@@ -66,17 +51,7 @@ exports.start = start;
|
|
|
66
51
|
* @returns The `DiagnoseJob` object through a `Promise`.
|
|
67
52
|
*/
|
|
68
53
|
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
-
|
|
70
|
-
hostname: urls_1.API_HOSTNAME,
|
|
71
|
-
path: '/media/diagnose',
|
|
72
|
-
params: {
|
|
73
|
-
job_id: jobId,
|
|
74
|
-
},
|
|
75
|
-
headers: {},
|
|
76
|
-
accessToken,
|
|
77
|
-
};
|
|
78
|
-
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
79
|
-
return response;
|
|
54
|
+
return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/diagnose', jobId);
|
|
80
55
|
});
|
|
81
56
|
exports.getResults = getResults;
|
|
82
57
|
//# sourceMappingURL=diagnose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/media/diagnose.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/media/diagnose.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAiE;AAIjE;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,OAAO,MAAM,IAAA,sBAAQ,EAAC,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AACtE,CAAC,CAAA,CAAC;AAFW,QAAA,KAAK,SAEhB;AAEF;;;;;;;;;;;;;;;GAeG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAwB,EAAE;IAC3F,OAAO,MAAM,IAAA,2BAAa,EAAc,WAAW,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC;AACnF,CAAC,CAAA,CAAC;AAFW,QAAA,UAAU,cAErB"}
|
package/dist/media/enhance.js
CHANGED
|
@@ -10,8 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getResults = exports.start = void 0;
|
|
13
|
-
const
|
|
14
|
-
const urls_1 = require("./internal/urls");
|
|
13
|
+
const jobsHelpers_1 = require("./internal/jobsHelpers");
|
|
15
14
|
/**
|
|
16
15
|
* Starts enhancing to improve your media.
|
|
17
16
|
*
|
|
@@ -29,21 +28,7 @@ const urls_1 = require("./internal/urls");
|
|
|
29
28
|
* @returns The job identifier through a `Promise`.
|
|
30
29
|
*/
|
|
31
30
|
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
|
|
33
|
-
hostname: urls_1.API_HOSTNAME,
|
|
34
|
-
path: '/media/enhance',
|
|
35
|
-
headers: {
|
|
36
|
-
Accept: 'application/json',
|
|
37
|
-
'Content-Type': 'application/json',
|
|
38
|
-
},
|
|
39
|
-
accessToken,
|
|
40
|
-
body: jobContent,
|
|
41
|
-
};
|
|
42
|
-
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
43
|
-
if (response.hasOwnProperty('job_id')) {
|
|
44
|
-
return response['job_id'];
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
31
|
+
return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/enhance', jobContent);
|
|
47
32
|
});
|
|
48
33
|
exports.start = start;
|
|
49
34
|
/**
|
|
@@ -61,17 +46,7 @@ exports.start = start;
|
|
|
61
46
|
* @returns The `EnhanceJob` object through a `Promise`.
|
|
62
47
|
*/
|
|
63
48
|
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
|
|
65
|
-
hostname: urls_1.API_HOSTNAME,
|
|
66
|
-
path: '/media/enhance',
|
|
67
|
-
params: {
|
|
68
|
-
job_id: jobId,
|
|
69
|
-
},
|
|
70
|
-
headers: {},
|
|
71
|
-
accessToken,
|
|
72
|
-
};
|
|
73
|
-
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
74
|
-
return response;
|
|
49
|
+
return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/enhance', jobId);
|
|
75
50
|
});
|
|
76
51
|
exports.getResults = getResults;
|
|
77
52
|
//# sourceMappingURL=enhance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.js","sourceRoot":"","sources":["../../src/media/enhance.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"enhance.js","sourceRoot":"","sources":["../../src/media/enhance.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAiE;AAIjE;;;;;;;;;;;;;;;GAeG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,OAAO,MAAM,IAAA,sBAAQ,EAAC,WAAW,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;AACrE,CAAC,CAAA,CAAC;AAFW,QAAA,KAAK,SAEhB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAuB,EAAE;IAC1F,OAAO,MAAM,IAAA,2BAAa,EAAa,WAAW,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACjF,CAAC,CAAA,CAAC;AAFW,QAAA,UAAU,cAErB"}
|
|
@@ -35,12 +35,3 @@ export declare const sendPut: (options: AuthRequestOptions) => Promise<any>;
|
|
|
35
35
|
* @returns A JSON payload object through a Promise.
|
|
36
36
|
*/
|
|
37
37
|
export declare const sendDelete: (options: AuthRequestOptions) => Promise<any>;
|
|
38
|
-
/**
|
|
39
|
-
* Download a file.
|
|
40
|
-
*
|
|
41
|
-
* @param filepath Where to save the file.
|
|
42
|
-
* @param options Request options.
|
|
43
|
-
*
|
|
44
|
-
* @returns A JSON payload object through a Promise.
|
|
45
|
-
*/
|
|
46
|
-
export declare const download: (filepath: string, options: AuthRequestOptions) => Promise<void>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.sendDelete = exports.sendPut = exports.sendPost = exports.sendGet = void 0;
|
|
27
27
|
const httpHelpers = __importStar(require("../../internal/httpHelpers"));
|
|
28
28
|
/**
|
|
29
29
|
* Sends a GET request.
|
|
@@ -73,17 +73,4 @@ const sendDelete = (options) => {
|
|
|
73
73
|
return httpHelpers.sendDelete(options);
|
|
74
74
|
};
|
|
75
75
|
exports.sendDelete = sendDelete;
|
|
76
|
-
/**
|
|
77
|
-
* Download a file.
|
|
78
|
-
*
|
|
79
|
-
* @param filepath Where to save the file.
|
|
80
|
-
* @param options Request options.
|
|
81
|
-
*
|
|
82
|
-
* @returns A JSON payload object through a Promise.
|
|
83
|
-
*/
|
|
84
|
-
const download = (filepath, options) => {
|
|
85
|
-
options.headers['Authorization'] = `Bearer ${options.accessToken.access_token}`;
|
|
86
|
-
return httpHelpers.download(filepath, options);
|
|
87
|
-
};
|
|
88
|
-
exports.download = download;
|
|
89
76
|
//# sourceMappingURL=httpHelpers.js.map
|
|
@@ -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,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
|
|
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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import JwtToken from '../../types/jwtToken';
|
|
2
|
+
export declare const startJob: (accessToken: JwtToken, urlPath: string, jobContent: string) => Promise<string | null>;
|
|
3
|
+
export declare const getJobResults: <TResult>(accessToken: JwtToken, urlPath: string, jobId: string) => Promise<TResult>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getJobResults = exports.startJob = void 0;
|
|
13
|
+
const httpHelpers_1 = require("./httpHelpers");
|
|
14
|
+
const urls_1 = require("./urls");
|
|
15
|
+
const startJob = (accessToken, urlPath, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const requestOptions = {
|
|
17
|
+
hostname: urls_1.API_HOSTNAME,
|
|
18
|
+
path: urlPath,
|
|
19
|
+
headers: {
|
|
20
|
+
Accept: 'application/json',
|
|
21
|
+
'Content-Type': 'application/json',
|
|
22
|
+
},
|
|
23
|
+
accessToken,
|
|
24
|
+
body: jobContent,
|
|
25
|
+
};
|
|
26
|
+
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
27
|
+
if (response.hasOwnProperty('job_id')) {
|
|
28
|
+
return response['job_id'];
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
});
|
|
32
|
+
exports.startJob = startJob;
|
|
33
|
+
const getJobResults = (accessToken, urlPath, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
const requestOptions = {
|
|
35
|
+
hostname: urls_1.API_HOSTNAME,
|
|
36
|
+
path: urlPath,
|
|
37
|
+
params: {
|
|
38
|
+
job_id: jobId,
|
|
39
|
+
},
|
|
40
|
+
headers: {},
|
|
41
|
+
accessToken,
|
|
42
|
+
};
|
|
43
|
+
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
44
|
+
return response;
|
|
45
|
+
});
|
|
46
|
+
exports.getJobResults = getJobResults;
|
|
47
|
+
//# sourceMappingURL=jobsHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobsHelpers.js","sourceRoot":"","sources":["../../../src/media/internal/jobsHelpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAsE;AACtE,iCAAsC;AAG/B,MAAM,QAAQ,GAAG,CAAO,WAAqB,EAAE,OAAe,EAAE,UAAkB,EAA0B,EAAE;IACjH,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,mBAAY;QACtB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE;YACL,MAAM,EAAE,kBAAkB;YAC1B,cAAc,EAAE,kBAAkB;SACrC;QACD,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;AAlBW,QAAA,QAAQ,YAkBnB;AAEK,MAAM,aAAa,GAAG,CAAgB,WAAqB,EAAE,OAAe,EAAE,KAAa,EAAoB,EAAE;IACpH,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,mBAAY;QACtB,IAAI,EAAE,OAAO;QACb,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,QAAmB,CAAC;AAC/B,CAAC,CAAA,CAAC;AAbW,QAAA,aAAa,iBAaxB"}
|
package/dist/media/io.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import JwtToken from '../types/jwtToken';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Gets an upload URL.
|
|
4
4
|
*
|
|
5
5
|
* To use the Dolby provided temporary storage is a two step process.
|
|
6
6
|
*
|
|
@@ -17,7 +17,22 @@ import JwtToken from '../types/jwtToken';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const getUploadUrl: (accessToken: JwtToken, dlbUrl: string) => Promise<string | null>;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Gets the download URL.
|
|
21
|
+
*
|
|
22
|
+
* You can download media you previously uploaded with /media/input or media that was generated through another Dolby Media API.
|
|
23
|
+
*
|
|
24
|
+
* The temporary storage should allow you to read and write to the dlb:// locations for a period of at least 24 hours before it is removed.
|
|
25
|
+
*
|
|
26
|
+
* @link https://docs.dolby.io/media-apis/reference/media-output-post
|
|
27
|
+
*
|
|
28
|
+
* @param accessToken Access token to use for authentication.
|
|
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
|
+
*
|
|
31
|
+
* @returns The download URL through a `Promise`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getDownloadUrl: (accessToken: JwtToken, dlbUrl: string) => Promise<string | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Download a media file.
|
|
21
36
|
*
|
|
22
37
|
* You can download media you previously uploaded with /media/input or media that was generated through another Dolby Media API.
|
|
23
38
|
*
|
package/dist/media/io.js
CHANGED
|
@@ -9,32 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.downloadFile = exports.getUploadUrl = void 0;
|
|
12
|
+
exports.downloadFile = exports.getDownloadUrl = exports.getUploadUrl = void 0;
|
|
13
13
|
const httpHelpers_1 = require("./internal/httpHelpers");
|
|
14
|
+
const httpHelpers_2 = require("../internal/httpHelpers");
|
|
14
15
|
const urls_1 = require("./internal/urls");
|
|
15
|
-
|
|
16
|
-
* Starts Media Input
|
|
17
|
-
*
|
|
18
|
-
* To use the Dolby provided temporary storage is a two step process.
|
|
19
|
-
*
|
|
20
|
-
* You start by declaring a dlb:// url that you can reference in any other Media API calls. The response will provide a url where you can put your media. This allows you to use the dlb:// url as a short-cut for a temporary storage location.
|
|
21
|
-
*
|
|
22
|
-
* You'll be returned a pre-signed url you can use to PUT and upload your media file. The temporary storage should allow you to read and write to the dlb:// locations for a period of at least 24 hours before it is removed.
|
|
23
|
-
*
|
|
24
|
-
* @link https://docs.dolby.io/media-apis/reference/media-input
|
|
25
|
-
*
|
|
26
|
-
* @param accessToken Access token to use for authentication.
|
|
27
|
-
* @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.
|
|
28
|
-
*
|
|
29
|
-
* @returns The upload URL through a `Promise`.
|
|
30
|
-
*/
|
|
31
|
-
const getUploadUrl = (accessToken, dlbUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const getUrl = (accessToken, endpointUrl, dlbUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
17
|
const payload = {
|
|
33
18
|
url: dlbUrl,
|
|
34
19
|
};
|
|
35
20
|
const requestOptions = {
|
|
36
21
|
hostname: urls_1.API_HOSTNAME,
|
|
37
|
-
path:
|
|
22
|
+
path: endpointUrl,
|
|
38
23
|
headers: {
|
|
39
24
|
Accept: 'application/json',
|
|
40
25
|
'Content-Type': 'application/json',
|
|
@@ -48,9 +33,46 @@ const getUploadUrl = (accessToken, dlbUrl) => __awaiter(void 0, void 0, void 0,
|
|
|
48
33
|
}
|
|
49
34
|
return null;
|
|
50
35
|
});
|
|
36
|
+
/**
|
|
37
|
+
* Gets an upload URL.
|
|
38
|
+
*
|
|
39
|
+
* To use the Dolby provided temporary storage is a two step process.
|
|
40
|
+
*
|
|
41
|
+
* You start by declaring a dlb:// url that you can reference in any other Media API calls. The response will provide a url where you can put your media. This allows you to use the dlb:// url as a short-cut for a temporary storage location.
|
|
42
|
+
*
|
|
43
|
+
* You'll be returned a pre-signed url you can use to PUT and upload your media file. The temporary storage should allow you to read and write to the dlb:// locations for a period of at least 24 hours before it is removed.
|
|
44
|
+
*
|
|
45
|
+
* @link https://docs.dolby.io/media-apis/reference/media-input
|
|
46
|
+
*
|
|
47
|
+
* @param accessToken Access token to use for authentication.
|
|
48
|
+
* @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.
|
|
49
|
+
*
|
|
50
|
+
* @returns The upload URL through a `Promise`.
|
|
51
|
+
*/
|
|
52
|
+
const getUploadUrl = (accessToken, dlbUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
return yield getUrl(accessToken, '/media/input', dlbUrl);
|
|
54
|
+
});
|
|
51
55
|
exports.getUploadUrl = getUploadUrl;
|
|
52
56
|
/**
|
|
53
|
-
*
|
|
57
|
+
* Gets the download URL.
|
|
58
|
+
*
|
|
59
|
+
* You can download media you previously uploaded with /media/input or media that was generated through another Dolby Media API.
|
|
60
|
+
*
|
|
61
|
+
* The temporary storage should allow you to read and write to the dlb:// locations for a period of at least 24 hours before it is removed.
|
|
62
|
+
*
|
|
63
|
+
* @link https://docs.dolby.io/media-apis/reference/media-output-post
|
|
64
|
+
*
|
|
65
|
+
* @param accessToken Access token to use for authentication.
|
|
66
|
+
* @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.
|
|
67
|
+
*
|
|
68
|
+
* @returns The download URL through a `Promise`.
|
|
69
|
+
*/
|
|
70
|
+
const getDownloadUrl = (accessToken, dlbUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
return yield getUrl(accessToken, '/media/output', dlbUrl);
|
|
72
|
+
});
|
|
73
|
+
exports.getDownloadUrl = getDownloadUrl;
|
|
74
|
+
/**
|
|
75
|
+
* Download a media file.
|
|
54
76
|
*
|
|
55
77
|
* You can download media you previously uploaded with /media/input or media that was generated through another Dolby Media API.
|
|
56
78
|
*
|
|
@@ -63,16 +85,15 @@ exports.getUploadUrl = getUploadUrl;
|
|
|
63
85
|
* @param filePath Local file path where to download the file to.
|
|
64
86
|
*/
|
|
65
87
|
const downloadFile = (accessToken, dlbUrl, filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
+
let downloadUrl = yield (0, exports.getDownloadUrl)(accessToken, dlbUrl);
|
|
89
|
+
downloadUrl = downloadUrl.replace('https://', '');
|
|
90
|
+
const idx = downloadUrl.indexOf('/');
|
|
66
91
|
const requestOptions = {
|
|
67
|
-
hostname:
|
|
68
|
-
path:
|
|
69
|
-
params: {
|
|
70
|
-
url: dlbUrl,
|
|
71
|
-
},
|
|
92
|
+
hostname: downloadUrl.substring(0, idx),
|
|
93
|
+
path: downloadUrl.substring(idx + 1),
|
|
72
94
|
headers: {},
|
|
73
|
-
accessToken,
|
|
74
95
|
};
|
|
75
|
-
return (0,
|
|
96
|
+
return (0, httpHelpers_2.download)(filePath, requestOptions);
|
|
76
97
|
});
|
|
77
98
|
exports.downloadFile = downloadFile;
|
|
78
99
|
//# sourceMappingURL=io.js.map
|
package/dist/media/io.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/media/io.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/media/io.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsE;AACtE,yDAAmE;AACnE,0CAA+C;AAG/C,MAAM,MAAM,GAAG,CAAO,WAAqB,EAAE,WAAmB,EAAE,MAAc,EAA0B,EAAE;IACxG,MAAM,OAAO,GAAG;QACZ,GAAG,EAAE,MAAM;KACd,CAAC;IAEF,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,mBAAY;QACtB,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE;YACL,MAAM,EAAE,kBAAkB;YAC1B,cAAc,EAAE,kBAAkB;SACrC;QACD,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;AAEF;;;;;;;;;;;;;;;GAeG;AACI,MAAM,YAAY,GAAG,CAAO,WAAqB,EAAE,MAAc,EAA0B,EAAE;IAChG,OAAO,MAAM,MAAM,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC,CAAA,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,cAAc,GAAG,CAAO,WAAqB,EAAE,MAAc,EAA0B,EAAE;IAClG,OAAO,MAAM,MAAM,CAAC,WAAW,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC,CAAA,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,YAAY,GAAG,CAAO,WAAqB,EAAE,MAAc,EAAE,QAAgB,EAAiB,EAAE;IACzG,IAAI,WAAW,GAAW,MAAM,IAAA,sBAAc,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAEpE,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAErC,MAAM,cAAc,GAAmB;QACnC,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC;QACvC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC;QACpC,OAAO,EAAE,EAAE;KACd,CAAC;IAEF,OAAO,IAAA,sBAAQ,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAbW,QAAA,YAAY,gBAavB"}
|
|
@@ -13,10 +13,10 @@ import { MasteringPreviewJob, MasteringJob } from './types/mastering';
|
|
|
13
13
|
*
|
|
14
14
|
* To learn more, see the example requests and responses.
|
|
15
15
|
*
|
|
16
|
-
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
|
|
16
|
+
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-preview-post
|
|
17
17
|
*
|
|
18
18
|
* @param accessToken Access token to use for authentication.
|
|
19
|
-
* @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-music-mastering-post
|
|
19
|
+
* @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-music-mastering-preview-post
|
|
20
20
|
*
|
|
21
21
|
* @returns The job identifier through a `Promise`.
|
|
22
22
|
*/
|
package/dist/media/mastering.js
CHANGED
|
@@ -10,8 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getResults = exports.start = exports.getPreviewResults = exports.startPreview = void 0;
|
|
13
|
-
const
|
|
14
|
-
const urls_1 = require("./internal/urls");
|
|
13
|
+
const jobsHelpers_1 = require("./internal/jobsHelpers");
|
|
15
14
|
/**
|
|
16
15
|
* Starts mastering preview to improve your music.
|
|
17
16
|
*
|
|
@@ -25,29 +24,15 @@ const urls_1 = require("./internal/urls");
|
|
|
25
24
|
*
|
|
26
25
|
* To learn more, see the example requests and responses.
|
|
27
26
|
*
|
|
28
|
-
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
|
|
27
|
+
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-preview-post
|
|
29
28
|
*
|
|
30
29
|
* @param accessToken Access token to use for authentication.
|
|
31
|
-
* @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-music-mastering-post
|
|
30
|
+
* @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-music-mastering-preview-post
|
|
32
31
|
*
|
|
33
32
|
* @returns The job identifier through a `Promise`.
|
|
34
33
|
*/
|
|
35
34
|
const startPreview = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
|
|
37
|
-
hostname: urls_1.API_HOSTNAME,
|
|
38
|
-
path: '/media/master/preview',
|
|
39
|
-
headers: {
|
|
40
|
-
Accept: 'application/json',
|
|
41
|
-
'Content-Type': 'application/json',
|
|
42
|
-
},
|
|
43
|
-
accessToken,
|
|
44
|
-
body: jobContent,
|
|
45
|
-
};
|
|
46
|
-
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
47
|
-
if (response.hasOwnProperty('job_id')) {
|
|
48
|
-
return response['job_id'];
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
35
|
+
return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/master/preview', jobContent);
|
|
51
36
|
});
|
|
52
37
|
exports.startPreview = startPreview;
|
|
53
38
|
/**
|
|
@@ -64,17 +49,7 @@ exports.startPreview = startPreview;
|
|
|
64
49
|
* @returns The `MasteringPreviewJob` object through a `Promise`.
|
|
65
50
|
*/
|
|
66
51
|
const getPreviewResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
-
|
|
68
|
-
hostname: urls_1.API_HOSTNAME,
|
|
69
|
-
path: '/media/master/preview',
|
|
70
|
-
params: {
|
|
71
|
-
job_id: jobId,
|
|
72
|
-
},
|
|
73
|
-
headers: {},
|
|
74
|
-
accessToken,
|
|
75
|
-
};
|
|
76
|
-
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
77
|
-
return response;
|
|
52
|
+
return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/master/preview', jobId);
|
|
78
53
|
});
|
|
79
54
|
exports.getPreviewResults = getPreviewResults;
|
|
80
55
|
/**
|
|
@@ -96,21 +71,7 @@ exports.getPreviewResults = getPreviewResults;
|
|
|
96
71
|
* @returns The job identifier through a `Promise`.
|
|
97
72
|
*/
|
|
98
73
|
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
-
|
|
100
|
-
hostname: urls_1.API_HOSTNAME,
|
|
101
|
-
path: '/media/master',
|
|
102
|
-
headers: {
|
|
103
|
-
Accept: 'application/json',
|
|
104
|
-
'Content-Type': 'application/json',
|
|
105
|
-
},
|
|
106
|
-
accessToken,
|
|
107
|
-
body: jobContent,
|
|
108
|
-
};
|
|
109
|
-
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
110
|
-
if (response.hasOwnProperty('job_id')) {
|
|
111
|
-
return response['job_id'];
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
74
|
+
return yield (0, jobsHelpers_1.startJob)(accessToken, '/media/master', jobContent);
|
|
114
75
|
});
|
|
115
76
|
exports.start = start;
|
|
116
77
|
/**
|
|
@@ -127,17 +88,7 @@ exports.start = start;
|
|
|
127
88
|
* @returns The `MasteringJob` object through a `Promise`.
|
|
128
89
|
*/
|
|
129
90
|
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
-
|
|
131
|
-
hostname: urls_1.API_HOSTNAME,
|
|
132
|
-
path: '/media/master',
|
|
133
|
-
params: {
|
|
134
|
-
job_id: jobId,
|
|
135
|
-
},
|
|
136
|
-
headers: {},
|
|
137
|
-
accessToken,
|
|
138
|
-
};
|
|
139
|
-
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
140
|
-
return response;
|
|
91
|
+
return yield (0, jobsHelpers_1.getJobResults)(accessToken, '/media/master', jobId);
|
|
141
92
|
});
|
|
142
93
|
exports.getResults = getResults;
|
|
143
94
|
//# sourceMappingURL=mastering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastering.js","sourceRoot":"","sources":["../../src/media/mastering.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"mastering.js","sourceRoot":"","sources":["../../src/media/mastering.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAiE;AAIjE;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,YAAY,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IACpG,OAAO,MAAM,IAAA,sBAAQ,EAAC,WAAW,EAAE,uBAAuB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC,CAAA,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,iBAAiB,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAgC,EAAE;IAC1G,OAAO,MAAM,IAAA,2BAAa,EAAsB,WAAW,EAAE,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACjG,CAAC,CAAA,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,OAAO,MAAM,IAAA,sBAAQ,EAAC,WAAW,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;AACpE,CAAC,CAAA,CAAC;AAFW,QAAA,KAAK,SAEhB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAyB,EAAE;IAC5F,OAAO,MAAM,IAAA,2BAAa,EAAe,WAAW,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;AAClF,CAAC,CAAA,CAAC;AAFW,QAAA,UAAU,cAErB"}
|