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