@koi-design/callkit 2.2.0-beta.1 → 2.2.0-beta.3
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/README.md +0 -2
- package/dist/index.d.ts +596 -594
- package/dist/index.global.js +15 -6
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.global.js
CHANGED
|
@@ -3237,7 +3237,7 @@ var WebCall = (() => {
|
|
|
3237
3237
|
const res = await this.post({
|
|
3238
3238
|
url: "/auth/agentUser/login",
|
|
3239
3239
|
method: "post",
|
|
3240
|
-
data: params
|
|
3240
|
+
data: { ...params, browserVersion: navigator.userAgent }
|
|
3241
3241
|
});
|
|
3242
3242
|
return res;
|
|
3243
3243
|
} finally {
|
|
@@ -3883,7 +3883,7 @@ var WebCall = (() => {
|
|
|
3883
3883
|
// package.json
|
|
3884
3884
|
var package_default = {
|
|
3885
3885
|
name: "@koi-design/callkit",
|
|
3886
|
-
version: "2.2.0-beta.
|
|
3886
|
+
version: "2.2.0-beta.3",
|
|
3887
3887
|
description: "callkit",
|
|
3888
3888
|
author: "koi",
|
|
3889
3889
|
license: "ISC",
|
|
@@ -19909,6 +19909,13 @@ ${log}` : log;
|
|
|
19909
19909
|
get reconnectConfig() {
|
|
19910
19910
|
return this.callKit.config.getReconnectConfig("incall");
|
|
19911
19911
|
}
|
|
19912
|
+
get pingInterval() {
|
|
19913
|
+
const { keepaliveInterval } = this.callKit.config.getConfig().userInfo;
|
|
19914
|
+
if (Number.isInteger(keepaliveInterval) && keepaliveInterval > 0) {
|
|
19915
|
+
return keepaliveInterval * 1e3;
|
|
19916
|
+
}
|
|
19917
|
+
return this.reconnectConfig.pingInterval;
|
|
19918
|
+
}
|
|
19912
19919
|
isConnected() {
|
|
19913
19920
|
return this.connectAuthState.isConnected;
|
|
19914
19921
|
}
|
|
@@ -20243,8 +20250,8 @@ ${log}` : log;
|
|
|
20243
20250
|
return;
|
|
20244
20251
|
this.send(SocketSendEvent.PING);
|
|
20245
20252
|
const now = Date.now();
|
|
20246
|
-
const {
|
|
20247
|
-
if (now - this.lastPingTime > pingInterval + pingTimeout) {
|
|
20253
|
+
const { pingTimeout } = this.reconnectConfig;
|
|
20254
|
+
if (now - this.lastPingTime > this.pingInterval + pingTimeout) {
|
|
20248
20255
|
this.callKit.logger.warn("Ping timeout not connected", {
|
|
20249
20256
|
caller: "Socket.ping",
|
|
20250
20257
|
type: "INCALL",
|
|
@@ -20262,10 +20269,9 @@ ${log}` : log;
|
|
|
20262
20269
|
if (this.pingTimer) {
|
|
20263
20270
|
clearInterval(this.pingTimer);
|
|
20264
20271
|
}
|
|
20265
|
-
const { pingInterval } = this.reconnectConfig;
|
|
20266
20272
|
this.pingTimer = setInterval(() => {
|
|
20267
20273
|
this.ping();
|
|
20268
|
-
}, pingInterval);
|
|
20274
|
+
}, this.pingInterval);
|
|
20269
20275
|
}
|
|
20270
20276
|
/**
|
|
20271
20277
|
* reset socket connection and all states
|
|
@@ -20411,6 +20417,7 @@ ${log}` : log;
|
|
|
20411
20417
|
content: {
|
|
20412
20418
|
username,
|
|
20413
20419
|
password,
|
|
20420
|
+
ua: navigator.userAgent,
|
|
20414
20421
|
encryptionMethod,
|
|
20415
20422
|
encryptionPassword
|
|
20416
20423
|
}
|
|
@@ -20428,6 +20435,7 @@ ${log}` : log;
|
|
|
20428
20435
|
password: encryptionPassword,
|
|
20429
20436
|
timestamp: Date.now()
|
|
20430
20437
|
});
|
|
20438
|
+
console.log("user", user);
|
|
20431
20439
|
if (user) {
|
|
20432
20440
|
this.config.setConfig("userInfo", {
|
|
20433
20441
|
wsUrl: `wss://${user.wsUrl}`,
|
|
@@ -20444,6 +20452,7 @@ ${log}` : log;
|
|
|
20444
20452
|
iceInfo: user.iceInfo,
|
|
20445
20453
|
iceGatheringTimeout: user.iceGatheringTimeout,
|
|
20446
20454
|
logGather: user.logGather,
|
|
20455
|
+
keepaliveInterval: user.keepaliveInterval,
|
|
20447
20456
|
// encryptionType is in extra
|
|
20448
20457
|
...extra
|
|
20449
20458
|
});
|