@vkontakte/calls-sdk 2.8.13-dev.0b862caf.0 → 2.8.13-dev.4ce2e1bb.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/calls-sdk.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @vkontakte/calls-sdk v2.8.13-dev.0b862caf.0
3
- * Tue, 15 Sep 2026 20:28:59 GMT
2
+ * @vkontakte/calls-sdk v2.8.13-dev.4ce2e1bb.0
3
+ * Tue, 15 Sep 2026 20:51:06 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -2152,10 +2152,13 @@ var yn = vn.getInstance(), M = class e {
2152
2152
  return "ok.calls.sdk.js";
2153
2153
  }
2154
2154
  static get appVersion() {
2155
+ return e._params.appVersion;
2156
+ }
2157
+ static get apiClientVersion() {
2155
2158
  return 1.1;
2156
2159
  }
2157
2160
  static get sdkVersion() {
2158
- return "2.8.13-dev.0b862caf.0";
2161
+ return "2.8.13-dev.4ce2e1bb.0";
2159
2162
  }
2160
2163
  static get debug() {
2161
2164
  return e._params.debug;
@@ -2275,9 +2278,6 @@ var yn = vn.getInstance(), M = class e {
2275
2278
  static get signalingReconnectMaxCount() {
2276
2279
  return e._params.signalingReconnectMaxCount;
2277
2280
  }
2278
- static get signalingReconnectMaxDuration() {
2279
- return e._params.signalingReconnectMaxDuration;
2280
- }
2281
2281
  static get waitConnectionDelay() {
2282
2282
  return e._params.waitConnectionDelay;
2283
2283
  }
@@ -2581,6 +2581,7 @@ var yn = vn.getInstance(), M = class e {
2581
2581
  movieShare: e._params.movieShare,
2582
2582
  clientType: e._params.clientType,
2583
2583
  clientStatsPlatform: e._params.clientStatsPlatform,
2584
+ appVersion: e._params.appVersion,
2584
2585
  consumerScreenDataChannelPacketSize: e._params.consumerScreenDataChannelPacketSize,
2585
2586
  switchVideoAtBadNetwork: e._params.switchVideoAtBadNetwork,
2586
2587
  simulcast: e._params.simulcast,
@@ -2596,6 +2597,7 @@ var yn = vn.getInstance(), M = class e {
2596
2597
  h(M, "_params", {
2597
2598
  platform: "WEB",
2598
2599
  clientStatsPlatform: "",
2600
+ appVersion: "0.0.0",
2599
2601
  clientType: "PORTAL",
2600
2602
  externalUserType: "",
2601
2603
  device: "browser",
@@ -2613,7 +2615,6 @@ h(M, "_params", {
2613
2615
  signalingReconnectDelay: 1e3,
2614
2616
  signalingReconnectMaxDelay: 5e3,
2615
2617
  signalingReconnectMaxCount: 10,
2616
- signalingReconnectMaxDuration: 6e4,
2617
2618
  waitConnectionDelay: 1e4,
2618
2619
  waitResponseDelay: 1e4,
2619
2620
  waitMessageDelay: 15e3,
@@ -6925,10 +6926,10 @@ var ya = va, ba = {
6925
6926
  }, n;
6926
6927
  }
6927
6928
  }, ja = /* @__PURE__ */ function(e) {
6928
- return e.EMPTY_ENDPOINT = "EMPTY_ENDPOINT", e.NETWORK_ERROR = "NETWORK_ERROR", e.RECONNECT_TIMEOUT = "RECONNECT_TIMEOUT", e.ABORTED = "ABORTED", e;
6929
+ return e.EMPTY_ENDPOINT = "EMPTY_ENDPOINT", e.NETWORK_ERROR = "NETWORK_ERROR", e.ABORTED = "ABORTED", e;
6929
6930
  }({}), Ma = class {
6930
6931
  constructor(e = R, t) {
6931
- h(this, "handlers", void 0), h(this, "socket", null), h(this, "endpoint", ""), h(this, "wtEndpoint", null), h(this, "peerId", null), h(this, "lastStamp", 0), h(this, "connectionType", void 0), h(this, "reconnectCount", 0), h(this, "reconnectTimer", 0), h(this, "reconnectDeadlineTimer", 0), h(this, "doctorTimer", 0), h(this, "forceWebSocket", !1), h(this, "abortSignal", void 0), h(this, "manualClose", !1), h(this, "currentType", yr.WEBSOCKET), h(this, "_debug", void 0), this.handlers = t, this._debug = e;
6932
+ h(this, "handlers", void 0), h(this, "socket", null), h(this, "endpoint", ""), h(this, "wtEndpoint", null), h(this, "peerId", null), h(this, "lastStamp", 0), h(this, "connectionType", void 0), h(this, "reconnectCount", 0), h(this, "reconnectTimer", 0), h(this, "doctorTimer", 0), h(this, "forceWebSocket", !1), h(this, "abortSignal", void 0), h(this, "manualClose", !1), h(this, "currentType", yr.WEBSOCKET), h(this, "_debug", void 0), this.handlers = t, this._debug = e;
6932
6933
  }
6933
6934
  get readyState() {
6934
6935
  return this.socket?.readyState ?? null;
@@ -6951,14 +6952,14 @@ var ya = va, ba = {
6951
6952
  setAbortSignal(e) {
6952
6953
  this.abortSignal = e;
6953
6954
  }
6954
- onConnectionRestored() {
6955
- this.reconnectCount = 0, this._stopReconnectDeadline();
6955
+ resetReconnectCount() {
6956
+ this.reconnectCount = 0;
6956
6957
  }
6957
6958
  connect(e) {
6958
6959
  this.socket && this.socket.readyState < WebSocket.CLOSING || (e !== vr.RETRY && (this.forceWebSocket = !1, this.reconnectCount = 0), this.manualClose = !1, this.connectionType = e, this._connect());
6959
6960
  }
6960
6961
  close(e) {
6961
- this.manualClose = !0, this._disconnect(e), window.clearTimeout(this.reconnectTimer), this.reconnectTimer = 0, this._stopReconnectDeadline(), this.lastStamp = 0;
6962
+ this.manualClose = !0, this._disconnect(e), window.clearTimeout(this.reconnectTimer), this.reconnectTimer = 0, this.lastStamp = 0;
6962
6963
  }
6963
6964
  async send(e) {
6964
6965
  await this.socket?.send(e);
@@ -6999,7 +7000,7 @@ var ya = va, ba = {
6999
7000
  }
7000
7001
  _buildUrl(e, t) {
7001
7002
  let n = new URL(e), r = n.searchParams;
7002
- return r.set("platform", M.platform), r.set("appVersion", String(M.appVersion)), r.set("version", String(M.protocolVersion)), r.set("device", M.device), r.set("capabilities", xa.getFlags()), r.set("clientType", M.clientType), this.connectionType && r.set("tgt", this.connectionType), this.connectionType === vr.RETRY && this.lastStamp && r.set("recoverTs", String(this.lastStamp)), M.useParticipantListChunk && (r.set("partIdx", String(M.participantListChunkInitIndex)), M.participantListChunkInitCount !== null && r.set("partCount", String(M.participantListChunkInitCount))), t && (r.set("compression", "deflate-raw"), r.set("ua", navigator.userAgent)), this.peerId !== null && r.set("peerId", String(this.peerId)), n.toString();
7003
+ return r.set("platform", M.platform), r.set("appVersion", M.appVersion), r.set("version", String(M.protocolVersion)), r.set("device", M.device), r.set("capabilities", xa.getFlags()), r.set("clientType", M.clientType), this.connectionType && r.set("tgt", this.connectionType), this.connectionType === vr.RETRY && this.lastStamp && r.set("recoverTs", String(this.lastStamp)), M.useParticipantListChunk && (r.set("partIdx", String(M.participantListChunkInitIndex)), M.participantListChunkInitCount !== null && r.set("partCount", String(M.participantListChunkInitCount))), t && (r.set("compression", "deflate-raw"), r.set("ua", navigator.userAgent)), this.peerId !== null && r.set("peerId", String(this.peerId)), n.toString();
7003
7004
  }
7004
7005
  _canUseWebTransport() {
7005
7006
  return !this.forceWebSocket && Aa.isBrowserSupported() && this.wtEndpoint !== null && M.webtransport;
@@ -7031,32 +7032,20 @@ var ya = va, ba = {
7031
7032
  }
7032
7033
  _scheduleReconnect(e = this._getReconnectDelay()) {
7033
7034
  if (this.reconnectCount >= M.signalingReconnectMaxCount) {
7034
- this._stopReconnectDeadline(), this.handlers.onFailed({
7035
+ this.handlers.onFailed({
7035
7036
  failure: "NETWORK_ERROR",
7036
7037
  message: "Unable to connect to the signaling: reconnect attempts exhausted",
7037
7038
  source: this.currentType
7038
7039
  });
7039
7040
  return;
7040
7041
  }
7041
- this._startReconnectDeadline(), this.reconnectCount++, this.handlers.onReconnectScheduled({
7042
+ this.reconnectCount++, this.handlers.onReconnectScheduled({
7042
7043
  count: this.reconnectCount,
7043
7044
  delay: e
7044
7045
  }), this.reconnectTimer = window.setTimeout(() => {
7045
7046
  this.connectionType = vr.RETRY, this._connect();
7046
7047
  }, e);
7047
7048
  }
7048
- _startReconnectDeadline() {
7049
- this.reconnectDeadlineTimer || (this.reconnectDeadlineTimer = window.setTimeout(() => {
7050
- this.reconnectDeadlineTimer = 0, window.clearTimeout(this.reconnectTimer), this.reconnectTimer = 0, this._disconnect(4e3), this.handlers.onFailed({
7051
- failure: "RECONNECT_TIMEOUT",
7052
- message: "Unable to connect to the signaling: reconnect timeout",
7053
- source: this.currentType
7054
- });
7055
- }, M.signalingReconnectMaxDuration));
7056
- }
7057
- _stopReconnectDeadline() {
7058
- window.clearTimeout(this.reconnectDeadlineTimer), this.reconnectDeadlineTimer = 0;
7059
- }
7060
7049
  _getReconnectDelay() {
7061
7050
  return Math.min(M.signalingReconnectMaxDelay, M.signalingReconnectDelay * 2 ** this.reconnectCount);
7062
7051
  }
@@ -7485,7 +7474,7 @@ var Ra = new Set([
7485
7474
  _handleMessage(e) {
7486
7475
  switch (e.type) {
7487
7476
  case "notification":
7488
- this._attachNotificationCallError(e), e.notification === "connection" ? (this._debug.debug("[signaling] signaling connected", e), this.connected = !0, this.transport.onConnectionRestored(), this.transport.setEndpoint(e.endpoint), e.peerId && this.peerId !== e.peerId.id && (this.peerId = e.peerId.id, this.transport.setPeerId(e.peerId.id)), this._stopWaitConnectionMessage(), this.conversationResolve ? this.conversationResolve(e) : (this._logTransportStat(br.RESTART), this._triggerEvent(G.RECONNECT, e), e.conversation.topology && this._triggerEvent(G.NOTIFICATION, {
7477
+ this._attachNotificationCallError(e), e.notification === "connection" ? (this._debug.debug("[signaling] signaling connected", e), this.connected = !0, this.transport.resetReconnectCount(), this.transport.setEndpoint(e.endpoint), e.peerId && this.peerId !== e.peerId.id && (this.peerId = e.peerId.id, this.transport.setPeerId(e.peerId.id)), this._stopWaitConnectionMessage(), this.conversationResolve ? this.conversationResolve(e) : (this._logTransportStat(br.RESTART), this._triggerEvent(G.RECONNECT, e), e.conversation.topology && this._triggerEvent(G.NOTIFICATION, {
7489
7478
  type: "notification",
7490
7479
  notification: K.TOPOLOGY_CHANGED,
7491
7480
  topology: e.conversation.topology
@@ -7757,14 +7746,6 @@ var Ra = new Set([
7757
7746
  description: "connection-failed"
7758
7747
  } }));
7759
7748
  break;
7760
- case ja.RECONNECT_TIMEOUT:
7761
- this._fail(new O(D.NETWORK_ERROR, { callError: {
7762
- scope: "network",
7763
- source: e.source,
7764
- code: "reconnect-timeout",
7765
- description: "connection-failed"
7766
- } }));
7767
- break;
7768
7749
  case ja.ABORTED:
7769
7750
  this._debug.debug("[signaling] aborted reconnect"), this._fail(new O(D.CANCELED));
7770
7751
  break;
@@ -12489,7 +12470,7 @@ var Ps = class extends Es {
12489
12470
  let t = { session_data: {
12490
12471
  version: 2,
12491
12472
  device_id: this._uuid,
12492
- client_version: M.appVersion,
12473
+ client_version: M.apiClientVersion,
12493
12474
  client_type: "SDK_JS"
12494
12475
  } };
12495
12476
  return M.authToken && (t.session_data.auth_token = M.authToken, t.session_data.version = 3), this._callUnsafe("auth.anonymLogin", t, !0).then((e) => {
@@ -12547,7 +12528,7 @@ var Ps = class extends Es {
12547
12528
  }
12548
12529
  logClientStats(e) {
12549
12530
  let t = {
12550
- app_version: String(M.appVersion),
12531
+ app_version: M.appVersion,
12551
12532
  sdk_type: "WEB",
12552
12533
  sdk_version: M.sdkVersion,
12553
12534
  version: 1,
@@ -12750,7 +12731,7 @@ var Ls = /* @__PURE__ */ function(e) {
12750
12731
  let e = await bs("auth.anonymLogin", {
12751
12732
  session_data: {
12752
12733
  device_id: this._uuid,
12753
- client_version: M.appVersion,
12734
+ client_version: M.apiClientVersion,
12754
12735
  client_type: "SDK_JS",
12755
12736
  auth_token: this._callToken,
12756
12737
  version: 3
@@ -4,7 +4,6 @@ import { DebugLogger } from '../static/Debug';
4
4
  export declare enum SignalingTransportFailure {
5
5
  EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
6
6
  NETWORK_ERROR = "NETWORK_ERROR",
7
- RECONNECT_TIMEOUT = "RECONNECT_TIMEOUT",
8
7
  ABORTED = "ABORTED"
9
8
  }
10
9
  export type SignalingTransportFailedEvent = {
@@ -41,7 +40,6 @@ export default class SignalingTransport {
41
40
  private connectionType;
42
41
  private reconnectCount;
43
42
  private reconnectTimer;
44
- private reconnectDeadlineTimer;
45
43
  private doctorTimer;
46
44
  private forceWebSocket;
47
45
  private abortSignal;
@@ -56,7 +54,7 @@ export default class SignalingTransport {
56
54
  setPeerId(peerId: number | null): void;
57
55
  setLastStamp(lastStamp: number): void;
58
56
  setAbortSignal(signal?: AbortSignal): void;
59
- onConnectionRestored(): void;
57
+ resetReconnectCount(): void;
60
58
  connect(connectionType: SignalingConnectionType): void;
61
59
  close(code?: number): void;
62
60
  send(data: string | ArrayBuffer): Promise<void>;
@@ -72,8 +70,6 @@ export default class SignalingTransport {
72
70
  private _onClose;
73
71
  private _disconnect;
74
72
  private _scheduleReconnect;
75
- private _startReconnectDeadline;
76
- private _stopReconnectDeadline;
77
73
  private _getReconnectDelay;
78
74
  private _startDoctor;
79
75
  private _stopDoctor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.13-dev.0b862caf.0",
3
+ "version": "2.8.13-dev.4ce2e1bb.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -37,6 +37,11 @@ export type ParamsObject = {
37
37
  platform: string;
38
38
  /** @hidden */
39
39
  clientStatsPlatform: string;
40
+ /**
41
+ * Версия приложения-хоста, уходит в статистику и сигналинг, например `'26.31.0:6822'`.
42
+ * По умолчанию `'0.0.0'`
43
+ */
44
+ appVersion: string;
40
45
  /** @hidden */
41
46
  clientType: string;
42
47
  /** @hidden */
@@ -93,8 +98,6 @@ export type ParamsObject = {
93
98
  /** @hidden */
94
99
  signalingReconnectMaxCount: number;
95
100
  /** @hidden */
96
- signalingReconnectMaxDuration: number;
97
- /** @hidden */
98
101
  waitConnectionDelay: number;
99
102
  /** @hidden */
100
103
  waitResponseDelay: number;
@@ -929,7 +932,13 @@ export default abstract class Params {
929
932
  static getScreenFrameRate(fastScreenShare: boolean): number;
930
933
  static get<N extends keyof ParamsObject>(name: N): ParamsObject[N];
931
934
  static get appName(): string;
932
- static get appVersion(): number;
935
+ static get appVersion(): string;
936
+ /**
937
+ * Версия клиента для `client_version` в `auth.anonymLogin`. Бэкенд валидирует формат,
938
+ * поэтому это фиксированное значение, а не версия приложения-хоста (см. {@link Params.appVersion}).
939
+ * @hidden
940
+ */
941
+ static get apiClientVersion(): number;
933
942
  static get sdkVersion(): string;
934
943
  static get debug(): boolean;
935
944
  static get protocolVersion(): 5 | 6;
@@ -966,7 +975,6 @@ export default abstract class Params {
966
975
  static get signalingReconnectDelay(): number;
967
976
  static get signalingReconnectMaxDelay(): number;
968
977
  static get signalingReconnectMaxCount(): number;
969
- static get signalingReconnectMaxDuration(): number;
970
978
  static get waitConnectionDelay(): number;
971
979
  static get waitResponseDelay(): number;
972
980
  static get waitMessageDelay(): number;
@@ -1090,6 +1098,7 @@ export default abstract class Params {
1090
1098
  movieShare: boolean;
1091
1099
  clientType: string;
1092
1100
  clientStatsPlatform: string;
1101
+ appVersion: string;
1093
1102
  consumerScreenDataChannelPacketSize: number;
1094
1103
  switchVideoAtBadNetwork: boolean;
1095
1104
  simulcast: boolean;