@stream-io/video-client 0.3.3 → 0.3.4
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 +7 -0
- package/dist/index.browser.es.js +11 -5
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +11 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/coordinator/connection/client.d.ts +9 -4
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/StreamVideoClient.ts +1 -10
- package/src/__tests__/StreamVideoClient.test.ts +13 -0
- package/src/coordinator/connection/client.ts +28 -0
package/dist/index.cjs.js
CHANGED
|
@@ -12476,7 +12476,7 @@ class WSConnectionFallback {
|
|
|
12476
12476
|
}
|
|
12477
12477
|
}
|
|
12478
12478
|
|
|
12479
|
-
const version = '0.3.
|
|
12479
|
+
const version = '0.3.4';
|
|
12480
12480
|
|
|
12481
12481
|
const logger = getLogger(['location']);
|
|
12482
12482
|
const HINT_URL = `https://hint.stream-io-video.com/`;
|
|
@@ -12676,6 +12676,14 @@ class StreamClient {
|
|
|
12676
12676
|
this.rejectConnectionId = undefined;
|
|
12677
12677
|
this.resolveConnectionId = undefined;
|
|
12678
12678
|
});
|
|
12679
|
+
this.connectGuestUser = (user) => __awaiter(this, void 0, void 0, function* () {
|
|
12680
|
+
this.guestUserCreatePromise = this.doAxiosRequest('post', '/guest', {
|
|
12681
|
+
user: Object.assign(Object.assign({}, user), { role: 'guest' }),
|
|
12682
|
+
}, { publicEndpoint: true });
|
|
12683
|
+
const response = yield this.guestUserCreatePromise;
|
|
12684
|
+
this.guestUserCreatePromise.finally(() => (this.guestUserCreatePromise = undefined));
|
|
12685
|
+
return this.connectUser(response.user, response.access_token);
|
|
12686
|
+
});
|
|
12679
12687
|
/**
|
|
12680
12688
|
* connectAnonymousUser - Set an anonymous user and open a WebSocket connection
|
|
12681
12689
|
*/
|
|
@@ -12755,6 +12763,7 @@ class StreamClient {
|
|
|
12755
12763
|
if (!options.publicEndpoint) {
|
|
12756
12764
|
yield Promise.all([
|
|
12757
12765
|
this.tokenManager.tokenReady(),
|
|
12766
|
+
this.guestUserCreatePromise,
|
|
12758
12767
|
this.connectionIdPromise,
|
|
12759
12768
|
]);
|
|
12760
12769
|
}
|
|
@@ -13316,10 +13325,7 @@ class StreamVideoClient {
|
|
|
13316
13325
|
};
|
|
13317
13326
|
if (user.type === 'guest') {
|
|
13318
13327
|
connectUser = () => __awaiter(this, void 0, void 0, function* () {
|
|
13319
|
-
|
|
13320
|
-
user: Object.assign(Object.assign({}, user), { role: 'guest' }),
|
|
13321
|
-
});
|
|
13322
|
-
return this.streamClient.connectUser(response.user, response.access_token);
|
|
13328
|
+
return this.streamClient.connectGuestUser(user);
|
|
13323
13329
|
});
|
|
13324
13330
|
}
|
|
13325
13331
|
this.connectionPromise = this.disconnectionPromise
|