@stream-io/node-sdk 0.4.0 → 0.4.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/dist/index.cjs.js +12 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +12 -10
- package/dist/index.es.js.map +1 -1
- package/dist/src/gen/models/index.d.ts +8 -5
- package/dist/src/gen/video/CallApi.d.ts +1 -1
- package/dist/src/gen/video/VideoApi.d.ts +1 -1
- package/package.json +4 -2
- package/src/BaseApi.ts +12 -3
- package/src/gen/models/index.ts +23 -19
- package/src/gen/video/CallApi.ts +2 -2
- package/src/gen/video/VideoApi.ts +2 -6
package/dist/index.cjs.js
CHANGED
|
@@ -126,7 +126,7 @@ class BaseApi {
|
|
|
126
126
|
Authorization: this.apiConfig.token,
|
|
127
127
|
'stream-auth-type': 'jwt',
|
|
128
128
|
'Content-Type': 'application/json',
|
|
129
|
-
'X-Stream-Client': 'stream-node-' + "0.4.
|
|
129
|
+
'X-Stream-Client': 'stream-node-' + "0.4.2",
|
|
130
130
|
'Accept-Encoding': 'gzip',
|
|
131
131
|
'x-client-request-id': clientRequestId,
|
|
132
132
|
};
|
|
@@ -146,7 +146,13 @@ class BaseApi {
|
|
|
146
146
|
rateLimit: getRateLimitFromResponseHeader(responseHeaders),
|
|
147
147
|
};
|
|
148
148
|
if (response.status < 200 || response.status >= 300) {
|
|
149
|
-
|
|
149
|
+
let error;
|
|
150
|
+
try {
|
|
151
|
+
error = (yield response.json());
|
|
152
|
+
}
|
|
153
|
+
catch (_) {
|
|
154
|
+
throw new StreamError(`Stream error: ${response.status} - ${response.statusText}`, metadata, response.status);
|
|
155
|
+
}
|
|
150
156
|
throw new StreamError(`Stream error code ${error.code}: ${error.message}`, metadata, error.code, undefined);
|
|
151
157
|
}
|
|
152
158
|
const responseBody = (yield response.json());
|
|
@@ -2338,18 +2344,14 @@ class VideoApi extends BaseApi {
|
|
|
2338
2344
|
(_q = decoders.ListRecordingsResponse) === null || _q === void 0 ? void 0 : _q.call(decoders, response.body);
|
|
2339
2345
|
return Object.assign(Object.assign({}, response.body), { metadata: response.metadata });
|
|
2340
2346
|
});
|
|
2341
|
-
this.
|
|
2347
|
+
this.startRTMPBroadcasts = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
2342
2348
|
var _r;
|
|
2343
2349
|
const pathParams = {
|
|
2344
2350
|
type: request === null || request === void 0 ? void 0 : request.type,
|
|
2345
2351
|
id: request === null || request === void 0 ? void 0 : request.id,
|
|
2346
2352
|
};
|
|
2347
2353
|
const body = {
|
|
2348
|
-
|
|
2349
|
-
stream_url: request === null || request === void 0 ? void 0 : request.stream_url,
|
|
2350
|
-
quality: request === null || request === void 0 ? void 0 : request.quality,
|
|
2351
|
-
stream_key: request === null || request === void 0 ? void 0 : request.stream_key,
|
|
2352
|
-
layout: request === null || request === void 0 ? void 0 : request.layout,
|
|
2354
|
+
broadcasts: request === null || request === void 0 ? void 0 : request.broadcasts,
|
|
2353
2355
|
};
|
|
2354
2356
|
const response = yield this.sendRequest('POST', '/api/v2/video/call/{type}/{id}/rtmp_broadcasts', pathParams, undefined, body);
|
|
2355
2357
|
(_r = decoders.StartRTMPBroadcastsResponse) === null || _r === void 0 ? void 0 : _r.call(decoders, response.body);
|
|
@@ -2658,8 +2660,8 @@ class CallApi {
|
|
|
2658
2660
|
this.listRecordings = () => {
|
|
2659
2661
|
return this.videoApi.listRecordings({ id: this.id, type: this.type });
|
|
2660
2662
|
};
|
|
2661
|
-
this.
|
|
2662
|
-
return this.videoApi.
|
|
2663
|
+
this.startRTMPBroadcasts = (request) => {
|
|
2664
|
+
return this.videoApi.startRTMPBroadcasts(Object.assign({ id: this.id, type: this.type }, request));
|
|
2663
2665
|
};
|
|
2664
2666
|
this.stopAllRTMPBroadcasts = () => {
|
|
2665
2667
|
return this.videoApi.stopAllRTMPBroadcasts({
|