@koi-design/callkit 2.1.0-beta.8 → 2.1.1

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.d.ts CHANGED
@@ -96,6 +96,7 @@ declare class Socket {
96
96
  pingTimeout?: number;
97
97
  excludeLogEvents?: string[];
98
98
  };
99
+ isConnected(): boolean;
99
100
  init(): void;
100
101
  private setConnectAuthState;
101
102
  private handleDisconnect;
@@ -3879,7 +3879,7 @@ var WebCall = (() => {
3879
3879
  // package.json
3880
3880
  var package_default = {
3881
3881
  name: "@koi-design/callkit",
3882
- version: "2.1.0-beta.8",
3882
+ version: "2.1.1",
3883
3883
  description: "callkit",
3884
3884
  author: "koi",
3885
3885
  license: "ISC",
@@ -19828,6 +19828,9 @@ ${log}` : log;
19828
19828
  get reconnectConfig() {
19829
19829
  return this.callKit.config.getReconnectConfig("incall");
19830
19830
  }
19831
+ isConnected() {
19832
+ return this.connectAuthState.isConnected;
19833
+ }
19831
19834
  init() {
19832
19835
  const { socket } = this.callKit.config.getConfig();
19833
19836
  this.callKit.logger.info(`socket init: ${socket}`, {
@@ -20161,14 +20164,14 @@ ${log}` : log;
20161
20164
  if (now - this.lastPingTime > pingInterval + pingTimeout) {
20162
20165
  if (this.ws && this.connectAuthState.isConnected) {
20163
20166
  this.ws.close(4001, "ping timeout");
20164
- } else {
20165
- this.callKit.reset();
20166
20167
  }
20167
- this.callKit.logger.error("socket ping timeout", {
20168
+ this.callKit.reset();
20169
+ this.callKit.logger.warn("Ping timeout not connected", {
20168
20170
  caller: "Socket.ping",
20169
20171
  type: "INCALL",
20170
20172
  content: {
20171
- errCode: ErrorCode.SOCKET_PING_TIMEOUT
20173
+ errCode: ErrorCode.SOCKET_PING_TIMEOUT,
20174
+ isConnected: this.isConnected()
20172
20175
  }
20173
20176
  });
20174
20177
  this.callKit.trigger(KitEvent.INCALL_CONNECT_EVENT, {