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.
- package/dist/cjs/index.browser.js +32 -25
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +32 -25
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +32 -25
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +4 -2
- package/dist/types/types.d.ts +10 -0
- package/package.json +1 -1
- package/src/client.ts +46 -28
- package/src/types.ts +8 -0
package/dist/esm/index.mjs
CHANGED
|
@@ -14612,6 +14612,31 @@ var StreamChat = class _StreamChat {
|
|
|
14612
14612
|
* @return {Promise<APIResponse>}
|
|
14613
14613
|
*/
|
|
14614
14614
|
this.markAllRead = this.markChannelsRead;
|
|
14615
|
+
this.getUserAgent = () => {
|
|
14616
|
+
if (this.userAgent) {
|
|
14617
|
+
return this.userAgent;
|
|
14618
|
+
}
|
|
14619
|
+
if (!this.cachedUserAgent) {
|
|
14620
|
+
const version = "9.49.0";
|
|
14621
|
+
const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
|
|
14622
|
+
const { name: appName, version: appVersion } = this.appIdentifier ?? {};
|
|
14623
|
+
const { os, model: deviceModel } = this.deviceIdentifier ?? {};
|
|
14624
|
+
const head = sdkName ? `stream-chat-${sdkName}-v${sdkVersion}-llc-v${version}` : `stream-chat-js-v${version}-${this.node ? "node" : "browser"}`;
|
|
14625
|
+
this.cachedUserAgent = [
|
|
14626
|
+
head,
|
|
14627
|
+
// reports the host app, the device OS, the device model, and the picked
|
|
14628
|
+
// exports bundle, each only when a value is present
|
|
14629
|
+
...Object.entries({
|
|
14630
|
+
app: appName,
|
|
14631
|
+
app_version: appVersion,
|
|
14632
|
+
os,
|
|
14633
|
+
device_model: deviceModel,
|
|
14634
|
+
client_bundle: "browser-esm"
|
|
14635
|
+
}).filter(([, value]) => value && value.length > 0).map(([key, value]) => `${key}=${value}`)
|
|
14636
|
+
].join("|");
|
|
14637
|
+
}
|
|
14638
|
+
return this.cachedUserAgent;
|
|
14639
|
+
};
|
|
14615
14640
|
/**
|
|
14616
14641
|
* _isUsingServerAuth - Returns true if we're using server side auth
|
|
14617
14642
|
*/
|
|
@@ -15064,6 +15089,13 @@ var StreamChat = class _StreamChat {
|
|
|
15064
15089
|
delete this.activeChannels[cid];
|
|
15065
15090
|
});
|
|
15066
15091
|
}
|
|
15092
|
+
if (event.type === "notification.removed_from_channel" && event.cid) {
|
|
15093
|
+
const { cid } = event;
|
|
15094
|
+
this.activeChannels[cid]?._disconnect();
|
|
15095
|
+
postListenerCallbacks.push(() => {
|
|
15096
|
+
delete this.activeChannels[cid];
|
|
15097
|
+
});
|
|
15098
|
+
}
|
|
15067
15099
|
return postListenerCallbacks;
|
|
15068
15100
|
}
|
|
15069
15101
|
_muteStatus(cid) {
|
|
@@ -16555,31 +16587,6 @@ var StreamChat = class _StreamChat {
|
|
|
16555
16587
|
partialThreadObject
|
|
16556
16588
|
);
|
|
16557
16589
|
}
|
|
16558
|
-
getUserAgent() {
|
|
16559
|
-
if (this.userAgent) {
|
|
16560
|
-
return this.userAgent;
|
|
16561
|
-
}
|
|
16562
|
-
const version = "9.48.0";
|
|
16563
|
-
const clientBundle = "browser-esm";
|
|
16564
|
-
let userAgentString = "";
|
|
16565
|
-
if (this.sdkIdentifier) {
|
|
16566
|
-
userAgentString = `stream-chat-${this.sdkIdentifier.name}-v${this.sdkIdentifier.version}-llc-v${version}`;
|
|
16567
|
-
} else {
|
|
16568
|
-
userAgentString = `stream-chat-js-v${version}-${this.node ? "node" : "browser"}`;
|
|
16569
|
-
}
|
|
16570
|
-
const { os, model } = this.deviceIdentifier ?? {};
|
|
16571
|
-
return [
|
|
16572
|
-
// reports the device OS, if provided
|
|
16573
|
-
["os", os],
|
|
16574
|
-
// reports the device model, if provided
|
|
16575
|
-
["device_model", model],
|
|
16576
|
-
// reports which bundle is being picked from the exports
|
|
16577
|
-
["client_bundle", clientBundle]
|
|
16578
|
-
].reduce(
|
|
16579
|
-
(withArguments, [key, value]) => value && value.length > 0 ? withArguments.concat(`|${key}=${value}`) : withArguments,
|
|
16580
|
-
userAgentString
|
|
16581
|
-
);
|
|
16582
|
-
}
|
|
16583
16590
|
/**
|
|
16584
16591
|
* @deprecated use sdkIdentifier instead
|
|
16585
16592
|
* @param userAgent
|