@dolbyio/dolbyio-rest-apis-client 2.1.2 → 3.1.0
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/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 +1 -1
- 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 +1 -1
package/dist/media/mastering.js
CHANGED
|
@@ -26,17 +26,17 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
26
26
|
*
|
|
27
27
|
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
29
|
+
* @param accessToken Access token to use for authentication.
|
|
30
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
31
|
*
|
|
32
32
|
* @returns The job identifier through a `Promise`.
|
|
33
33
|
*/
|
|
34
|
-
const startPreview = (
|
|
34
|
+
const startPreview = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
35
|
const requestOptions = {
|
|
36
36
|
hostname: 'api.dolby.com',
|
|
37
37
|
path: '/media/master/preview',
|
|
38
38
|
headers: {},
|
|
39
|
-
|
|
39
|
+
accessToken,
|
|
40
40
|
body: jobContent,
|
|
41
41
|
};
|
|
42
42
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -54,12 +54,12 @@ exports.startPreview = startPreview;
|
|
|
54
54
|
*
|
|
55
55
|
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-preview-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 `MasteringPreviewJob` object through a `Promise`.
|
|
61
61
|
*/
|
|
62
|
-
const getPreviewResults = (
|
|
62
|
+
const getPreviewResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
63
|
const requestOptions = {
|
|
64
64
|
hostname: 'api.dolby.com',
|
|
65
65
|
path: '/media/master/preview',
|
|
@@ -67,7 +67,7 @@ const getPreviewResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, fun
|
|
|
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;
|
|
@@ -86,17 +86,17 @@ exports.getPreviewResults = getPreviewResults;
|
|
|
86
86
|
*
|
|
87
87
|
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-post
|
|
88
88
|
*
|
|
89
|
-
* @param
|
|
89
|
+
* @param accessToken Access token to use for authentication.
|
|
90
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
91
|
*
|
|
92
92
|
* @returns The job identifier through a `Promise`.
|
|
93
93
|
*/
|
|
94
|
-
const start = (
|
|
94
|
+
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
95
|
const requestOptions = {
|
|
96
96
|
hostname: 'api.dolby.com',
|
|
97
97
|
path: '/media/master',
|
|
98
98
|
headers: {},
|
|
99
|
-
|
|
99
|
+
accessToken,
|
|
100
100
|
body: jobContent,
|
|
101
101
|
};
|
|
102
102
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -114,12 +114,12 @@ exports.start = start;
|
|
|
114
114
|
*
|
|
115
115
|
* @link https://docs.dolby.io/media-apis/reference/media-music-mastering-get
|
|
116
116
|
*
|
|
117
|
-
* @param
|
|
117
|
+
* @param accessToken Access token to use for authentication.
|
|
118
118
|
* @param jobId Identifier of the job to retrieve.
|
|
119
119
|
*
|
|
120
120
|
* @returns The `MasteringJob` object through a `Promise`.
|
|
121
121
|
*/
|
|
122
|
-
const getResults = (
|
|
122
|
+
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
123
|
const requestOptions = {
|
|
124
124
|
hostname: 'api.dolby.com',
|
|
125
125
|
path: '/media/master',
|
|
@@ -127,7 +127,7 @@ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function*
|
|
|
127
127
|
job_id: jobId,
|
|
128
128
|
},
|
|
129
129
|
headers: {},
|
|
130
|
-
|
|
130
|
+
accessToken,
|
|
131
131
|
};
|
|
132
132
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
133
133
|
return response;
|
|
@@ -1 +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,
|
|
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,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IACpG,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,YAAY,gBAevB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,iBAAiB,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAgC,EAAE;IAC1G,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,QAA+B,CAAC;AAC3C,CAAC,CAAA,CAAC;AAbW,QAAA,iBAAiB,qBAa5B;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,eAAe;QACrB,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;;;;;;;;;;;;GAYG;AACI,MAAM,UAAU,GAAG,CAAO,WAAqB,EAAE,KAAa,EAAyB,EAAE;IAC5F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,eAAe;QACrB,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,QAAwB,CAAC;AACpC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
package/dist/media/platform.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import JwtToken from './types/jwtToken';
|
|
2
2
|
/**
|
|
3
|
-
* Generates
|
|
3
|
+
* Generates an API token.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* The token will expire in 12 hours.
|
|
5
|
+
* @link https://docs.dolby.io/media-apis/reference/get-api-token
|
|
7
6
|
*
|
|
8
|
-
* @
|
|
9
|
-
*
|
|
10
|
-
* @param apiKey Your Dolby.io API Key.
|
|
11
|
-
* @param apiSecret Your Dolby.io API Secret.
|
|
7
|
+
* @param appKey Your Dolby.io App Key.
|
|
8
|
+
* @param appSecret Your Dolby.io App Secret.
|
|
12
9
|
*
|
|
13
10
|
* @returns A `JwtToken` object through a `Promise`.
|
|
14
11
|
*/
|
|
15
|
-
export declare const
|
|
12
|
+
export declare const getApiAccessToken: (appKey: string, appSecret: string, expiresIn: number | undefined) => Promise<JwtToken>;
|
package/dist/media/platform.js
CHANGED
|
@@ -9,27 +9,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.getApiAccessToken = void 0;
|
|
13
13
|
const httpHelpers_1 = require("../internal/httpHelpers");
|
|
14
14
|
/**
|
|
15
|
-
* Generates
|
|
15
|
+
* Generates an API token.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* The token will expire in 12 hours.
|
|
17
|
+
* @link https://docs.dolby.io/media-apis/reference/get-api-token
|
|
19
18
|
*
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
* @param apiKey Your Dolby.io API Key.
|
|
23
|
-
* @param apiSecret Your Dolby.io API Secret.
|
|
19
|
+
* @param appKey Your Dolby.io App Key.
|
|
20
|
+
* @param appSecret Your Dolby.io App Secret.
|
|
24
21
|
*
|
|
25
22
|
* @returns A `JwtToken` object through a `Promise`.
|
|
26
23
|
*/
|
|
27
|
-
const
|
|
24
|
+
const getApiAccessToken = (appKey, appSecret, expiresIn) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
25
|
let body = 'grant_type=client_credentials';
|
|
29
|
-
|
|
26
|
+
if (expiresIn) {
|
|
27
|
+
body += `&expires_in=${expiresIn}`;
|
|
28
|
+
}
|
|
29
|
+
const authz = Buffer.from(`${appKey}:${appSecret}`).toString('base64');
|
|
30
30
|
const options = {
|
|
31
|
-
hostname: 'api.dolby.
|
|
32
|
-
path: '/
|
|
31
|
+
hostname: 'api.dolby.io',
|
|
32
|
+
path: '/v1/auth/token',
|
|
33
33
|
headers: {
|
|
34
34
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
35
35
|
'Cache-Control': 'no-cache',
|
|
@@ -40,5 +40,5 @@ const getAccessToken = (apiKey, apiSecret) => __awaiter(void 0, void 0, void 0,
|
|
|
40
40
|
const response = yield (0, httpHelpers_1.sendPost)(options);
|
|
41
41
|
return response;
|
|
42
42
|
});
|
|
43
|
-
exports.
|
|
43
|
+
exports.getApiAccessToken = getApiAccessToken;
|
|
44
44
|
//# sourceMappingURL=platform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/media/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAmD;AAGnD
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/media/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAmD;AAGnD;;;;;;;;;GASG;AACI,MAAM,iBAAiB,GAAG,CAAO,MAAc,EAAE,SAAiB,EAAE,SAA6B,EAAqB,EAAE;IAC3H,IAAI,IAAI,GAAG,+BAA+B,CAAC;IAC3C,IAAI,SAAS,EAAE;QACX,IAAI,IAAI,eAAe,SAAS,EAAE,CAAC;KACtC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG;QACZ,QAAQ,EAAE,cAAc;QACxB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE;YACL,cAAc,EAAE,mCAAmC;YACnD,eAAe,EAAE,UAAU;YAC3B,aAAa,EAAE,SAAS,KAAK,EAAE;SAClC;QACD,IAAI;KACP,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAQ,EAAC,OAAO,CAAC,CAAC;IACzC,OAAO,QAAoB,CAAC;AAChC,CAAC,CAAA,CAAC;AArBW,QAAA,iBAAiB,qBAqB5B"}
|
|
@@ -7,12 +7,12 @@ import { TranscodeJob } from './types/transcode';
|
|
|
7
7
|
*
|
|
8
8
|
* @link https://docs.dolby.io/media-apis/reference/media-transcode-post
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param accessToken Access token to use for authentication.
|
|
11
11
|
* @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-transcode-post
|
|
12
12
|
*
|
|
13
13
|
* @returns The job identifier through a `Promise`.
|
|
14
14
|
*/
|
|
15
|
-
export declare const start: (
|
|
15
|
+
export declare const start: (accessToken: JwtToken, jobContent: string) => Promise<string | null>;
|
|
16
16
|
/**
|
|
17
17
|
* Gets Transcode Results.
|
|
18
18
|
*
|
|
@@ -22,9 +22,9 @@ export declare const start: (auth: string | JwtToken, jobContent: string) => Pro
|
|
|
22
22
|
*
|
|
23
23
|
* @link https://docs.dolby.io/media-apis/reference/media-transcode-get
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
25
|
+
* @param accessToken Access token to use for authentication.
|
|
26
26
|
* @param jobId Identifier of the job to retrieve.
|
|
27
27
|
*
|
|
28
28
|
* @returns The `TranscodeJob` object through a `Promise`.
|
|
29
29
|
*/
|
|
30
|
-
export declare const getResults: (
|
|
30
|
+
export declare const getResults: (accessToken: JwtToken, jobId: string) => Promise<TranscodeJob>;
|
package/dist/media/transcode.js
CHANGED
|
@@ -18,17 +18,17 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
18
18
|
*
|
|
19
19
|
* @link https://docs.dolby.io/media-apis/reference/media-transcode-post
|
|
20
20
|
*
|
|
21
|
-
* @param
|
|
21
|
+
* @param accessToken Access token to use for authentication.
|
|
22
22
|
* @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-transcode-post
|
|
23
23
|
*
|
|
24
24
|
* @returns The job identifier through a `Promise`.
|
|
25
25
|
*/
|
|
26
|
-
const start = (
|
|
26
|
+
const start = (accessToken, jobContent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
27
|
const requestOptions = {
|
|
28
28
|
hostname: 'api.dolby.com',
|
|
29
29
|
path: '/media/transcode',
|
|
30
30
|
headers: {},
|
|
31
|
-
|
|
31
|
+
accessToken,
|
|
32
32
|
body: jobContent,
|
|
33
33
|
};
|
|
34
34
|
const response = yield (0, httpHelpers_1.sendPost)(requestOptions);
|
|
@@ -47,12 +47,12 @@ exports.start = start;
|
|
|
47
47
|
*
|
|
48
48
|
* @link https://docs.dolby.io/media-apis/reference/media-transcode-get
|
|
49
49
|
*
|
|
50
|
-
* @param
|
|
50
|
+
* @param accessToken Access token to use for authentication.
|
|
51
51
|
* @param jobId Identifier of the job to retrieve.
|
|
52
52
|
*
|
|
53
53
|
* @returns The `TranscodeJob` object through a `Promise`.
|
|
54
54
|
*/
|
|
55
|
-
const getResults = (
|
|
55
|
+
const getResults = (accessToken, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
56
|
const requestOptions = {
|
|
57
57
|
hostname: 'api.dolby.com',
|
|
58
58
|
path: '/media/transcode',
|
|
@@ -60,7 +60,7 @@ const getResults = (auth, jobId) => __awaiter(void 0, void 0, void 0, function*
|
|
|
60
60
|
job_id: jobId,
|
|
61
61
|
},
|
|
62
62
|
headers: {},
|
|
63
|
-
|
|
63
|
+
accessToken,
|
|
64
64
|
};
|
|
65
65
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
66
66
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcode.js","sourceRoot":"","sources":["../../src/media/transcode.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;GAWG;AACI,MAAM,KAAK,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"transcode.js","sourceRoot":"","sources":["../../src/media/transcode.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA+E;AAI/E;;;;;;;;;;;GAWG;AACI,MAAM,KAAK,GAAG,CAAO,WAAqB,EAAE,UAAkB,EAA0B,EAAE;IAC7F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,kBAAkB;QACxB,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,EAAyB,EAAE;IAC5F,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,kBAAkB;QACxB,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,QAAwB,CAAC;AACpC,CAAC,CAAA,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
package/dist/media/webhooks.d.ts
CHANGED
|
@@ -6,41 +6,41 @@ import { UpdateWebhookOptions, Webhook } from './types/webhooks';
|
|
|
6
6
|
*
|
|
7
7
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-post
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param accessToken Access token to use for authentication.
|
|
10
10
|
* @param url The callback url that will be called when job execution completes.
|
|
11
11
|
* @param headers (Optional) Headers to include in the webhook call.
|
|
12
12
|
*
|
|
13
13
|
* @returns The webhook identifier through a `Promise`.
|
|
14
14
|
*/
|
|
15
|
-
export declare const registerWebhook: (
|
|
15
|
+
export declare const registerWebhook: (accessToken: JwtToken, url: string, headers?: http.OutgoingHttpHeaders) => Promise<string | null>;
|
|
16
16
|
/**
|
|
17
17
|
* Updates the previously registered webhook configuration.
|
|
18
18
|
*
|
|
19
19
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-put
|
|
20
20
|
*
|
|
21
|
-
* @param
|
|
21
|
+
* @param accessToken Access token to use for authentication.
|
|
22
22
|
* @param options Options to update the webhook.
|
|
23
23
|
*/
|
|
24
|
-
export declare const updateWebhook: (
|
|
24
|
+
export declare const updateWebhook: (accessToken: JwtToken, options: UpdateWebhookOptions) => Promise<void>;
|
|
25
25
|
/**
|
|
26
26
|
* Retrieves the previously registered webhook configuration.
|
|
27
27
|
*
|
|
28
28
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-get
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
30
|
+
* @param accessToken Access token to use for authentication.
|
|
31
31
|
* @param webhookId Identifier of the webhook to retrieve.
|
|
32
32
|
*
|
|
33
33
|
* @returns The `Webhook` object through a `Promise`.
|
|
34
34
|
*/
|
|
35
|
-
export declare const retrieveWebhook: (
|
|
35
|
+
export declare const retrieveWebhook: (accessToken: JwtToken, webhookId: string) => Promise<Webhook>;
|
|
36
36
|
/**
|
|
37
37
|
* Deletes a previously registered webhook configuration.
|
|
38
38
|
*
|
|
39
39
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-delete
|
|
40
40
|
*
|
|
41
|
-
* @param
|
|
41
|
+
* @param accessToken Access token to use for authentication.
|
|
42
42
|
* @param webhookId Identifier of the webhook to delete.
|
|
43
43
|
*
|
|
44
44
|
* @returns The webhook identifier through a `Promise`.
|
|
45
45
|
*/
|
|
46
|
-
export declare const deleteWebhook: (
|
|
46
|
+
export declare const deleteWebhook: (accessToken: JwtToken, webhookId: string) => Promise<string | null>;
|
package/dist/media/webhooks.js
CHANGED
|
@@ -16,13 +16,13 @@ const httpHelpers_1 = require("./internal/httpHelpers");
|
|
|
16
16
|
*
|
|
17
17
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-post
|
|
18
18
|
*
|
|
19
|
-
* @param
|
|
19
|
+
* @param accessToken Access token to use for authentication.
|
|
20
20
|
* @param url The callback url that will be called when job execution completes.
|
|
21
21
|
* @param headers (Optional) Headers to include in the webhook call.
|
|
22
22
|
*
|
|
23
23
|
* @returns The webhook identifier through a `Promise`.
|
|
24
24
|
*/
|
|
25
|
-
const registerWebhook = (
|
|
25
|
+
const registerWebhook = (accessToken, url, headers) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
const payload = {
|
|
27
27
|
callback: {
|
|
28
28
|
url: url,
|
|
@@ -35,7 +35,7 @@ const registerWebhook = (auth, url, headers) => __awaiter(void 0, void 0, void 0
|
|
|
35
35
|
hostname: 'api.dolby.com',
|
|
36
36
|
path: '/media/webhooks',
|
|
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);
|
|
@@ -50,10 +50,10 @@ exports.registerWebhook = registerWebhook;
|
|
|
50
50
|
*
|
|
51
51
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-put
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
53
|
+
* @param accessToken Access token to use for authentication.
|
|
54
54
|
* @param options Options to update the webhook.
|
|
55
55
|
*/
|
|
56
|
-
const updateWebhook = (
|
|
56
|
+
const updateWebhook = (accessToken, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
57
|
const payload = {
|
|
58
58
|
callback: {
|
|
59
59
|
url: options.url,
|
|
@@ -69,7 +69,7 @@ const updateWebhook = (auth, options) => __awaiter(void 0, void 0, void 0, funct
|
|
|
69
69
|
id: options.webhookId,
|
|
70
70
|
},
|
|
71
71
|
headers: {},
|
|
72
|
-
|
|
72
|
+
accessToken,
|
|
73
73
|
body: JSON.stringify(payload, null, ' '),
|
|
74
74
|
};
|
|
75
75
|
yield (0, httpHelpers_1.sendPut)(requestOptions);
|
|
@@ -80,12 +80,12 @@ exports.updateWebhook = updateWebhook;
|
|
|
80
80
|
*
|
|
81
81
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-get
|
|
82
82
|
*
|
|
83
|
-
* @param
|
|
83
|
+
* @param accessToken Access token to use for authentication.
|
|
84
84
|
* @param webhookId Identifier of the webhook to retrieve.
|
|
85
85
|
*
|
|
86
86
|
* @returns The `Webhook` object through a `Promise`.
|
|
87
87
|
*/
|
|
88
|
-
const retrieveWebhook = (
|
|
88
|
+
const retrieveWebhook = (accessToken, webhookId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
89
|
const requestOptions = {
|
|
90
90
|
hostname: 'api.dolby.com',
|
|
91
91
|
path: '/media/webhooks',
|
|
@@ -93,7 +93,7 @@ const retrieveWebhook = (auth, webhookId) => __awaiter(void 0, void 0, void 0, f
|
|
|
93
93
|
id: webhookId,
|
|
94
94
|
},
|
|
95
95
|
headers: {},
|
|
96
|
-
|
|
96
|
+
accessToken,
|
|
97
97
|
};
|
|
98
98
|
const response = yield (0, httpHelpers_1.sendGet)(requestOptions);
|
|
99
99
|
return response;
|
|
@@ -104,12 +104,12 @@ exports.retrieveWebhook = retrieveWebhook;
|
|
|
104
104
|
*
|
|
105
105
|
* @link https://docs.dolby.io/media-apis/reference/media-webhook-delete
|
|
106
106
|
*
|
|
107
|
-
* @param
|
|
107
|
+
* @param accessToken Access token to use for authentication.
|
|
108
108
|
* @param webhookId Identifier of the webhook to delete.
|
|
109
109
|
*
|
|
110
110
|
* @returns The webhook identifier through a `Promise`.
|
|
111
111
|
*/
|
|
112
|
-
const deleteWebhook = (
|
|
112
|
+
const deleteWebhook = (accessToken, webhookId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
113
113
|
const requestOptions = {
|
|
114
114
|
hostname: 'api.dolby.com',
|
|
115
115
|
path: '/media/webhooks',
|
|
@@ -117,7 +117,7 @@ const deleteWebhook = (auth, webhookId) => __awaiter(void 0, void 0, void 0, fun
|
|
|
117
117
|
id: webhookId,
|
|
118
118
|
},
|
|
119
119
|
headers: {},
|
|
120
|
-
|
|
120
|
+
accessToken,
|
|
121
121
|
};
|
|
122
122
|
const response = yield (0, httpHelpers_1.sendDelete)(requestOptions);
|
|
123
123
|
if (response.hasOwnProperty('webhook_id')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/media/webhooks.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,wDAAoG;AAIpG;;;;;;;;;;GAUG;AACI,MAAM,eAAe,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/media/webhooks.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,wDAAoG;AAIpG;;;;;;;;;;GAUG;AACI,MAAM,eAAe,GAAG,CAAO,WAAqB,EAAE,GAAW,EAAE,OAAkC,EAA0B,EAAE;IACpI,MAAM,OAAO,GAAG;QACZ,QAAQ,EAAE;YACN,GAAG,EAAE,GAAG;SACX;KACJ,CAAC;IAEF,IAAI,OAAO,EAAE;QACT,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;KACzC;IAED,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,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,YAAY,CAAC,EAAE;QACvC,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;KACjC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAzBW,QAAA,eAAe,mBAyB1B;AAEF;;;;;;;GAOG;AACI,MAAM,aAAa,GAAG,CAAO,WAAqB,EAAE,OAA6B,EAAiB,EAAE;IACvG,MAAM,OAAO,GAAG;QACZ,QAAQ,EAAE;YACN,GAAG,EAAE,OAAO,CAAC,GAAG;SACnB;KACJ,CAAC;IAEF,IAAI,OAAO,CAAC,OAAO,EAAE;QACjB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;KACjD;IAED,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE;YACJ,EAAE,EAAE,OAAO,CAAC,SAAS;SACxB;QACD,OAAO,EAAE,EAAE;QACX,WAAW;QACX,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;KAC5C,CAAC;IAEF,MAAM,IAAA,qBAAO,EAAC,cAAc,CAAC,CAAC;AAClC,CAAC,CAAA,CAAC;AAvBW,QAAA,aAAa,iBAuBxB;AAEF;;;;;;;;;GASG;AACI,MAAM,eAAe,GAAG,CAAO,WAAqB,EAAE,SAAiB,EAAoB,EAAE;IAChG,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE;YACJ,EAAE,EAAE,SAAS;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,eAAe,mBAa1B;AAEF;;;;;;;;;GASG;AACI,MAAM,aAAa,GAAG,CAAO,WAAqB,EAAE,SAAiB,EAA0B,EAAE;IACpG,MAAM,cAAc,GAAuB;QACvC,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE;YACJ,EAAE,EAAE,SAAS;SAChB;QACD,OAAO,EAAE,EAAE;QACX,WAAW;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAU,EAAC,cAAc,CAAC,CAAC;IAClD,IAAI,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;QACvC,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;KACjC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC;AAjBW,QAAA,aAAa,iBAiBxB"}
|