@dolbyio/dolbyio-rest-apis-client 2.0.0 → 2.1.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.
@@ -4,7 +4,8 @@ import * as diagnose from './diagnose';
4
4
  import * as enhance from './enhance';
5
5
  import * as io from './io';
6
6
  import * as jobs from './jobs';
7
+ import * as mastering from './mastering';
7
8
  import * as transcode from './transcode';
8
9
  import * as platform from './platform';
9
10
  import * as webhooks from './webhooks';
10
- export { analyze, analyzeSpeech, diagnose, enhance, io, jobs, transcode, platform, webhooks };
11
+ export { analyze, analyzeSpeech, diagnose, enhance, io, jobs, mastering, transcode, platform, webhooks };
@@ -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.webhooks = exports.platform = exports.transcode = exports.jobs = exports.io = exports.enhance = exports.diagnose = exports.analyzeSpeech = exports.analyze = void 0;
26
+ exports.webhooks = exports.platform = exports.transcode = exports.mastering = exports.jobs = exports.io = exports.enhance = exports.diagnose = exports.analyzeSpeech = exports.analyze = void 0;
27
27
  const analyze = __importStar(require("./analyze"));
28
28
  exports.analyze = analyze;
29
29
  const analyzeSpeech = __importStar(require("./analyzeSpeech"));
@@ -36,6 +36,8 @@ const io = __importStar(require("./io"));
36
36
  exports.io = io;
37
37
  const jobs = __importStar(require("./jobs"));
38
38
  exports.jobs = jobs;
39
+ const mastering = __importStar(require("./mastering"));
40
+ exports.mastering = mastering;
39
41
  const transcode = __importStar(require("./transcode"));
40
42
  exports.transcode = transcode;
