@stream-io/node-sdk 0.4.20 → 0.4.22
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/index.cjs.js +11 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +11 -14
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/BaseApi.d.ts +1 -1
- package/dist/src/StreamClient.d.ts +1 -5
- package/dist/src/StreamVideoClient.d.ts +1 -0
- package/dist/src/types.d.ts +2 -2
- package/dist/src/utils/rate-limit.d.ts +1 -0
- package/package.json +2 -3
- package/src/BaseApi.ts +1 -3
- package/src/StreamClient.ts +12 -17
- package/src/StreamVideoClient.ts +2 -0
- package/src/types.ts +1 -3
package/dist/index.es.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import jwt from 'jsonwebtoken';
|
|
2
2
|
import { v4 } from 'uuid';
|
|
3
3
|
import crypto from 'crypto';
|
|
4
|
-
import { Agent } from 'undici';
|
|
5
4
|
|
|
6
5
|
const ChannelOwnCapability = {
|
|
7
6
|
BAN_CHANNEL_MEMBERS: 'ban-channel-members',
|
|
@@ -139,7 +138,7 @@ class BaseApi {
|
|
|
139
138
|
Authorization: this.apiConfig.token,
|
|
140
139
|
'stream-auth-type': 'jwt',
|
|
141
140
|
'Content-Type': 'application/json',
|
|
142
|
-
'X-Stream-Client': 'stream-node-' + "0.4.
|
|
141
|
+
'X-Stream-Client': 'stream-node-' + "0.4.22",
|
|
143
142
|
'Accept-Encoding': 'gzip',
|
|
144
143
|
'x-client-request-id': clientRequestId,
|
|
145
144
|
};
|
|
@@ -150,7 +149,6 @@ class BaseApi {
|
|
|
150
149
|
method,
|
|
151
150
|
body: JSON.stringify(body),
|
|
152
151
|
headers,
|
|
153
|
-
/** @ts-expect-error we get types from DOM here, but we should use node types */
|
|
154
152
|
dispatcher: this.dispatcher,
|
|
155
153
|
});
|
|
156
154
|
const responseHeaders = response.headers;
|
|
@@ -4667,15 +4665,15 @@ class StreamClient extends CommonApi {
|
|
|
4667
4665
|
constructor(apiKey, secret, config) {
|
|
4668
4666
|
const token = JWTServerToken(secret);
|
|
4669
4667
|
const timeout = config?.timeout ?? StreamClient.DEFAULT_TIMEOUT;
|
|
4670
|
-
const agent = config?.agent ??
|
|
4671
|
-
new Agent({
|
|
4672
|
-
connections: config?.maxConnections === undefined
|
|
4673
|
-
? StreamClient.MAX_CONNECTIONS
|
|
4674
|
-
: config.maxConnections,
|
|
4675
|
-
});
|
|
4676
4668
|
const chatBaseUrl = config?.basePath ?? 'https://chat.stream-io-api.com';
|
|
4677
4669
|
const videoBaseUrl = config?.basePath ?? 'https://video.stream-io-api.com';
|
|
4678
|
-
super({
|
|
4670
|
+
super({
|
|
4671
|
+
apiKey,
|
|
4672
|
+
token,
|
|
4673
|
+
timeout,
|
|
4674
|
+
baseUrl: chatBaseUrl,
|
|
4675
|
+
agent: config?.agent,
|
|
4676
|
+
});
|
|
4679
4677
|
this.apiKey = apiKey;
|
|
4680
4678
|
this.secret = secret;
|
|
4681
4679
|
this.config = config;
|
|
@@ -4776,26 +4774,25 @@ class StreamClient extends CommonApi {
|
|
|
4776
4774
|
token,
|
|
4777
4775
|
timeout,
|
|
4778
4776
|
baseUrl: videoBaseUrl,
|
|
4779
|
-
agent,
|
|
4777
|
+
agent: config?.agent,
|
|
4780
4778
|
});
|
|
4781
4779
|
this.chat = new StreamChatClient({
|
|
4782
4780
|
apiKey,
|
|
4783
4781
|
token,
|
|
4784
4782
|
timeout,
|
|
4785
4783
|
baseUrl: chatBaseUrl,
|
|
4786
|
-
agent,
|
|
4784
|
+
agent: config?.agent,
|
|
4787
4785
|
});
|
|
4788
4786
|
this.moderation = new StreamModerationClient({
|
|
4789
4787
|
apiKey,
|
|
4790
4788
|
token,
|
|
4791
4789
|
timeout,
|
|
4792
4790
|
baseUrl: chatBaseUrl,
|
|
4793
|
-
agent,
|
|
4791
|
+
agent: config?.agent,
|
|
4794
4792
|
});
|
|
4795
4793
|
}
|
|
4796
4794
|
}
|
|
4797
4795
|
StreamClient.DEFAULT_TIMEOUT = 3000;
|
|
4798
|
-
StreamClient.MAX_CONNECTIONS = 100;
|
|
4799
4796
|
|
|
4800
4797
|
export { ChannelOwnCapability, OwnCapability, StreamCall, StreamChannel, StreamChatClient, StreamClient, StreamVideoClient };
|
|
4801
4798
|
//# sourceMappingURL=index.es.mjs.map
|