stream-chat 9.48.0 → 9.49.0

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.
@@ -14796,6 +14796,31 @@ var StreamChat = class _StreamChat {
14796
14796
  * @return {Promise<APIResponse>}
14797
14797
  */
14798
14798
  this.markAllRead = this.markChannelsRead;
14799
+ this.getUserAgent = () => {
14800
+ if (this.userAgent) {
14801
+ return this.userAgent;
14802
+ }
14803
+ if (!this.cachedUserAgent) {
14804
+ const version = "9.49.0";
14805
+ const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
14806
+ const { name: appName, version: appVersion } = this.appIdentifier ?? {};
14807
+ const { os, model: deviceModel } = this.deviceIdentifier ?? {};
14808
+ const head = sdkName ? `stream-chat-${sdkName}-v${sdkVersion}-llc-v${version}` : `stream-chat-js-v${version}-${this.node ? "node" : "browser"}`;
14809
+ this.cachedUserAgent = [
14810
+ head,
14811
+ // reports the host app, the device OS, the device model, and the picked
14812
+ // exports bundle, each only when a value is present
14813
+ ...Object.entries({
14814
+ app: appName,
14815
+ app_version: appVersion,
14816
+ os,
14817
+ device_model: deviceModel,
14818
+ client_bundle: "node-cjs"
14819
+ }).filter(([, value]) => value && value.length > 0).map(([key, value]) => `${key}=${value}`)
14820
+ ].join("|");
14821
+ }
14822
+ return this.cachedUserAgent;
14823
+ };
14799
14824
  /**
14800
14825
  * _isUsingServerAuth - Returns true if we're using server side auth
14801
14826
  */
@@ -15248,6 +15273,13 @@ var StreamChat = class _StreamChat {
15248
15273
  delete this.activeChannels[cid];
15249
15274
  });
15250
15275
  }
15276
+ if (event.type === "notification.removed_from_channel" && event.cid) {
15277
+ const { cid } = event;
15278
+ this.activeChannels[cid]?._disconnect();
15279
+ postListenerCallbacks.push(() => {
15280
+ delete this.activeChannels[cid];
15281
+ });
15282
+ }
15251
15283
  return postListenerCallbacks;
15252
15284
  }
15253
15285
  _muteStatus(cid) {
@@ -16739,31 +16771,6 @@ var StreamChat = class _StreamChat {
16739
16771
  partialThreadObject
16740
16772
  );
16741
16773
  }
16742
- getUserAgent() {
16743
- if (this.userAgent) {
16744
- return this.userAgent;
16745
- }
16746
- const version = "9.48.0";
16747
- const clientBundle = "node-cjs";
16748
- let userAgentString = "";
16749
- if (this.sdkIdentifier) {
16750
- userAgentString = `stream-chat-${this.sdkIdentifier.name}-v${this.sdkIdentifier.version}-llc-v${version}`;
16751
- } else {
16752
- userAgentString = `stream-chat-js-v${version}-${this.node ? "node" : "browser"}`;
16753
- }
16754
- const { os, model } = this.deviceIdentifier ?? {};
16755
- return [
16756
- // reports the device OS, if provided
16757
- ["os", os],
16758
- // reports the device model, if provided
16759
- ["device_model", model],
16760
- // reports which bundle is being picked from the exports
16761
- ["client_bundle", clientBundle]
16762
- ].reduce(
16763
- (withArguments, [key, value]) => value && value.length > 0 ? withArguments.concat(`|${key}=${value}`) : withArguments,
16764
- userAgentString
16765
- );
16766
- }
16767
16774
  /**
16768
16775
  * @deprecated use sdkIdentifier instead
16769
16776
  * @param userAgent