@vkontakte/calls-sdk 2.8.11-dev.4bbae276.0 → 2.8.11-dev.4ddae26a.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.
@@ -41,6 +41,7 @@ export default class Conversation extends EventEmitter {
41
41
  private _pendingParticipants;
42
42
  private _transport;
43
43
  private _debugInfo;
44
+ private _debugSessionId;
44
45
  private _volumesDetector;
45
46
  private _speakerDetector;
46
47
  private _localVolumeDetector;
@@ -49,6 +50,7 @@ export default class Conversation extends EventEmitter {
49
50
  private _lastSignalledActiveSpeakerId;
50
51
  private _isRealTimeAsrRequested;
51
52
  private _serverSettings;
53
+ private _serverTimeOffset;
52
54
  private static _current;
53
55
  private static _activationMutex;
54
56
  private static _delayedHangup;
@@ -69,6 +71,8 @@ export default class Conversation extends EventEmitter {
69
71
  static current(): Conversation | null;
70
72
  static hangupAfterInit(): void;
71
73
  static id(): string | null;
74
+ static getSyncedTime(): number;
75
+ get debugSessionId(): string | null;
72
76
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
73
77
  onJoin(joinArgs: {
74
78
  conversationId?: string;
@@ -10,8 +10,8 @@ export default class Logger extends BaseLogger {
10
10
  static setConversationIdProvider(provider: () => string | null): void;
11
11
  static create(api: BaseApi, externalLogger: BaseLogger | null): void;
12
12
  static log(name: StatLog, value?: string, immediately?: boolean): void;
13
- static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
14
- static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
13
+ static logClientStats(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
14
+ static logClientEvent(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
15
15
  static destroy(): void;
16
16
  private readonly _externalLogger;
17
17
  private readonly _api;
@@ -22,8 +22,8 @@ export default class Logger extends BaseLogger {
22
22
  private _serverTimeDelta;
23
23
  constructor(api: BaseApi, externalLogger: BaseLogger | null);
24
24
  log(name: StatLog, value?: string, immediately?: boolean): void;
25
- logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
26
- logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
25
+ logClientStats(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
26
+ logClientEvent(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
27
27
  destroy(): void;
28
28
  private _getConversationId;
29
29
  private _sendBatch;
@@ -39,7 +39,6 @@ export default class Signaling extends BaseSignaling {
39
39
  protected conversationReject: Function | null;
40
40
  private connected;
41
41
  private listenersReady;
42
- private postfix;
43
42
  protected peerId: number | null;
44
43
  protected conversationId: string | null;
45
44
  private reconnectTimer;
@@ -164,6 +163,7 @@ export default class Signaling extends BaseSignaling {
164
163
  startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
165
164
  stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
166
165
  requestAsr(request: boolean): Promise<SignalingMessage>;
166
+ private _buildUrl;
167
167
  protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
168
168
  protected _disconnect(code?: number): void;
169
169
  private _onOpen;
@@ -173,6 +173,7 @@ export default class Signaling extends BaseSignaling {
173
173
  protected _handleCachedMessages(): void;
174
174
  private _throwError;
175
175
  private _onError;
176
+ private _serializeErrorEvent;
176
177
  protected _onClose(event: CloseEvent): void;
177
178
  protected _closeSocket(error?: Error | null): void;
178
179
  protected _reconnect(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.11-dev.4bbae276.0",
3
+ "version": "2.8.11-dev.4ddae26a.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",
package/static/Debug.d.ts CHANGED
@@ -8,10 +8,10 @@ export declare enum DebugMessageType {
8
8
  ERROR = "ERROR"
9
9
  }
10
10
  declare namespace Debug {
11
- let debug: Function;
12
- let log: Function;
13
- let warn: Function;
14
- let error: Function;
11
+ function debug(...args: any[]): void;
12
+ function log(...args: any[]): void;
13
+ function warn(...args: any[]): void;
14
+ function error(...args: any[]): void;
15
15
  function enabled(): boolean;
16
16
  function toggle(enable: boolean): void;
17
17
  function send(type: DebugMessageType, ...args: any[]): void;
@@ -31,6 +31,7 @@ export interface FastStartParams {
31
31
  conversationId: string;
32
32
  internalParams: string;
33
33
  externalIds?: ExternalId[];
34
+ payload: string;
34
35
  opponentType: CallType;
35
36
  mediaOptions: MediaOption[];
36
37
  joiningAllowed?: boolean;
@@ -41,10 +41,11 @@ export interface CallStatReport {
41
41
  remote_connection_type?: RTCIceCandidateType;
42
42
  }
43
43
  export interface ICallStatLog extends Pick<CallStatReport, 'call_topology' | 'nack_sent' | 'nack_received' | 'pli_sent' | 'pli_received' | 'fir_sent' | 'fir_received' | 'frames_dropped' | 'stat_time_delta'>, Pick<Partial<CallStatReport>, 'rtt' | 'jitter_video' | 'jitter_audio' | 'interframe_delay_variance' | 'freeze_count' | 'total_freezes_duration' | 'ss_freeze_count' | 'ss_total_freezes_duration' | 'inserted_audio_samples_for_deceleration' | 'removed_audio_samples_for_acceleration' | 'concealed_audio_samples' | 'total_audio_energy' | 'local_address' | 'local_connection_type' | 'network_type' | 'transport' | 'remote_address' | 'remote_connection_type'> {
44
+ is_simulcast?: boolean;
44
45
  concealed_silent_audio_samples?: number;
45
46
  concealment_audio_avg_size?: number;
46
47
  video_loss?: number;
47
48
  audio_loss?: number;
48
49
  cpu_hardware_concurrency?: number;
49
- [k: string]: string | number | undefined;
50
+ [k: string]: string | number | boolean | undefined;
50
51
  }
@@ -366,6 +366,9 @@ declare namespace SignalingMessage {
366
366
  export interface Connection extends Notification {
367
367
  endpoint: string;
368
368
  conversation: Conversation;
369
+ conversationParams: {
370
+ serverTime: number;
371
+ };
369
372
  isConcurrent: boolean;
370
373
  peerId: PeerId;
371
374
  mediaModifiers: MediaModifiers;
@@ -20,6 +20,7 @@ declare class WebTransportEventual {
20
20
  private readChunks;
21
21
  private readLoop;
22
22
  send(data: string): Promise<void>;
23
+ private createErrorEvent;
23
24
  close(code?: number, reason?: string): void;
24
25
  static isBrowserSupported(): boolean;
25
26
  }
@@ -1,8 +1,108 @@
1
+ /**
2
+ * Запись отладочного лога SDK.
3
+ */
1
4
  export type CurrentLogItem = {
2
5
  readonly t: number;
3
6
  readonly l: string;
4
7
  readonly d: any[];
5
8
  readonly h: string;
6
9
  };
7
- export declare function add(level: string, args: any[]): void;
10
+ /**
11
+ * Информация о сохраненной локальной сессии логирования.
12
+ */
13
+ export type DebugLogSessionInfo = {
14
+ /**
15
+ * Внутренний id локальной сессии логирования.
16
+ */
17
+ readonly sessionId: string;
18
+ /**
19
+ * Id звонка. Может быть null, если звонок не успел стартовать.
20
+ */
21
+ readonly conversationId: string | null;
22
+ /**
23
+ * Время первой записи в ms.
24
+ */
25
+ readonly startTime: number;
26
+ /**
27
+ * Время последней записи в ms.
28
+ */
29
+ readonly endTime: number;
30
+ /**
31
+ * Время последнего обновления в ms.
32
+ */
33
+ readonly updatedAt: number;
34
+ /**
35
+ * Размер сохраненных данных в байтах.
36
+ */
37
+ readonly bytes: number;
38
+ /**
39
+ * Количество записей лога.
40
+ */
41
+ readonly entriesCount: number;
42
+ };
43
+ /**
44
+ * Статистика локального хранилища отладочных логов.
45
+ */
46
+ export type DebugLogStorageStats = {
47
+ /**
48
+ * Доступен ли IndexedDB для сохранения логов.
49
+ */
50
+ readonly supported: boolean;
51
+ /**
52
+ * Количество сохраненных звонков.
53
+ */
54
+ readonly callsCount: number;
55
+ /**
56
+ * Количество локальных сессий логирования.
57
+ */
58
+ readonly sessionsCount: number;
59
+ /**
60
+ * Размер сохраненных логов SDK в байтах.
61
+ */
62
+ readonly usedBytes: number;
63
+ /**
64
+ * Максимальный размер DebugStorage в байтах.
65
+ */
66
+ readonly maxBytes: number;
67
+ /**
68
+ * Максимальное количество звонков в DebugStorage.
69
+ */
70
+ readonly maxCalls: number;
71
+ /**
72
+ * Общая квота браузерного хранилища, если доступна.
73
+ */
74
+ readonly quotaBytes?: number;
75
+ /**
76
+ * Использование браузерного хранилища, если доступно.
77
+ */
78
+ readonly usageBytes?: number;
79
+ };
80
+ /**
81
+ * Параметры чтения или очистки локальных логов.
82
+ */
83
+ export type DebugLogGetParams = {
84
+ /**
85
+ * Id звонка. Вернет все локальные сессии с этим conversationId.
86
+ */
87
+ readonly conversationId: string;
88
+ readonly sessionId?: never;
89
+ } | {
90
+ /**
91
+ * Внутренний id локальной сессии из debugLogs.list().
92
+ */
93
+ readonly sessionId: string;
94
+ readonly conversationId?: never;
95
+ };
96
+ export declare function add(level: string, args: any[], sessionId?: string): CurrentLogItem;
8
97
  export declare function init(): void;
98
+ export declare function startSession(forceNew?: boolean): string;
99
+ export declare function setConversationId(conversationId: string | null, sessionId?: string): void;
100
+ export declare function list(): Promise<DebugLogSessionInfo[]>;
101
+ export declare function getCurrentSession(): Promise<DebugLogSessionInfo | null>;
102
+ export declare function get(params: DebugLogGetParams): Promise<CurrentLogItem[]>;
103
+ export declare function getJson(params: DebugLogGetParams): Promise<string>;
104
+ export declare function download(params: DebugLogGetParams): Promise<string>;
105
+ export declare function clear(params?: DebugLogGetParams): Promise<void>;
106
+ export declare function stats(): Promise<DebugLogStorageStats>;
107
+ export declare function getAllJson(): Promise<string>;
108
+ export declare function downloadAll(): Promise<string>;
@@ -1,13 +0,0 @@
1
- import { CurrentLogItem } from '../utils/DebugStorage';
2
- export declare class ConversationDebugLogger {
3
- private static _list;
4
- private static _conversationId;
5
- static get startTime(): number;
6
- static get endTime(): number;
7
- static startSession(): void;
8
- static get conversationId(): string | null;
9
- static set conversationId(conversationId: string | null);
10
- static add(item: CurrentLogItem): void;
11
- private static _createContextLogs;
12
- static collectLogs(): CurrentLogItem[];
13
- }