41
43
  const platform = __importStar(require("./platform"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AAU5B,0BAAO;AAThB,+DAAiD;AAS/B,sCAAa;AAR/B,qDAAuC;AAQN,4BAAQ;AAPzC,mDAAqC;AAOM,0BAAO;AANlD,yCAA2B;AAMyB,gBAAE;AALtD,6CAA+B;AAKyB,oBAAI;AAJ5D,uDAAyC;AAIqB,8BAAS;AAHvE,qDAAuC;AAGkC,4BAAQ;AAFjF,qDAAuC;AAE4C,4BAAQ"}
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,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>;
@@ -0,0 +1,136 @@
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 = exports.getPreviewResults = exports.startPreview = void 0;
13
+ const httpHelpers_1 = require("./internal/httpHelpers");
14
+ /**
15
+ * Starts mastering preview to improve your music.
16
+ *
17
+ * The `inputs` location for your source media file as well as the `outputs` location for the processed media file are required.
18
+ *
19
+ * 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.
20
+ *
21
+ * A `segment` object specifying preview `start` may optionally be provided.
22
+ *
23
+ * This is an asynchronous operation. You receive a `job_id` that you use to retrieve the results when the mastering is complete.
24
+ *
25
+ * To learn more, see the example requests and responses.
26
+ *
27
+ * @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
28
+ *
29
+ * @param auth Your Dolby.io Media API Key or a JWT Token.
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-post
31
+ *
32
+ * @returns The job identifier through a `Promise`.
33
+ */
34
+ const startPreview = (auth, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
35
+ const requestOptions = {
36
+ hostname: 'api.dolby.com',
37
+ path: '/media/master/preview',
38
+ headers: {},
39
+ auth,
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;
47
+ });
48
+ exports.startPreview = startPreview;
49
+ /**
50
+ * Gets Mastering Preview Results
51
+ *
52
+ * For a given job_id, this method will check if the mastering task has completed.
53
+ * When the status is Success you'll be able to retrieve your results from the outputs locations you provided in the original POST.
54
+ *
55
+ * @link https://docs.dolby.io/media-apis/reference/media-music-mastering-preview-get
56
+ *
57
+ * @param auth Your Dolby.io Media API Key or a JWT Token.
58
+ * @param jobId Identifier of the job to retrieve.
59
+ *
60
+ * @returns The `MasteringPreviewJob` object through a `Promise`.
61
+ */
62
+ const getPreviewResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function* () {
63
+ const requestOptions = {
64
+ hostname: 'api.dolby.com',
65
+ path: '/media/master/preview',
66
+ params: {
67
+ job_id: jobId,
68
+ },
69
+ headers: {},
70
+ auth,
71
+ };
72
+ const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
73
+ return response;
74
+ });
75
+ exports.getPreviewResults = getPreviewResults;
76
+ /**
77
+ * Starts mastering to improve your music.
78
+ *
79
+ * The `inputs` location for your source media file as well as the `outputs` location for the processed media file are required.
80
+ *
81
+ * 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.
82
+ *
83
+ * This is an asynchronous operation. You receive a `job_id` that you use to retrieve the results when the mastering is complete.
84
+ *
85
+ * To learn more, see the example requests and responses.
86
+ *
87
+ * @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
88
+ *
89
+ * @param auth Your Dolby.io Media API Key or a JWT Token.
90
+ * @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
91
+ *
92
+ * @returns The job identifier through a `Promise`.
93
+ */
94
+ const start = (auth, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
95
+ const requestOptions = {
96
+ hostname: 'api.dolby.com',
97
+ path: '/media/master',
98
+ headers: {},
99
+ auth,
100
+ body: jobContent,
101
+ };
102
+ const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
103
+ if (response.hasOwnProperty('job_id')) {
104
+ return response['job_id'];
105
+ }
106
+ return null;
107
+ });
108
+ exports.start = start;
109
+ /**
110
+ * Gets Mastering Results
111
+ *
112
+ * For a given job_id, this method will check if the mastering task has completed.
113
+ * When the status is Success you'll be able to retrieve your results from the outputs locations you provided in the original POST.
114
+ *
115
+ * @link https://docs.dolby.io/media-apis/reference/media-music-mastering-get
116
+ *
117
+ * @param auth Your Dolby.io Media API Key or a JWT Token.
118
+ * @param jobId Identifier of the job to retrieve.
119
+ *
120
+ * @returns The `MasteringJob` object through a `Promise`.
121
+ */
122
+ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function* () {
123
+ const requestOptions = {
124
+ hostname: 'api.dolby.com',
125
+ path: '/media/master',
126
+ params: {
127
+ job_id: jobId,
128
+ },
129
+ headers: {},
130
+ auth,
131
+ };
132
+ const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
133
+ return response;
134
+ });
135
+ exports.getResults = getResults;
136
+ //# sourceMappingURL=mastering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastering.js","sourceRoot":"","sources":["../../src/media/mastering.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,YAAY,GAAG,CAAO,IAAuB,EAAE,UAAkB,EAA0B,EAAE;IACtG,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,uBAAuB;QAC7B,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,Y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AAC;IAC/C,OAAO,QAAwB,CAAC;AACpC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
@@ -0,0 +1,13 @@
1
+ import { JobResult } from './jobResults';
2
+ export interface MasteringPreviewJobResult {
3
+ /** Level of the media prior to mastering. Measured in loudness units relative to full scale (LUFS). */
4
+ initial_level: string;
5
+ }
6
+ export interface MasteringPreviewJob extends JobResult<MasteringPreviewJobResult> {
7
+ }
8
+ export interface MasteringJobResult extends MasteringPreviewJobResult {
9
+ /** Level of the media after mastering. Measured in loudness units relative to full scale (LUFS). */
10
+ final_level: string;
11
+ }
12
+ export interface MasteringJob extends JobResult<MasteringJobResult> {
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mastering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastering.js","sourceRoot":"","sources":["../../../src/media/types/mastering.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolbyio/dolbyio-rest-apis-client",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "Node.JS wrapper for the dolby.io REST APIs",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {