@larksuiteoapi/node-sdk 1.51.0 → 1.52.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/es/index.js +4 -2
- package/lib/index.js +4 -2
- package/package.json +1 -1
- package/types/index.d.ts +2 -0
package/es/index.js
CHANGED
|
@@ -82961,10 +82961,11 @@ class WSClient {
|
|
|
82961
82961
|
lastConnectTime: 0,
|
|
82962
82962
|
nextConnectTime: 0,
|
|
82963
82963
|
};
|
|
82964
|
-
const { appId, appSecret, domain = Domain.Feishu, httpInstance = defaultHttpInstance, loggerLevel = LoggerLevel.info, logger = defaultLogger, autoReconnect = true } = params;
|
|
82964
|
+
const { appId, appSecret, agent, domain = Domain.Feishu, httpInstance = defaultHttpInstance, loggerLevel = LoggerLevel.info, logger = defaultLogger, autoReconnect = true } = params;
|
|
82965
82965
|
this.logger = new LoggerProxy(loggerLevel, logger);
|
|
82966
82966
|
assert(!appId, () => this.logger.error('appId is needed'));
|
|
82967
82967
|
assert(!appSecret, () => this.logger.error('appSecret is needed'));
|
|
82968
|
+
this.agent = agent;
|
|
82968
82969
|
this.dataCache = new DataCache({ logger: this.logger });
|
|
82969
82970
|
this.httpInstance = httpInstance;
|
|
82970
82971
|
this.wsConfig.updateClient({
|
|
@@ -83022,7 +83023,8 @@ class WSClient {
|
|
|
83022
83023
|
const connectUrl = this.wsConfig.getWS('connectUrl');
|
|
83023
83024
|
let wsInstance;
|
|
83024
83025
|
try {
|
|
83025
|
-
|
|
83026
|
+
const { agent } = this;
|
|
83027
|
+
wsInstance = new WebSocket(connectUrl, { agent });
|
|
83026
83028
|
}
|
|
83027
83029
|
catch (e) {
|
|
83028
83030
|
this.logger.error('[ws]', 'new WebSocket error');
|
package/lib/index.js
CHANGED
|
@@ -82976,10 +82976,11 @@ class WSClient {
|
|
|
82976
82976
|
lastConnectTime: 0,
|
|
82977
82977
|
nextConnectTime: 0,
|
|
82978
82978
|
};
|
|
82979
|
-
const { appId, appSecret, domain = exports.Domain.Feishu, httpInstance = defaultHttpInstance, loggerLevel = exports.LoggerLevel.info, logger = defaultLogger, autoReconnect = true } = params;
|
|
82979
|
+
const { appId, appSecret, agent, domain = exports.Domain.Feishu, httpInstance = defaultHttpInstance, loggerLevel = exports.LoggerLevel.info, logger = defaultLogger, autoReconnect = true } = params;
|
|
82980
82980
|
this.logger = new LoggerProxy(loggerLevel, logger);
|
|
82981
82981
|
assert(!appId, () => this.logger.error('appId is needed'));
|
|
82982
82982
|
assert(!appSecret, () => this.logger.error('appSecret is needed'));
|
|
82983
|
+
this.agent = agent;
|
|
82983
82984
|
this.dataCache = new DataCache({ logger: this.logger });
|
|
82984
82985
|
this.httpInstance = httpInstance;
|
|
82985
82986
|
this.wsConfig.updateClient({
|
|
@@ -83037,7 +83038,8 @@ class WSClient {
|
|
|
83037
83038
|
const connectUrl = this.wsConfig.getWS('connectUrl');
|
|
83038
83039
|
let wsInstance;
|
|
83039
83040
|
try {
|
|
83040
|
-
|
|
83041
|
+
const { agent } = this;
|
|
83042
|
+
wsInstance = new WebSocket__default["default"](connectUrl, { agent });
|
|
83041
83043
|
}
|
|
83042
83044
|
catch (e) {
|
|
83043
83045
|
this.logger.error('[ws]', 'new WebSocket error');
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -266454,6 +266454,7 @@ interface IConstructorParams {
|
|
|
266454
266454
|
loggerLevel?: LoggerLevel;
|
|
266455
266455
|
httpInstance?: HttpInstance;
|
|
266456
266456
|
autoReconnect?: boolean;
|
|
266457
|
+
agent?: any;
|
|
266457
266458
|
}
|
|
266458
266459
|
declare class WSClient {
|
|
266459
266460
|
private wsConfig;
|
|
@@ -266465,6 +266466,7 @@ declare class WSClient {
|
|
|
266465
266466
|
private reconnectInterval?;
|
|
266466
266467
|
private isConnecting;
|
|
266467
266468
|
private reconnectInfo;
|
|
266469
|
+
private agent?;
|
|
266468
266470
|
constructor(params: IConstructorParams);
|
|
266469
266471
|
private pullConnectConfig;
|
|
266470
266472
|
private connect;
|