@stream-io/feeds-client 0.3.45 → 0.3.46

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.
@@ -4010,7 +4010,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
4010
4010
  };
4011
4011
  return result;
4012
4012
  };
4013
- const version = "0.3.45";
4013
+ const version = "0.3.46";
4014
4014
  const axios = axiosImport.default ?? axiosImport;
4015
4015
  class ApiClient {
4016
4016
  constructor(apiKey, tokenManager, connectionIdManager, options) {
@@ -7449,6 +7449,28 @@ class FeedsClient extends FeedsApi {
7449
7449
  });
7450
7450
  return Promise.resolve();
7451
7451
  };
7452
+ this.connectGuest = async (...args) => {
7453
+ this.checkIfUserIsConnected();
7454
+ const response = await this.createGuest(...args);
7455
+ await this.connectUser(response.user, response.access_token);
7456
+ return response;
7457
+ };
7458
+ this.createGuest = async (...args) => {
7459
+ let shouldDisconnect = false;
7460
+ let response;
7461
+ try {
7462
+ if (!this.state.getLatestValue().is_anonymous || !this.state.getLatestValue().connected_user) {
7463
+ shouldDisconnect = true;
7464
+ await this.connectAnonymous();
7465
+ }
7466
+ response = await super.createGuest(...args);
7467
+ } finally {
7468
+ if (shouldDisconnect) {
7469
+ await this.disconnectUser();
7470
+ }
7471
+ }
7472
+ return response;
7473
+ };
7452
7474
  this.connectUser = async (user, tokenProvider) => {
7453
7475
  this.checkIfUserIsConnected();
7454
7476
  this.tokenManager.setTokenOrProvider(tokenProvider);
@@ -8071,4 +8093,4 @@ export {
8071
8093
  shouldUpdateState as s,
8072
8094
  uniqueArrayMerge as u
8073
8095
  };
8074
- //# sourceMappingURL=feeds-client-DK7PXh7g.mjs.map
8096
+ //# sourceMappingURL=feeds-client-CSg4hlZ4.mjs.map