@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.cjs.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var jwt = require('jsonwebtoken');
|
|
4
4
|
var uuid = require('uuid');
|
|
5
5
|
var crypto = require('crypto');
|
|
6
|
-
var undici = require('undici');
|
|
7
6
|
|
|
8
7
|
function _interopNamespaceDefault(e) {
|
|
9
8
|
var n = Object.create(null);
|
|
@@ -158,7 +157,7 @@ class BaseApi {
|
|
|
158
157
|
Authorization: this.apiConfig.token,
|
|
159
158
|
'stream-auth-type': 'jwt',
|
|
160
159
|
'Content-Type': 'application/json',
|
|
161
|
-
'X-Stream-Client': 'stream-node-' + "0.4.
|
|
160
|
+
'X-Stream-Client': 'stream-node-' + "0.4.22",
|
|
162
161
|
'Accept-Encoding': 'gzip',
|
|
163
162
|
'x-client-request-id': clientRequestId,
|
|
164
163
|
};
|
|
@@ -169,7 +168,6 @@ class BaseApi {
|
|
|
169
168
|
method,
|
|
170
169
|
body: JSON.stringify(body),
|
|
171
170
|
headers,
|
|
172
|
-
/** @ts-expect-error we get types from DOM here, but we should use node types */
|
|
173
171
|
dispatcher: this.dispatcher,
|
|
174
172
|
});
|
|
175
173
|
const responseHeaders = response.headers;
|
|
@@ -4686,15 +4684,15 @@ class StreamClient extends CommonApi {
|
|
|
4686
4684
|
constructor(apiKey, secret, config) {
|
|
4687
4685
|
const token = JWTServerToken(secret);
|
|
4688
4686
|
const timeout = config?.timeout ?? StreamClient.DEFAULT_TIMEOUT;
|
|
4689
|
-
const agent = config?.agent ??
|
|
4690
|
-
new undici.Agent({
|
|
4691
|
-
connections: config?.maxConnections === undefined
|
|
4692
|
-
? StreamClient.MAX_CONNECTIONS
|
|
4693
|
-
: config.maxConnections,
|
|
4694
|
-
});
|
|
4695
4687
|
const chatBaseUrl = config?.basePath ?? 'https://chat.stream-io-api.com';
|
|
4696
4688
|
const videoBaseUrl = config?.basePath ?? 'https://video.stream-io-api.com';
|
|
4697
|
-
super({
|
|
4689
|
+
super({
|
|
4690
|
+
apiKey,
|
|
4691
|
+
token,
|
|
4692
|
+
timeout,
|
|
4693
|
+
baseUrl: chatBaseUrl,
|
|
4694
|
+
agent: config?.agent,
|
|
4695
|
+
});
|
|
4698
4696
|
this.apiKey = apiKey;
|
|
4699
4697
|
this.secret = secret;
|
|
4700
4698
|
this.config = config;
|
|
@@ -4795,26 +4793,25 @@ class StreamClient extends CommonApi {
|
|
|
4795
4793
|
token,
|
|
4796
4794
|
timeout,
|
|
4797
4795
|
baseUrl: videoBaseUrl,
|
|
4798
|
-
agent,
|
|
4796
|
+
agent: config?.agent,
|
|
4799
4797
|
});
|
|
4800
4798
|
this.chat = new StreamChatClient({
|
|
4801
4799
|
apiKey,
|
|
4802
4800
|
token,
|
|
4803
4801
|
timeout,
|
|
4804
4802
|
baseUrl: chatBaseUrl,
|
|
4805
|
-
agent,
|
|
4803
|
+
agent: config?.agent,
|
|
4806
4804
|
});
|
|
4807
4805
|
this.moderation = new StreamModerationClient({
|
|
4808
4806
|
apiKey,
|
|
4809
4807
|
token,
|
|
4810
4808
|
timeout,
|
|
4811
4809
|
baseUrl: chatBaseUrl,
|
|
4812
|
-
agent,
|
|
4810
|
+
agent: config?.agent,
|
|
4813
4811
|
});
|
|
4814
4812
|
}
|
|
4815
4813
|
}
|
|
4816
4814
|
StreamClient.DEFAULT_TIMEOUT = 3000;
|
|
4817
|
-
StreamClient.MAX_CONNECTIONS = 100;
|
|
4818
4815
|
|
|
4819
4816
|
exports.ChannelOwnCapability = ChannelOwnCapability;
|
|
4820
4817
|
exports.OwnCapability = OwnCapability;
|