@vkontakte/calls-sdk 2.8.11-dev.cb5b05f6.0 → 2.8.11-dev.d5496fb5.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.
Files changed (77) hide show
  1. package/CallsSDK.d.ts +61 -36
  2. package/abstract/BaseApi.d.ts +5 -9
  3. package/abstract/BaseSignaling.d.ts +5 -7
  4. package/calls-sdk.cjs.js +16 -13
  5. package/calls-sdk.esm.js +12192 -13
  6. package/classes/AudioFix.d.ts +5 -1
  7. package/classes/AudioOutput.d.ts +5 -1
  8. package/classes/CallRegistry.d.ts +26 -0
  9. package/classes/Conversation.d.ts +44 -12
  10. package/classes/ConversationResponseValidator.d.ts +3 -0
  11. package/classes/DebugInfo.d.ts +3 -0
  12. package/classes/DisplayLayoutRequester.d.ts +39 -0
  13. package/classes/ExternalIdCache.d.ts +19 -0
  14. package/classes/MediaSource.d.ts +12 -1
  15. package/classes/ParticipantIdRegistry.d.ts +3 -0
  16. package/classes/ProducerCommandSerializationService.d.ts +3 -0
  17. package/classes/SignalingActor.d.ts +3 -1
  18. package/classes/SpeakerDetector.d.ts +2 -1
  19. package/classes/SpecListener.d.ts +10 -1
  20. package/classes/StatsLogger.d.ts +26 -0
  21. package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
  22. package/classes/asr/AsrReceiver.d.ts +3 -1
  23. package/classes/codec/LibVPxDecoder.d.ts +3 -0
  24. package/classes/codec/LibVPxEncoder.d.ts +3 -1
  25. package/classes/codec/WebCodecsDecoder.d.ts +3 -0
  26. package/classes/codec/WebCodecsEncoder.d.ts +3 -1
  27. package/classes/codec/WorkerBase.d.ts +7 -0
  28. package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
  29. package/classes/screenshare/CanvasRenderer.d.ts +3 -1
  30. package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
  31. package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
  32. package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
  33. package/classes/screenshare/StreamBuilder.d.ts +5 -1
  34. package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
  35. package/classes/screenshare/WebmBuilder.d.ts +3 -1
  36. package/classes/stat/CodecStatsAggregator.d.ts +7 -7
  37. package/classes/stat/ConversationStats.d.ts +21 -0
  38. package/classes/stat/StatAggregator.d.ts +6 -6
  39. package/classes/stat/StatFirstMediaReceived.d.ts +6 -2
  40. package/classes/stat/StatPings.d.ts +9 -9
  41. package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
  42. package/classes/stat/StatSignalingCommands.d.ts +8 -8
  43. package/classes/transport/BaseTransport.d.ts +1 -1
  44. package/classes/transport/DirectStatReporter.d.ts +3 -1
  45. package/classes/transport/DirectTransport.d.ts +12 -1
  46. package/classes/transport/PerfStatReporter.d.ts +5 -1
  47. package/classes/transport/ServerTransport.d.ts +10 -2
  48. package/classes/transport/Transport.d.ts +13 -14
  49. package/default/Api.d.ts +11 -15
  50. package/default/Signaling.d.ts +40 -45
  51. package/default/SignalingTransport.d.ts +68 -0
  52. package/enums/HangupType.d.ts +2 -1
  53. package/enums/SignalingNotification.d.ts +3 -1
  54. package/enums/TransportState.d.ts +10 -0
  55. package/enums/TransportTopology.d.ts +5 -0
  56. package/package.json +1 -1
  57. package/static/Capabilities.d.ts +5 -0
  58. package/static/Debug.d.ts +27 -8
  59. package/static/External.d.ts +146 -71
  60. package/static/Params.d.ts +106 -78
  61. package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
  62. package/static/Utils.d.ts +3 -2
  63. package/static/WebRTCUtils.d.ts +7 -4
  64. package/types/Capabilities.d.ts +24 -0
  65. package/types/Conversation.d.ts +1 -1
  66. package/types/FastStart.d.ts +1 -0
  67. package/types/Participant.d.ts +12 -1
  68. package/types/ParticipantLayout.d.ts +33 -0
  69. package/types/PerfStatReporter.d.ts +2 -1
  70. package/types/PushData.d.ts +3 -0
  71. package/types/SignalingMessage.d.ts +19 -2
  72. package/types/Statistics.d.ts +1 -1
  73. package/types/WebTransport.d.ts +5 -0
  74. package/utils/DebugStorage.d.ts +100 -1
  75. package/classes/Logger.d.ts +0 -41
  76. package/classes/stat/EventMetricsService.d.ts +0 -9
  77. package/static/ConversationDebugLogger.d.ts +0 -13
