@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.
@@ -4028,7 +4028,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
4028
4028
  };
4029
4029
  return result;
4030
4030
  };
4031
- const version = "0.3.45";
4031
+ const version = "0.3.46";
4032
4032
  const axios = axiosImport.default ?? axiosImport;
4033
4033
  class ApiClient {
4034
4034
  constructor(apiKey, tokenManager, connectionIdManager, options) {
@@ -7467,6 +7467,28 @@ class FeedsClient extends FeedsApi {
7467
7467
  });
7468
7468
  return Promise.resolve();
7469
7469
  };
7470
+ this.connectGuest = async (...args) => {
7471
+ this.checkIfUserIsConnected();
7472
+ const response = await this.createGuest(...args);
7473
+ await this.connectUser(response.user, response.access_token);
7474
+ return response;
7475
+ };
7476
+ this.createGuest = async (...args) => {
7477
+ let shouldDisconnect = false;
7478
+ let response;
7479
+ try {
7480
+ if (!this.state.getLatestValue().is_anonymous || !this.state.getLatestValue().connected_user) {
7481
+ shouldDisconnect = true;
7482
+ await this.connectAnonymous();
7483
+ }
7484
+ response = await super.createGuest(...args);
7485
+ } finally {
7486
+ if (shouldDisconnect) {
7487
+ await this.disconnectUser();
7488
+ }
7489
+ }
7490
+ return response;
7491
+ };
7470
7492
  this.connectUser = async (user, tokenProvider) => {
7471
7493
  this.checkIfUserIsConnected();
7472
7494
  this.tokenManager.setTokenOrProvider(tokenProvider);
@@ -8087,4 +8109,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
8087
8109
  exports.shouldUpdateState = shouldUpdateState;
8088
8110
  exports.uniqueArrayMerge = uniqueArrayMerge;
8089
8111
  exports.updateEntityInArray = updateEntityInArray;
8090
- //# sourceMappingURL=feeds-client-CN3FjVMk.js.map
8112
+ //# sourceMappingURL=feeds-client-CF1yEox0.js.map