@dolbyio/dolbyio-rest-apis-client 1.1.0 → 2.1.2
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 +19 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.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 +43 -0
- package/dist/media/analyze.js +82 -0
- package/dist/media/analyze.js.map +1 -0
- package/dist/media/analyzeSpeech.d.ts +37 -0
- package/dist/media/analyzeSpeech.js +76 -0
- package/dist/media/analyzeSpeech.js.map +1 -0
- package/dist/media/diagnose.d.ts +39 -0
- package/dist/media/diagnose.js +78 -0
- package/dist/media/diagnose.js.map +1 -0
- package/dist/media/enhance.d.ts +34 -0
- package/dist/media/enhance.js +73 -0
- package/dist/media/enhance.js.map +1 -0
- package/dist/media/index.d.ts +11 -0
- package/dist/media/index.js +47 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/internal/httpHelpers.d.ts +46 -0
- package/dist/media/internal/httpHelpers.js +114 -0
- package/dist/media/internal/httpHelpers.js.map +1 -0
- package/dist/media/io.d.ts +32 -0
- package/dist/media/io.js +74 -0
- package/dist/media/io.js.map +1 -0
- package/dist/media/jobs.d.ts +35 -0
- package/dist/media/jobs.js +116 -0
- package/dist/media/jobs.js.map +1 -0
- package/dist/media/mastering.d.ts +70 -0
- package/dist/media/mastering.js +136 -0
- package/dist/media/mastering.js.map +1 -0
- package/dist/media/platform.d.ts +15 -0
- package/dist/media/platform.js +44 -0
- package/dist/media/platform.js.map +1 -0
- package/dist/media/transcode.d.ts +30 -0
- package/dist/media/transcode.js +69 -0
- package/dist/media/transcode.js.map +1 -0
- package/dist/media/types/analyze.d.ts +6 -0
- package/dist/media/types/analyze.js +3 -0
- package/dist/media/types/analyze.js.map +1 -0
- package/dist/media/types/analyzeSpeech.d.ts +6 -0
- package/dist/media/types/analyzeSpeech.js +3 -0
- package/dist/media/types/analyzeSpeech.js.map +1 -0
- package/dist/media/types/diagnose.d.ts +6 -0
- package/dist/media/types/diagnose.js +3 -0
- package/dist/media/types/diagnose.js.map +1 -0
- package/dist/media/types/enhance.d.ts +6 -0
- package/dist/media/types/enhance.js +3 -0
- package/dist/media/types/enhance.js.map +1 -0
- package/dist/media/types/jobResults.d.ts +12 -0
- package/dist/media/types/jobResults.js +3 -0
- package/dist/media/types/jobResults.js.map +1 -0
- package/dist/media/types/jobs.d.ts +29 -0
- package/dist/media/types/jobs.js +3 -0
- package/dist/media/types/jobs.js.map +1 -0
- package/dist/media/types/jwtToken.d.ts +6 -0
- package/dist/media/types/jwtToken.js +3 -0
- package/dist/media/types/jwtToken.js.map +1 -0
- package/dist/media/types/mastering.d.ts +13 -0
- package/dist/media/types/mastering.js +3 -0
- package/dist/media/types/mastering.js.map +1 -0
- package/dist/media/types/transcode.d.ts +6 -0
- package/dist/media/types/transcode.js +3 -0
- package/dist/media/types/transcode.js.map +1 -0
- package/dist/media/types/webhooks.d.ts +21 -0
- package/dist/media/types/webhooks.js +3 -0
- package/dist/media/types/webhooks.js.map +1 -0
- package/dist/media/webhooks.d.ts +46 -0
- package/dist/media/webhooks.js +129 -0
- package/dist/media/webhooks.js.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,73 @@
|
|
|
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.getResults = exports.start = void 0;
|
|
13
|
+
const httpHelpers_1 = require("./internal/httpHelpers");
|
|
14
|
+
/**
|
|
15
|
+
* Starts enhancing to improve your media.
|
|
16
|
+
*
|
|
17
|
+
* The input location for your source media file as well as the output location for the processed result are required.
|
|
18
|
+
*
|
|
19
|
+
* This is an asynchronous operation so you will receive a job_id where you can retrieve the results when enhancement is complete.
|
|
20
|
+
*
|
|
21
|
+
* There are additional optional parameters that can be provided to control and select the type of enhancements made. See the samples for some examples of what requests and responses look like.
|
|
22
|
+
*
|
|
23
|
+
* @link https://docs.dolby.io/media-apis/reference/media-enhance-post
|
|
24
|
+
*
|
|
25
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
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
|
+
*
|
|
28
|
+
* @returns The job identifier through a `Promise`.
|
|
29
|
+
*/
|
|
30
|
+
const start = (auth, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const requestOptions = {
|
|
32
|
+
hostname: 'api.dolby.com',
|
|
33
|
+
path: '/media/enhance',
|
|
34
|
+
headers: {},
|
|
35
|
+
auth,
|
|
36
|
+
body: jobContent,
|
|
37
|
+
};
|
|
38
|
+
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
39
|
+
if (response.hasOwnProperty('job_id')) {
|
|
40
|
+
return response['job_id'];
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
});
|
|
44
|
+
exports.start = start;
|
|
45
|
+
/**
|
|
46
|
+
* Gets Enhance Results
|
|
47
|
+
*
|
|
48
|
+
* For a given job_id, this method will check if the processing task has completed and return the enhanced results.
|
|
49
|
+
*
|
|
50
|
+
* When the status is Success you'll be able to retrieve your result from the output location you provided in the original POST.
|
|
51
|
+
*
|
|
52
|
+
* @link https://docs.dolby.io/media-apis/reference/media-enhance-get
|
|
53
|
+
*
|
|
54
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
55
|
+
* @param jobId Identifier of the job to retrieve.
|
|
56
|
+
*
|
|
57
|
+
* @returns The `EnhanceJob` object through a `Promise`.
|
|
58
|
+
*/
|
|
59
|
+
const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
const requestOptions = {
|
|
61
|
+
hostname: 'api.dolby.com',
|
|
62
|
+
path: '/media/enhance',
|
|
63
|
+
params: {
|
|
64
|
+
job_id: jobId,
|
|
65
|
+
},
|
|
66
|
+
headers: {},
|
|
67
|
+
auth,
|
|
68
|
+
};
|
|
69
|
+
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
70
|
+
return response;
|
|
71
|
+
});
|
|
72
|
+
exports.getResults = getResults;
|
|
73
|
+
//# sourceMappingURL=enhance.js.map
|
|
@@ -0,0 +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,IAAuB,EAAE,UAAkB,EAA0B,EAAE;IAC/F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,EAAE;QACX,IAAI;QACJ,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,IAAuB,EAAE,KAAa,EAAuB,EAAE;IAC5F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE;YACJ,MAAM,EAAE,KAAK;SAChB;QACD,OAAO,EAAE,EAAE;QACX,IAAI;KACP,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as analyze from './analyze';
|
|
2
|
+
import * as analyzeSpeech from './analyzeSpeech';
|
|
3
|
+
import * as diagnose from './diagnose';
|
|
4
|
+
import * as enhance from './enhance';
|
|
5
|
+
import * as io from './io';
|
|
6
|
+
import * as jobs from './jobs';
|
|
7
|
+
import * as mastering from './mastering';
|
|
8
|
+
import * as transcode from './transcode';
|
|
9
|
+
import * as platform from './platform';
|
|
10
|
+
import * as webhooks from './webhooks';
|
|
11
|
+
export { analyze, analyzeSpeech, diagnose, enhance, io, jobs, mastering, transcode, platform, webhooks };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.webhooks = exports.platform = exports.transcode = exports.mastering = exports.jobs = exports.io = exports.enhance = exports.diagnose = exports.analyzeSpeech = exports.analyze = void 0;
|
|
27
|
+
const analyze = __importStar(require("./analyze"));
|
|
28
|
+
exports.analyze = analyze;
|
|
29
|
+
const analyzeSpeech = __importStar(require("./analyzeSpeech"));
|
|
30
|
+
exports.analyzeSpeech = analyzeSpeech;
|
|
31
|
+
const diagnose = __importStar(require("./diagnose"));
|
|
32
|
+
exports.diagnose = diagnose;
|
|
33
|
+
const enhance = __importStar(require("./enhance"));
|
|
34
|
+
exports.enhance = enhance;
|
|
35
|
+
const io = __importStar(require("./io"));
|
|
36
|
+
exports.io = io;
|
|
37
|
+
const jobs = __importStar(require("./jobs"));
|
|
38
|
+
exports.jobs = jobs;
|
|
39
|
+
const mastering = __importStar(require("./mastering"));
|
|
40
|
+
exports.mastering = mastering;
|
|
41
|
+
const transcode = __importStar(require("./transcode"));
|
|
42
|
+
exports.transcode = transcode;
|
|
43
|
+
const platform = __importStar(require("./platform"));
|
|
44
|
+
exports.platform = platform;
|
|
45
|
+
const webhooks = __importStar(require("./webhooks"));
|
|
46
|
+
exports.webhooks = webhooks;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AAW5B,0BAAO;AAVhB,+DAAiD;AAU/B,sCAAa;AAT/B,qDAAuC;AASN,4BAAQ;AARzC,mDAAqC;AAQM,0BAAO;AAPlD,yCAA2B;AAOyB,gBAAE;AANtD,6CAA+B;AAMyB,oBAAI;AAL5D,uDAAyC;AAKqB,8BAAS;AAJvE,uDAAyC;AAIgC,8BAAS;AAHlF,qDAAuC;AAG6C,4BAAQ;AAF5F,qDAAuC;AAEuD,4BAAQ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as httpHelpers from '../../internal/httpHelpers';
|
|
2
|
+
import JwtToken from '../types/jwtToken';
|
|
3
|
+
export interface AuthRequestOptions extends httpHelpers.RequestOptions {
|
|
4
|
+
auth: string | JwtToken;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Sends a GET request.
|
|
8
|
+
*
|
|
9
|
+
* @param options Request options.
|
|
10
|
+
*
|
|
11
|
+
* @returns A JSON payload object through a Promise.
|
|
12
|
+
*/
|
|
13
|
+
export declare const sendGet: (options: AuthRequestOptions) => Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Sends a POST request.
|
|
16
|
+
*
|
|
17
|
+
* @param options Request options.
|
|
18
|
+
*
|
|
19
|
+
* @returns A JSON payload object through a Promise.
|
|
20
|
+
*/
|
|
21
|
+
export declare const sendPost: (options: AuthRequestOptions) => Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Sends a PUT request.
|
|
24
|
+
*
|
|
25
|
+
* @param options Request options.
|
|
26
|
+
*
|
|
27
|
+
* @returns A JSON payload object through a Promise.
|
|
28
|
+
*/
|
|
29
|
+
export declare const sendPut: (options: AuthRequestOptions) => Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Sends a DELETE request.
|
|
32
|
+
*
|
|
33
|
+
* @param options Request options.
|
|
34
|
+
*
|
|
35
|
+
* @returns A JSON payload object through a Promise.
|
|
36
|
+
*/
|
|
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>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.download = exports.sendDelete = exports.sendPut = exports.sendPost = exports.sendGet = void 0;
|
|
27
|
+
const httpHelpers = __importStar(require("../../internal/httpHelpers"));
|
|
28
|
+
/**
|
|
29
|
+
* Sends a GET request.
|
|
30
|
+
*
|
|
31
|
+
* @param options Request options.
|
|
32
|
+
*
|
|
33
|
+
* @returns A JSON payload object through a Promise.
|
|
34
|
+
*/
|
|
35
|
+
const sendGet = (options) => {
|
|
36
|
+
if (typeof options.auth === 'string') {
|
|
37
|
+
options.headers['x-api-key'] = options.auth;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
41
|
+
}
|
|
42
|
+
return httpHelpers.sendGet(options);
|
|
43
|
+
};
|
|
44
|
+
exports.sendGet = sendGet;
|
|
45
|
+
/**
|
|
46
|
+
* Sends a POST request.
|
|
47
|
+
*
|
|
48
|
+
* @param options Request options.
|
|
49
|
+
*
|
|
50
|
+
* @returns A JSON payload object through a Promise.
|
|
51
|
+
*/
|
|
52
|
+
const sendPost = (options) => {
|
|
53
|
+
if (typeof options.auth === 'string') {
|
|
54
|
+
options.headers['x-api-key'] = options.auth;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
58
|
+
}
|
|
59
|
+
return httpHelpers.sendPost(options);
|
|
60
|
+
};
|
|
61
|
+
exports.sendPost = sendPost;
|
|
62
|
+
/**
|
|
63
|
+
* Sends a PUT request.
|
|
64
|
+
*
|
|
65
|
+
* @param options Request options.
|
|
66
|
+
*
|
|
67
|
+
* @returns A JSON payload object through a Promise.
|
|
68
|
+
*/
|
|
69
|
+
const sendPut = (options) => {
|
|
70
|
+
if (typeof options.auth === 'string') {
|
|
71
|
+
options.headers['x-api-key'] = options.auth;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
75
|
+
}
|
|
76
|
+
return httpHelpers.sendPut(options);
|
|
77
|
+
};
|
|
78
|
+
exports.sendPut = sendPut;
|
|
79
|
+
/**
|
|
80
|
+
* Sends a DELETE request.
|
|
81
|
+
*
|
|
82
|
+
* @param options Request options.
|
|
83
|
+
*
|
|
84
|
+
* @returns A JSON payload object through a Promise.
|
|
85
|
+
*/
|
|
86
|
+
const sendDelete = (options) => {
|
|
87
|
+
if (typeof options.auth === 'string') {
|
|
88
|
+
options.headers['x-api-key'] = options.auth;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
92
|
+
}
|
|
93
|
+
return httpHelpers.sendDelete(options);
|
|
94
|
+
};
|
|
95
|
+
exports.sendDelete = sendDelete;
|
|
96
|
+
/**
|
|
97
|
+
* Download a file.
|
|
98
|
+
*
|
|
99
|
+
* @param filepath Where to save the file.
|
|
100
|
+
* @param options Request options.
|
|
101
|
+
*
|
|
102
|
+
* @returns A JSON payload object through a Promise.
|
|
103
|
+
*/
|
|
104
|
+
const download = (filepath, options) => {
|
|
105
|
+
if (typeof options.auth === 'string') {
|
|
106
|
+
options.headers['x-api-key'] = options.auth;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
options.headers['Authorization'] = `Bearer ${options.auth.access_token}`;
|
|
110
|
+
}
|
|
111
|
+
return httpHelpers.download(filepath, options);
|
|
112
|
+
};
|
|
113
|
+
exports.download = download;
|
|
114
|
+
//# sourceMappingURL=httpHelpers.js.map
|
|
@@ -0,0 +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,IAAI,OAAO,OAAO,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K,QAAQ,EAAE;QAClC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;KAC/C;SAAM;QACH,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;KAC5E;IAED,OAAO,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEF;;;;;;;GAOG;AACI,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,OAA2B,EAAE,EAAE;IACtE,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;QAClC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;KAC/C;SAAM;QACH,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;KAC5E;IAED,OAAO,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import JwtToken from './types/jwtToken';
|
|
2
|
+
/**
|
|
3
|
+
* Starts Media Input
|
|
4
|
+
*
|
|
5
|
+
* To use the Dolby provided temporary storage is a two step process.
|
|
6
|
+
*
|
|
7
|
+
* 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.
|
|
8
|
+
*
|
|
9
|
+
* 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.
|
|
10
|
+
*
|
|
11
|
+
* @link https://docs.dolby.io/media-apis/reference/media-input
|
|
12
|
+
*
|
|
13
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
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
|
+
*
|
|
16
|
+
* @returns The upload URL through a `Promise`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getUploadUrl: (auth: string | JwtToken, dlbUrl: string) => Promise<string | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Starts Media Download
|
|
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-get
|
|
27
|
+
*
|
|
28
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
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
|
+
* @param filePath Local file path where to download the file to.
|
|
31
|
+
*/
|
|
32
|
+
export declare const downloadFile: (auth: string | JwtToken, dlbUrl: string, filePath: string) => Promise<void>;
|
package/dist/media/io.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
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.downloadFile = exports.getUploadUrl = void 0;
|
|
13
|
+
const httpHelpers_1 = require("./internal/httpHelpers");
|
|
14
|
+
/**
|
|
15
|
+
* Starts Media Input
|
|
16
|
+
*
|
|
17
|
+
* To use the Dolby provided temporary storage is a two step process.
|
|
18
|
+
*
|
|
19
|
+
* 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.
|
|
20
|
+
*
|
|
21
|
+
* 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.
|
|
22
|
+
*
|
|
23
|
+
* @link https://docs.dolby.io/media-apis/reference/media-input
|
|
24
|
+
*
|
|
25
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
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
|
+
*
|
|
28
|
+
* @returns The upload URL through a `Promise`.
|
|
29
|
+
*/
|
|
30
|
+
const getUploadUrl = (auth, dlbUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const payload = {
|
|
32
|
+
url: dlbUrl,
|
|
33
|
+
};
|
|
34
|
+
const requestOptions = {
|
|
35
|
+
hostname: 'api.dolby.com',
|
|
36
|
+
path: '/media/input',
|
|
37
|
+
headers: {},
|
|
38
|
+
auth,
|
|
39
|
+
body: JSON.stringify(payload, null, ' '),
|
|
40
|
+
};
|
|
41
|
+
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
42
|
+
if (response.hasOwnProperty('url')) {
|
|
43
|
+
return response['url'];
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
});
|
|
47
|
+
exports.getUploadUrl = getUploadUrl;
|
|
48
|
+
/**
|
|
49
|
+
* Starts Media Download
|
|
50
|
+
*
|
|
51
|
+
* You can download media you previously uploaded with /media/input or media that was generated through another Dolby Media API.
|
|
52
|
+
*
|
|
53
|
+
* 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.
|
|
54
|
+
*
|
|
55
|
+
* @link https://docs.dolby.io/media-apis/reference/media-output-get
|
|
56
|
+
*
|
|
57
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
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
|
+
* @param filePath Local file path where to download the file to.
|
|
60
|
+
*/
|
|
61
|
+
const downloadFile = (auth, dlbUrl, filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
const requestOptions = {
|
|
63
|
+
hostname: 'api.dolby.com',
|
|
64
|
+
path: '/media/output',
|
|
65
|
+
params: {
|
|
66
|
+
url: dlbUrl,
|
|
67
|
+
},
|
|
68
|
+
headers: {},
|
|
69
|
+
auth,
|
|
70
|
+
};
|
|
71
|
+
(0, httpHelpers_1.download)(filePath, requestOptions);
|
|
72
|
+
});
|
|
73
|
+
exports.downloadFile = downloadFile;
|
|
74
|
+
//# sourceMappingURL=io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/media/io.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAgF;AAGhF;;;;;;;;;;;;;;;GAeG;AACI,MAAM,YAAY,GAAG,CAAO,IAAuB,EAAE,MAAc,EAA0B,EAAE;IAClG,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,IAAI;QACJ,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,IAAuB,EAAE,MAAc,EAAE,QAAgB,EAAiB,EAAE;IAC3G,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE;YACJ,GAAG,EAAE,MAAM;SACd;QACD,OAAO,EAAE,EAAE;QACX,IAAI;KACP,CAAC;IAEF,IAAA,sBAAQ,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACvC,CAAC,CAAA,CAAC;AAZW,QAAA,YAAY,gBAYvB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import JwtToken from './types/jwtToken';
|
|
2
|
+
import { ListJobsOptions, ListAllJobsOptions, JobsResponse, Job } from './types/jobs';
|
|
3
|
+
/**
|
|
4
|
+
* Query Media Jobs.
|
|
5
|
+
* List of jobs previously submitted, up to the last 31 days.
|
|
6
|
+
*
|
|
7
|
+
* @link https://docs.dolby.io/media-apis/reference/media-jobs-get
|
|
8
|
+
*
|
|
9
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
10
|
+
* @param options Options to request the list of jobs.
|
|
11
|
+
*
|
|
12
|
+
* @returns A `JobsResponse` object through a `Promise`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const list: (auth: string | JwtToken, options: ListJobsOptions) => Promise<JobsResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Query Media Jobs.
|
|
17
|
+
* List of all jobs previously submitted, up to the last 31 days.
|
|
18
|
+
*
|
|
19
|
+
* @link https://docs.dolby.io/media-apis/reference/media-jobs-get
|
|
20
|
+
*
|
|
21
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
22
|
+
* @param options Options to request the list of jobs.
|
|
23
|
+
*
|
|
24
|
+
* @returns An array of `Job` objects through a `Promise`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const listAll: (auth: string | JwtToken, options: ListAllJobsOptions) => Promise<Array<Job>>;
|
|
27
|
+
/**
|
|
28
|
+
* Requests cancellation of a previously submitted job.
|
|
29
|
+
*
|
|
30
|
+
* @link https://docs.dolby.io/media-apis/reference/media-jobs-cancel-post
|
|
31
|
+
*
|
|
32
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
33
|
+
* @param jobId Identifier of the job to cancel.
|
|
34
|
+
*/
|
|
35
|
+
export declare const cancel: (auth: string | JwtToken, jobId: string) => Promise<void>;
|
|
@@ -0,0 +1,116 @@
|
|
|
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.cancel = exports.listAll = exports.list = void 0;
|
|
13
|
+
const httpHelpers_1 = require("./internal/httpHelpers");
|
|
14
|
+
/**
|
|
15
|
+
* Query Media Jobs.
|
|
16
|
+
* List of jobs previously submitted, up to the last 31 days.
|
|
17
|
+
*
|
|
18
|
+
* @link https://docs.dolby.io/media-apis/reference/media-jobs-get
|
|
19
|
+
*
|
|
20
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
21
|
+
* @param options Options to request the list of jobs.
|
|
22
|
+
*
|
|
23
|
+
* @returns A `JobsResponse` object through a `Promise`.
|
|
24
|
+
*/
|
|
25
|
+
const list = (auth, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
const params = {};
|
|
27
|
+
if (options.submitted_after) {
|
|
28
|
+
params['submitted_after'] = options.submitted_after;
|
|
29
|
+
}
|
|
30
|
+
if (options.submitted_before) {
|
|
31
|
+
params['submitted_before'] = options.submitted_before;
|
|
32
|
+
}
|
|
33
|
+
if (options.status) {
|
|
34
|
+
params['status'] = options.status;
|
|
35
|
+
}
|
|
36
|
+
if (options.next_token) {
|
|
37
|
+
params['next_token'] = options.next_token;
|
|
38
|
+
}
|
|
39
|
+
const requestOptions = {
|
|
40
|
+
hostname: 'api.dolby.com',
|
|
41
|
+
path: '/media/jobs',
|
|
42
|
+
params,
|
|
43
|
+
headers: {},
|
|
44
|
+
auth,
|
|
45
|
+
};
|
|
46
|
+
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
47
|
+
return response;
|
|
48
|
+
});
|
|
49
|
+
exports.list = list;
|
|
50
|
+
/**
|
|
51
|
+
* Query Media Jobs.
|
|
52
|
+
* List of all jobs previously submitted, up to the last 31 days.
|
|
53
|
+
*
|
|
54
|
+
* @link https://docs.dolby.io/media-apis/reference/media-jobs-get
|
|
55
|
+
*
|
|
56
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
57
|
+
* @param options Options to request the list of jobs.
|
|
58
|
+
*
|
|
59
|
+
* @returns An array of `Job` objects through a `Promise`.
|
|
60
|
+
*/
|
|
61
|
+
const listAll = (auth, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
const params = {};
|
|
63
|
+
if (options.submitted_after) {
|
|
64
|
+
params['submitted_after'] = options.submitted_after;
|
|
65
|
+
}
|
|
66
|
+
if (options.submitted_before) {
|
|
67
|
+
params['submitted_before'] = options.submitted_before;
|
|
68
|
+
}
|
|
69
|
+
if (options.status) {
|
|
70
|
+
params['status'] = options.status;
|
|
71
|
+
}
|
|
72
|
+
const requestOptions = {
|
|
73
|
+
hostname: 'api.dolby.com',
|
|
74
|
+
path: '/media/jobs',
|
|
75
|
+
headers: {},
|
|
76
|
+
auth,
|
|
77
|
+
};
|
|
78
|
+
const result = [];
|
|
79
|
+
do {
|
|
80
|
+
requestOptions.params = params;
|
|
81
|
+
const response = (yield (0, httpHelpers_1.sendGet)(requestOptions));
|
|
82
|
+
for (let index = 0; index < response.jobs.length; index++) {
|
|
83
|
+
const object = response.jobs[index];
|
|
84
|
+
result.push(object);
|
|
85
|
+
}
|
|
86
|
+
if (!response.next_token || response.next_token.length <= 0) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
params['next_token'] = response.next_token;
|
|
90
|
+
} while (true);
|
|
91
|
+
return result;
|
|
92
|
+
});
|
|
93
|
+
exports.listAll = listAll;
|
|
94
|
+
/**
|
|
95
|
+
* Requests cancellation of a previously submitted job.
|
|
96
|
+
*
|
|
97
|
+
* @link https://docs.dolby.io/media-apis/reference/media-jobs-cancel-post
|
|
98
|
+
*
|
|
99
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
100
|
+
* @param jobId Identifier of the job to cancel.
|
|
101
|
+
*/
|
|
102
|
+
const cancel = (auth, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
|
+
const params = {
|
|
104
|
+
job_id: jobId,
|
|
105
|
+
};
|
|
106
|
+
const requestOptions = {
|
|
107
|
+
hostname: 'api.dolby.com',
|
|
108
|
+
path: '/media/jobs/cancel',
|
|
109
|
+
headers: {},
|
|
110
|
+
auth,
|
|
111
|
+
params: params,
|
|
112
|
+
};
|
|
113
|
+
yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
114
|
+
});
|
|
115
|
+
exports.cancel = cancel;
|
|
116
|
+
//#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AAE,MAAM;KACjB,CAAC;IAEF,MAAM,IAAA,sBAAQ,EAAC,cAAc,CAAC,CAAC;AACnC,CAAC,CAAA,CAAC;AAdW,QAAA,MAAM,UAcjB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import JwtToken from './types/jwtToken';
|
|
2
|
+
import { MasteringPreviewJob, MasteringJob } from './types/mastering';
|
|
3
|
+
/**
|
|
4
|
+
* Starts mastering preview to improve your music.
|
|
5
|
+
*
|
|
6
|
+
* The `inputs` location for your source media file as well as the `outputs` location for the processed media file are required.
|
|
7
|
+
*
|
|
8
|
+
* A `preset` applies dynamic EQ processing to shape your music to match a desired sound. There are also additional optional parameters that can be provided to control the mastering output.
|
|
9
|
+
*
|
|
10
|
+
* A `segment` object specifying preview `start` may optionally be provided.
|
|
11
|
+
*
|
|
12
|
+
* This is an asynchronous operation. You receive a `job_id` that you use to retrieve the results when the mastering is complete.
|
|
13
|
+
*
|
|
14
|
+
* To learn more, see the example requests and responses.
|
|
15
|
+
*
|
|
16
|
+
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
|
|
17
|
+
*
|
|
18
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
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
|
|
20
|
+
*
|
|
21
|
+
* @returns The job identifier through a `Promise`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const startPreview: (auth: string | JwtToken, jobContent: string) => Promise<string | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Gets Mastering Preview Results
|
|
26
|
+
*
|
|
27
|
+
* For a given job_id, this method will check if the mastering task has completed.
|
|
28
|
+
* When the status is Success you'll be able to retrieve your results from the outputs locations you provided in the original POST.
|
|
29
|
+
*
|
|
30
|
+
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-preview-get
|
|
31
|
+
*
|
|
32
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
33
|
+
* @param jobId Identifier of the job to retrieve.
|
|
34
|
+
*
|
|
35
|
+
* @returns The `MasteringPreviewJob` object through a `Promise`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getPreviewResults: (auth: string | JwtToken, jobId: string) => Promise<MasteringPreviewJob>;
|
|
38
|
+
/**
|
|
39
|
+
* Starts mastering to improve your music.
|
|
40
|
+
*
|
|
41
|
+
* The `inputs` location for your source media file as well as the `outputs` location for the processed media file are required.
|
|
42
|
+
*
|
|
43
|
+
* A `preset` applies dynamic EQ processing to shape your music to match a desired sound. There are also additional optional parameters that can be provided to control the mastering output.
|
|
44
|
+
*
|
|
45
|
+
* This is an asynchronous operation. You receive a `job_id` that you use to retrieve the results when the mastering is complete.
|
|
46
|
+
*
|
|
47
|
+
* To learn more, see the example requests and responses.
|
|
48
|
+
*
|
|
49
|
+
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
|
|
50
|
+
*
|
|
51
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
52
|
+
* @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
|
|
53
|
+
*
|
|
54
|
+
* @returns The job identifier through a `Promise`.
|
|
55
|
+
*/
|
|
56
|
+
export declare const start: (auth: string | JwtToken, jobContent: string) => Promise<string | null>;
|
|
57
|
+
/**
|
|
58
|
+
* Gets Mastering Results
|
|
59
|
+
*
|
|
60
|
+
* For a given job_id, this method will check if the mastering task has completed.
|
|
61
|
+
* When the status is Success you'll be able to retrieve your results from the outputs locations you provided in the original POST.
|
|
62
|
+
*
|
|
63
|
+
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-get
|
|
64
|
+
*
|
|
65
|
+
* @param auth Your Dolby.io Media API Key or a JWT Token.
|
|
66
|
+
* @param jobId Identifier of the job to retrieve.
|
|
67
|
+
*
|
|
68
|
+
* @returns The `MasteringJob` object through a `Promise`.
|
|
69
|
+
*/
|
|
70
|
+
export declare const getResults: (auth: string | JwtToken, jobId: string) => Promise<MasteringJob>;
|