@@ -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;
@@ -44,6 +44,16 @@ export interface ParticipantStateMapped {
44
44
  ts: number;
45
45
  };
46
46
  }
47
+ export interface ParticipantSessionState {
48
+ connected: boolean;
49
+ }
50
+ export interface ParticipantConnectionStatus {
51
+ transport: ParticipantStatus;
52
+ sessionState?: ParticipantSessionState;
53
+ sessionStateApplicable: boolean;
54
+ sessionStateConnectedBySpeaker: boolean;
55
+ lastEffective: ParticipantStatus;
56
+ }
47
57
  /**
48
58
  * Состояния участников звонка
49
59
  */
@@ -63,7 +73,6 @@ export interface Participant {
63
73
  externalId: ExternalParticipantId;
64
74
  mediaSettings: MediaSettings;
65
75
  state: ParticipantState;
66
- status: ParticipantStatus;
67
76
  remoteStream?: MediaStream | null;
68
77
  remoteAudioTrack?: MediaStreamTrack | null;
69
78
  secondStream?: MediaStream | null;
@@ -72,6 +81,8 @@ export interface Participant {
72
81
  clientType: string;
73
82
  roles: UserRole[];
74
83
  participantState: ParticipantStateMapped;
84
+ isOnHold?: boolean;
85
+ connectionStatus: ParticipantConnectionStatus;
75
86
  networkRating: number;
76
87
  lastRequestedLayouts: {
77
88
  [key: StreamDescriptionString]: ParticipantLayout;
@@ -54,4 +54,37 @@ export type ParticipantLayout = (Layout | StopStream | RequestKeyFrame) & {
54
54
  */
55
55
  streamName?: string;
56
56
  };
57
+ /**
58
+ * Запрос стрима, который клиент хочет получать для отображения.
59
+ */
60
+ export type DisplayLayoutRequest = {
61
+ /**
62
+ * Внешний ID пользователя
63
+ */
64
+ uid: ExternalParticipantId | string;
65
+ /**
66
+ * Тип медиа (видео с камеры, картинка с экрана, лайв или мувик)
67
+ */
68
+ mediaType: MediaType;
69
+ /**
70
+ * Ширина окошка в котором отображается видео, в пикселях
71
+ */
72
+ width: number;
73
+ /**
74
+ * Высота окошка в котором отображается видео, в пикселях
75
+ */
76
+ height: number;
77
+ /**
78
+ * Отображать видео как CSS object-fit: cover. По умолчанию используется contain.
79
+ */
80
+ cover?: boolean;
81
+ /**
82
+ * Приоритет
83
+ */
84
+ priority?: number;
85
+ /**
86
+ * ID лайва или мувика. null для камеры или скрин-шары.
87
+ */
88
+ streamName?: string;
89
+ };
57
90
  export default ParticipantLayout;
@@ -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
  }
@@ -1,8 +1,11 @@
1
+ import IceServer from './IceServer';
1
2
  type PushData = {
2
3
  caller_id: string;
3
4
  caller_client_type?: string;
4
5
  conversation_id: string;
5
6
  endpoint: string;
7
+ wt_endpoint?: string;
8
+ turn_server?: IceServer;
6
9
  is_video: boolean;
7
10
  token: string;
8
11
  sdp_offer?: string;
@@ -1,5 +1,5 @@
1
1
  import { AnimojiVersion } from '@vkontakte/calls-vmoji';
2
- import { TransportTopology } from '../classes/transport/Transport';
2
+ import TransportTopology from '../enums/TransportTopology';
3
3
  import ChatRoomEventType from '../enums/ChatRoomEventType';
4
4
  import ConversationFeature from '../enums/ConversationFeature';
5
5
  import ConversationOption from '../enums/ConversationOption';
@@ -19,7 +19,7 @@ import MediaModifiers from './MediaModifiers';
19
19
  import MediaSettings from './MediaSettings';
20
20
  import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
21
21
  import MuteStates from './MuteStates';
22
- import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
22
+ import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType, ParticipantSessionState } from './Participant';
23
23
  import { MediaType, ParticipantStreamDescription } from './ParticipantStreamDescription';
24
24
  import { IRoomId } from './Room';
25
25
  import VideoSettings from './VideoSettings';
@@ -89,6 +89,7 @@ declare namespace SignalingMessage {
89
89
  state: Record<string, string>;
90
90
  stateUpdateTs: Record<string, number>;
91
91
  };
92
+ sessionState?: ParticipantSessionState;
92
93
  roles?: UserRole[];
93
94
  peerId?: PeerId;
94
95
  restricted?: boolean;
@@ -97,6 +98,7 @@ declare namespace SignalingMessage {
97
98
  markers?: ParticipantListMarkers;
98
99
  observedIds?: CompositeUserId[];
99
100
  movieShareInfos?: ISharedMovieInfo[];
101
+ onHold?: boolean;
100
102
  }
101
103
  export interface ParticipantListChunk extends Notification {
102
104
  participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
@@ -190,6 +192,7 @@ declare namespace SignalingMessage {
190
192
  deviceIdx?: number;
191
193
  peerId: PeerId;
192
194
  reason: HangupType;
195
+ errorCode?: string;
193
196
  markers?: ParticipantListMarkers;
194
197
  }
195
198
  export interface ClosedConversation extends Notification {
@@ -322,6 +325,13 @@ declare namespace SignalingMessage {
322
325
  export interface SpeakerChanged extends Notification {
323
326
  speaker: ParticipantId;
324
327
  }
328
+ export interface SessionState extends Notification {
329
+ connected: boolean;
330
+ participantId: OkUserId;
331
+ participantType: UserType;
332
+ deviceIdx?: number;
333
+ markers?: ParticipantListMarkers;
334
+ }
325
335
  export interface OptionsChanged extends Notification {
326
336
  options: ConversationOption[];
327
337
  }
@@ -366,6 +376,9 @@ declare namespace SignalingMessage {
366
376
  export interface Connection extends Notification {
367
377
  endpoint: string;
368
378
  conversation: Conversation;
379
+ conversationParams: {
380
+ serverTime: number;
381
+ };
369
382
  isConcurrent: boolean;
370
383
  peerId: PeerId;
371
384
  mediaModifiers: MediaModifiers;
@@ -452,6 +465,10 @@ declare namespace SignalingMessage {
452
465
  export interface VideoSuspendSuggest extends Notification {
453
466
  bandwidth: number;
454
467
  }
468
+ export interface Hold extends Notification {
469
+ participantId: ParticipantId;
470
+ hold: boolean;
471
+ }
455
472
  export {};
456
473
  }
457
474
  export default SignalingMessage;
@@ -1,4 +1,4 @@
1
- import { TransportTopology } from '../classes/transport/Transport';
1
+ import TransportTopology from '../enums/TransportTopology';
2
2
  export type StatTransport = {
3
3
  timestamp: number;
4
4
  availableOutgoingBitrate: number;
@@ -7,6 +7,8 @@ declare class WebTransportEventual {
7
7
  private readonly url;
8
8
  private readonly options;
9
9
  private readonly compression;
10
+ private closeRequested;
11
+ private closeEventEmitted;
10
12
  private encoder;
11
13
  private decoder;
12
14
  onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
@@ -20,7 +22,10 @@ declare class WebTransportEventual {
20
22
  private readChunks;
21
23
  private readLoop;
22
24
  send(data: string): Promise<void>;
25
+ private createErrorEvent;
23
26
  close(code?: number, reason?: string): void;
27
+ private closeConnectedTransport;
28
+ private emitClose;
24
29
  static isBrowserSupported(): boolean;
25
30
  }
26
31
  export { WebTransportEventual as WebTransport };
@@ -1,8 +1,107 @@
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 startConversationSession(): string;
99
+ export declare function setConversationId(conversationId: string | null, sessionId?: string): void;
100
+ export declare function list(): Promise<DebugLogSessionInfo[]>;
101
+ export declare function get(params: DebugLogGetParams): Promise<CurrentLogItem[]>;
102
+ export declare function getJson(params: DebugLogGetParams): Promise<string>;
103
+ export declare function download(params: DebugLogGetParams): Promise<string>;
104
+ export declare function clear(params?: DebugLogGetParams): Promise<void>;
105
+ export declare function stats(): Promise<DebugLogStorageStats>;
106
+ export declare function getAllJson(): Promise<string>;
107
+ export declare function downloadAll(): Promise<string>;
@@ -1,41 +0,0 @@
1
- import BaseApi from '../abstract/BaseApi';
2
- import BaseLogger from '../abstract/BaseLogger';
3
- import StatLog from '../enums/StatLog';
4
- /**
5
- * Класс отвечает за отправку различной информации в сервис статистики (события, статистика и подобное)
6
- */
7
- export default class Logger extends BaseLogger {
8
- private static _instance;
9
- private static _conversationIdProvider;
10
- static setConversationIdProvider(provider: () => string | null): void;
11
- static create(api: BaseApi, externalLogger: BaseLogger | null): void;
12
- static log(name: StatLog, value?: string, immediately?: boolean): void;
13
- static logCustom(name: StatLog, params: Record<string, string | number>, immediately?: boolean): void;
14
- static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
15
- static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
16
- static destroy(): void;
17
- private readonly _externalLogger;
18
- private readonly _api;
19
- private readonly _batchInterval;
20
- private _batchedLogItems;
21
- private _batchedClientStats;
22
- private _batchedClientEvents;
23
- private _batchTimeout;
24
- private _serverTimeDelta;
25
- constructor(api: BaseApi, externalLogger: BaseLogger | null);
26
- log(name: StatLog, value?: string, immediately?: boolean): void;
27
- logCustom(name: string, params: Record<string, string | number>, immediately?: boolean): void;
28
- logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
29
- logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
30
- destroy(): void;
31
- private _logInternal;
32
- private _getConversationId;
33
- private _sendBatch;
34
- private _startTimeout;
35
- private _stopTimeout;
36
- private _sendLogItems;
37
- private _sendClientStats;
38
- private _sendClientEvents;
39
- private _calculateServerTimeDelta;
40
- private _now;
41
- }
@@ -1,9 +0,0 @@
1
- import HangupReason from '../HangupReason';
2
- import { TransportTopology } from '../transport/Transport';
3
- /**
4
- * Класс для работы с событийными метриками, обертка для правильной отправки событий
5
- */
6
- export declare class EventMetricsService {
7
- private static correctHangupReason;
8
- static sendHangupEvent(reason: HangupReason, topology?: TransportTopology): void;
9
- }
@@ -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
- }