@stream-io/video-client 0.1.5 → 0.1.7
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/CHANGELOG.md +14 -0
- package/README.md +54 -8
- package/dist/index.browser.es.js +13 -15
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +13 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +13 -15
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +4 -2
- package/dist/src/StreamVideoClient.d.ts +1 -1
- package/dist/src/__tests__/server-side/call-types.test.d.ts +1 -0
- package/dist/src/__tests__/server-side/call.test.d.ts +1 -0
- package/dist/src/__tests__/server-side/create-token.test.d.ts +1 -0
- package/dist/src/__tests__/server-side/server-side-user.test.d.ts +1 -0
- package/dist/src/coordinator/connection/client.d.ts +3 -3
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/Call.ts +4 -3
- package/src/StreamVideoClient.ts +1 -1
- package/src/__tests__/StreamVideoClient.test.ts +9 -9
- package/src/__tests__/server-side/call-members.test.ts +93 -0
- package/src/__tests__/server-side/call-types.test.ts +78 -0
- package/src/__tests__/server-side/call.test.ts +147 -0
- package/src/__tests__/server-side/create-token.test.ts +44 -0
- package/src/__tests__/server-side/server-side-user.test.ts +28 -0
- package/src/coordinator/connection/client.ts +20 -10
- package/src/__tests__/StreamVideoServerClient.test.ts +0 -110
- /package/dist/src/__tests__/{StreamVideoServerClient.test.d.ts → server-side/call-members.test.d.ts} +0 -0
package/dist/index.es.js
CHANGED
|
@@ -10271,8 +10271,8 @@ class Call {
|
|
|
10271
10271
|
/**
|
|
10272
10272
|
* Starts the livestreaming of the call.
|
|
10273
10273
|
*/
|
|
10274
|
-
this.goLive = () => __awaiter(this, void 0, void 0, function* () {
|
|
10275
|
-
return this.streamClient.post(`${this.streamClientBasePath}/go_live`, {});
|
|
10274
|
+
this.goLive = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
10275
|
+
return this.streamClient.post(`${this.streamClientBasePath}/go_live`, {}, params);
|
|
10276
10276
|
});
|
|
10277
10277
|
/**
|
|
10278
10278
|
* Stops the livestreaming of the call.
|
|
@@ -10328,7 +10328,7 @@ class Call {
|
|
|
10328
10328
|
* @returns
|
|
10329
10329
|
*/
|
|
10330
10330
|
this.queryMembers = (request) => {
|
|
10331
|
-
return this.streamClient.post('/call/members', Object.assign(Object.assign({}, request), { id: this.id, type: this.type }));
|
|
10331
|
+
return this.streamClient.post('/call/members', Object.assign(Object.assign({}, (request || {})), { id: this.id, type: this.type }));
|
|
10332
10332
|
};
|
|
10333
10333
|
/**
|
|
10334
10334
|
* Will update the call members.
|
|
@@ -11640,7 +11640,7 @@ class WSConnectionFallback {
|
|
|
11640
11640
|
}
|
|
11641
11641
|
}
|
|
11642
11642
|
|
|
11643
|
-
const version = '0.1.
|
|
11643
|
+
const version = '0.1.7';
|
|
11644
11644
|
|
|
11645
11645
|
const logger = getLogger(['location']);
|
|
11646
11646
|
const HINT_URL = `https://hint.stream-io-video.com/`;
|
|
@@ -11907,9 +11907,6 @@ class StreamClient {
|
|
|
11907
11907
|
this.logger('trace', `client:${type} - Response - url: ${url} > status ${response.status}`, {
|
|
11908
11908
|
response,
|
|
11909
11909
|
});
|
|
11910
|
-
this.logger('trace', `client:${type} - Response payload`, {
|
|
11911
|
-
response,
|
|
11912
|
-
});
|
|
11913
11910
|
};
|
|
11914
11911
|
this._logApiError = (type, url, error) => {
|
|
11915
11912
|
this.logger('error', `client:${type} - Error - url: ${url}`, {
|
|
@@ -11958,9 +11955,9 @@ class StreamClient {
|
|
|
11958
11955
|
}
|
|
11959
11956
|
catch (e /**TODO: generalize error types */) {
|
|
11960
11957
|
e.client_request_id = (_h = requestConfig.headers) === null || _h === void 0 ? void 0 : _h['x-client-request-id'];
|
|
11961
|
-
this._logApiError(type, url, e);
|
|
11962
11958
|
this.consecutiveFailures += 1;
|
|
11963
11959
|
if (e.response) {
|
|
11960
|
+
this._logApiError(type, url, e.response);
|
|
11964
11961
|
/** connection_fallback depends on this token expiration logic */
|
|
11965
11962
|
if (e.response.data.code === KnownCodes.TOKEN_EXPIRED &&
|
|
11966
11963
|
!this.tokenManager.isStatic()) {
|
|
@@ -11973,6 +11970,7 @@ class StreamClient {
|
|
|
11973
11970
|
return this.handleResponse(e.response);
|
|
11974
11971
|
}
|
|
11975
11972
|
else {
|
|
11973
|
+
this._logApiError(type, url, e);
|
|
11976
11974
|
// eslint-disable-next-line no-throw-literal
|
|
11977
11975
|
throw e;
|
|
11978
11976
|
}
|
|
@@ -11983,14 +11981,14 @@ class StreamClient {
|
|
|
11983
11981
|
params,
|
|
11984
11982
|
});
|
|
11985
11983
|
};
|
|
11986
|
-
this.put = (url, data) => {
|
|
11987
|
-
return this.doAxiosRequest('put', url, data);
|
|
11984
|
+
this.put = (url, data, params) => {
|
|
11985
|
+
return this.doAxiosRequest('put', url, data, { params });
|
|
11988
11986
|
};
|
|
11989
|
-
this.post = (url, data) => {
|
|
11990
|
-
return this.doAxiosRequest('post', url, data);
|
|
11987
|
+
this.post = (url, data, params) => {
|
|
11988
|
+
return this.doAxiosRequest('post', url, data, { params });
|
|
11991
11989
|
};
|
|
11992
|
-
this.patch = (url, data) => {
|
|
11993
|
-
return this.doAxiosRequest('patch', url, data);
|
|
11990
|
+
this.patch = (url, data, params) => {
|
|
11991
|
+
return this.doAxiosRequest('patch', url, data, { params });
|
|
11994
11992
|
};
|
|
11995
11993
|
this.delete = (url, params) => {
|
|
11996
11994
|
return this.doAxiosRequest('delete', url, null, {
|
|
@@ -12329,7 +12327,7 @@ class StreamVideoClient {
|
|
|
12329
12327
|
*
|
|
12330
12328
|
* @param data the query data.
|
|
12331
12329
|
*/
|
|
12332
|
-
this.queryCalls = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
12330
|
+
this.queryCalls = (data = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
12333
12331
|
const response = yield this.streamClient.post('/calls', data);
|
|
12334
12332
|
const calls = response.calls.map((c) => {
|
|
12335
12333
|
const call = new Call({
|