@vkontakte/calls-sdk 2.8.11-dev.af7eda54.0 → 2.8.11-dev.b9508cee.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 (74) hide show
  1. package/CallsSDK.d.ts +23 -28
  2. package/abstract/BaseApi.d.ts +3 -5
  3. package/abstract/BaseSignaling.d.ts +4 -5
  4. package/calls-sdk.cjs.js +9 -9
  5. package/calls-sdk.esm.js +4580 -3724
  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 +43 -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/MediaSource.d.ts +12 -1
  14. package/classes/ParticipantIdRegistry.d.ts +3 -0
  15. package/classes/ProducerCommandSerializationService.d.ts +3 -0
  16. package/classes/SignalingActor.d.ts +3 -1
  17. package/classes/SpeakerDetector.d.ts +2 -1
  18. package/classes/SpecListener.d.ts +10 -1
  19. package/classes/{Logger.d.ts → StatsLogger.d.ts} +3 -13
  20. package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
  21. package/classes/asr/AsrReceiver.d.ts +3 -1
  22. package/classes/codec/LibVPxDecoder.d.ts +3 -0
  23. package/classes/codec/LibVPxEncoder.d.ts +3 -1
  24. package/classes/codec/WebCodecsDecoder.d.ts +3 -0
  25. package/classes/codec/WebCodecsEncoder.d.ts +3 -1
  26. package/classes/codec/WorkerBase.d.ts +7 -0
  27. package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
  28. package/classes/screenshare/CanvasRenderer.d.ts +3 -1
  29. package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
  30. package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
  31. package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
  32. package/classes/screenshare/StreamBuilder.d.ts +5 -1
  33. package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
  34. package/classes/screenshare/WebmBuilder.d.ts +3 -1
  35. package/classes/stat/CodecStatsAggregator.d.ts +7 -7
  36. package/classes/stat/ConversationStats.d.ts +21 -0
  37. package/classes/stat/StatAggregator.d.ts +6 -6
  38. package/classes/stat/StatFirstMediaReceived.d.ts +6 -2
  39. package/classes/stat/StatPings.d.ts +9 -9
  40. package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
  41. package/classes/stat/StatSignalingCommands.d.ts +8 -8
  42. package/classes/transport/BaseTransport.d.ts +1 -1
  43. package/classes/transport/DirectStatReporter.d.ts +3 -1
  44. package/classes/transport/DirectTransport.d.ts +12 -1
  45. package/classes/transport/PerfStatReporter.d.ts +5 -1
  46. package/classes/transport/ServerTransport.d.ts +10 -2
  47. package/classes/transport/Transport.d.ts +13 -14
  48. package/default/Api.d.ts +9 -8
  49. package/default/Signaling.d.ts +38 -43
  50. package/default/SignalingTransport.d.ts +68 -0
  51. package/enums/HangupType.d.ts +2 -1
  52. package/enums/SignalingNotification.d.ts +3 -1
  53. package/enums/TransportState.d.ts +10 -0
  54. package/enums/TransportTopology.d.ts +5 -0
  55. package/package.json +1 -1
  56. package/static/Capabilities.d.ts +5 -0
  57. package/static/Debug.d.ts +27 -8
  58. package/static/External.d.ts +146 -71
  59. package/static/Params.d.ts +106 -78
  60. package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
  61. package/static/Utils.d.ts +3 -2
  62. package/static/WebRTCUtils.d.ts +6 -4
  63. package/types/Capabilities.d.ts +24 -0
  64. package/types/Conversation.d.ts +1 -1
  65. package/types/ExternalId.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/PushData.d.ts +3 -0
  70. package/types/SignalingMessage.d.ts +16 -2
  71. package/types/Statistics.d.ts +1 -1
  72. package/types/WebTransport.d.ts +4 -0
  73. package/utils/DebugStorage.d.ts +1 -2
  74. package/classes/stat/EventMetricsService.d.ts +0 -9
package/CallsSDK.d.ts CHANGED
@@ -9,7 +9,7 @@ import { AddParticipantParams } from './abstract/BaseSignaling';
9
9
  import HangupReason, { HangupReasonData, CustomError } from './classes/HangupReason';
10
10
  import { MediaTrackKind } from './classes/MediaSource';
11
11
  import { AudienceModeHandsResponse } from './types/AudienceMode';
12
- import { TransportTopology } from './classes/transport/Transport';
12
+ import TransportTopology from './enums/TransportTopology';
13
13
  import Api from './default/Api';
14
14
  import Signaling from './default/Signaling';
15
15
  import CallDirection from './enums/CallDirection';
@@ -50,7 +50,7 @@ import { IAddMovieParams, IMovieMetaData, IMoviePreview, IOnRemoteMovieData, ISh
50
50
  import MuteStates, { IMuteParticipantInternalParams, IMuteParticipantParams } from './types/MuteStates';
51
51
  import { IAPIBaseUrl, IApiEnv } from './types/Params';
52
52
  import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantListMarker, ParticipantListMarkers, ParticipantListType, ParticipantsStateList, ParticipantStateMapped, ParticipantStateData, ParticipantStateDataKey, ParticipantStateDataValue } from './types/Participant';
53
- import ParticipantLayout, { Layout, RequestKeyFrame, StopStream } from './types/ParticipantLayout';
53
+ import ParticipantLayout, { DisplayLayoutRequest, Layout, RequestKeyFrame, StopStream } from './types/ParticipantLayout';
54
54
  import { ParticipantListChunkParameters } from './types/ParticipantListChunk';
55
55
  import ParticipantPriority from './types/ParticipantPriority';
56
56
  import { MediaType, ParticipantStreamDescription } from './types/ParticipantStreamDescription';
@@ -67,6 +67,7 @@ import { VmojiError } from './types/Vmoji';
67
67
  import { VolumeDetector } from './classes/VolumeDetector';
68
68
  import { FastStartHandler, FastStartParams } from './types/FastStart';
69
69
  import { FastJoinHandler, FastJoinParams, FastJoinResponse } from './types/FastJoin';
70
+ import PushData from './types/PushData';
70
71
  export type { CurrentLogItem, DebugLogGetParams, DebugLogSessionInfo, DebugLogStorageStats } from './utils/DebugStorage';
71
72
  /**
72
73
  * Информация о текущем браузере
@@ -255,6 +256,7 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
255
256
  */
256
257
  export declare function processPush(conversationId: string, conversationParams?: string): Promise<void>;
257
258
  export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
259
+ export declare function getInbounds(): Promise<PushData[]>;
258
260
  /**
259
261
  * Авторизоваться для совершения звонков
260
262
  *
@@ -267,11 +269,11 @@ export declare function authorize(authToken?: string, apiBaseUrl?: IAPIBaseUrl):
267
269
  *
268
270
  * @param mediaOptions Нужно ли включать камеру и микрофон
269
271
  */
270
- export declare function acceptCall(mediaOptions?: MediaOption[]): Promise<ConversationData>;
272
+ export declare function acceptCall(mediaOptions?: MediaOption[], conversationId?: string): Promise<ConversationData>;
271
273
  /**
272
274
  * Отклонить входящий звонок
273
275
  */
274
- export declare function declineCall(): Promise<void>;
276
+ export declare function declineCall(conversationId?: string): Promise<void>;
275
277
  /**
276
278
  * Присоединиться к активному звонку
277
279
  *
@@ -294,7 +296,7 @@ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOpt
294
296
  /**
295
297
  * Завершить текущий разговор
296
298
  */
297
- export declare function hangup(): Promise<void>;
299
+ export declare function hangup(conversationId?: string): Promise<void>;
298
300
  /**
299
301
  * Добавить собеседника в звонок
300
302
  *
@@ -342,7 +344,7 @@ export declare function changeDevice(kind: MediaDeviceKind, deviceId: string): P
342
344
  * state Включить или выключить захват экрана
343
345
  * settings Параметры захваты экрана
344
346
  */
345
- export declare function captureScreen(stateOrSettings: boolean | ScreenCaptureSettings): Promise<void>;
347
+ export declare function captureScreen(stateOrSettings: boolean | ScreenCaptureSettings, conversationId?: string): Promise<void>;
346
348
  /**
347
349
  * Включить/выключить передачу точек вимоджи
348
350
  *
@@ -363,13 +365,13 @@ export declare function setVideoStream(stream: MediaStream, isScreen?: boolean):
363
365
  *
364
366
  * @param enabled
365
367
  */
366
- export declare function toggleLocalVideo(enabled: boolean): Promise<void>;
368
+ export declare function toggleLocalVideo(enabled: boolean, conversationId?: string): Promise<void>;
367
369
  /**
368
370
  * Включить или выключить свой микрофон
369
371
  *
370
372
  * @param enabled
371
373
  */
372
- export declare function toggleLocalAudio(enabled: boolean): Promise<void>;
374
+ export declare function toggleLocalAudio(enabled: boolean, conversationId?: string): Promise<void>;
373
375
  /**
374
376
  * Изменяет размеры локального видео
375
377
  *
@@ -395,12 +397,6 @@ export declare function changePriorities(priorities: ParticipantPriority[]): Pro
395
397
  * @param externalId Внешний ID пользователя
396
398
  */
397
399
  export declare function changeParticipantState(state: ParticipantStateData, externalId?: ExternalId): Promise<void>;
398
- /**
399
- * Ставит звонок на удержание
400
- *
401
- * @param hold - true/false
402
- */
403
- export declare function hold(hold: boolean): Promise<void>;
404
400
  /**
405
401
  * Принудительно опустить руки участников в текущем сессионном зале админа
406
402
  */
@@ -412,6 +408,12 @@ export declare function putHandsDown(): Promise<void>;
412
408
  * @param layout Список приоритетов
413
409
  */
414
410
  export declare function updateDisplayLayout(layout: ParticipantLayout[]): Promise<void>;
411
+ /**
412
+ * Запрашивает стримы, которые клиент хочет получать для отображения.
413
+ *
414
+ * @param requests Полный список стримов, которые должны приходить на клиент
415
+ */
416
+ export declare function requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
415
417
  /**
416
418
  * Выдать или забрать роли в звонке пользователю
417
419
  *
@@ -645,15 +647,15 @@ export declare const debugLogs: {
645
647
  */
646
648
  list: typeof DebugStorage.list;
647
649
  /**
648
- * Возвращает логи конкретного звонка.
650
+ * Возвращает логи конкретного звонка вместе с глобальным контекстом SDK.
649
651
  */
650
652
  get: typeof DebugStorage.get;
651
653
  /**
652
- * Возвращает логи конкретного звонка JSON-строкой.
654
+ * Возвращает логи конкретного звонка вместе с глобальным контекстом SDK JSON-строкой.
653
655
  */
654
656
  getJson: typeof DebugStorage.getJson;
655
657
  /**
656
- * Скачивает логи конкретного звонка JSON-файлом.
658
+ * Скачивает логи конкретного звонка вместе с глобальным контекстом SDK JSON-файлом.
657
659
  */
658
660
  download: typeof DebugStorage.download;
659
661
  /**
@@ -742,16 +744,7 @@ export declare function acceptPromotion(reject?: boolean): Promise<void>;
742
744
  export declare function getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
743
745
  export declare function getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
744
746
  export declare function feedback(key: string): Promise<SignalingMessage>;
745
- export declare function userFeedbackStats(userResponse: number, reason?: string, groupCallUsersCount?: number): void;
746
- /**
747
- * Логирует клиентское событие статистики
748
- *
749
- * @param eventType Тип события
750
- * @param eventData Дополнительные данные события
751
- * @param immediatelty Отправить ли событие немедленно
752
- */
753
- export declare function logClientEvent(eventType: string, eventData?: Record<string, string | number | boolean>, immediately?: boolean): void;
754
- export declare function enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
747
+ export declare function enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[], conversationId?: string): Promise<void>;
755
748
  /**
756
749
  * Удаляет записи истории звонков
757
750
  *
@@ -775,6 +768,8 @@ export declare function stopUrlSharing(): Promise<void>;
775
768
  export declare function sendTestCommand(name: string, params?: any): void;
776
769
  export declare function startAnalyzingAudio(expectAudio: boolean, expectedActiveTracks?: number | null, expectedTrackFrequencies?: number[] | null): void;
777
770
  export declare function stopAnalyzingAudio(): void;
771
+ export declare function switchCall(conversationId: string): Promise<void>;
772
+ export declare function getActiveCallId(): string | null;
778
773
  /**
779
774
  * Возвращает текущее время, скорректированное на смещение относительно серверного времени.
780
775
  * Доступно после установки соединения (начало/присоединение к звонку).
@@ -785,5 +780,5 @@ export declare function getSyncedTime(): number;
785
780
  * Версия SDK
786
781
  */
787
782
  export declare function version(): string;
788
- export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, CustomError, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAPIBaseUrl, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, ParticipantStateData, ParticipantStateDataKey, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, ParticipantListMarker, RequestKeyFrame, Rooms, IGetParticipantsParameters, ScreenCaptureSettings, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IMovieMetaData, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IRoomId, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, IMuteParticipantParams, IMuteParticipantInternalParams, IStartStreamData, IStopStreamData, IPublishStreamData, VmojiError, FastStartHandler, FastStartParams, FastJoinHandler, FastJoinParams, FastJoinResponse, };
783
+ export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, CustomError, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, DisplayLayoutRequest, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAPIBaseUrl, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, ParticipantStateData, ParticipantStateDataKey, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, ParticipantListMarker, RequestKeyFrame, Rooms, IGetParticipantsParameters, ScreenCaptureSettings, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IMovieMetaData, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IRoomId, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, IMuteParticipantParams, IMuteParticipantInternalParams, IStartStreamData, IStopStreamData, IPublishStreamData, VmojiError, FastStartHandler, FastStartParams, FastJoinHandler, FastJoinParams, FastJoinResponse, };
789
784
  export { Api, AuthData, BaseLogger, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStateDataValue, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
@@ -5,6 +5,7 @@ import ConversationParams from '../types/ConversationParams';
5
5
  import ConversationResponse from '../types/ConversationResponse';
6
6
  import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
7
7
  import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
8
+ import PushData from '../types/PushData';
8
9
  export type ClientStats = {
9
10
  vcid: ConversationData['id'] | null;
10
11
  [k: string]: string | number | boolean | null;
@@ -68,14 +69,10 @@ export default abstract class BaseApi {
68
69
  * method: vchat.clientStats
69
70
  */
70
71
  logClientStats(items: ClientStats[]): void;
71
- /**
72
- * method: vchat.clientEvents
73
- */
74
- logClientEvents(items: ClientEvent[]): void;
75
72
  abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
76
- abstract getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
77
73
  getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
78
74
  getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
75
+ getCachedExternalIdByOkId(okId: OkUserId): ExternalParticipantId | null;
79
76
  cacheExternalId(compositeId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
80
77
  mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, okId: OkUserId | CompositeUserId): void;
81
78
  unmapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId): void;
@@ -85,4 +82,5 @@ export default abstract class BaseApi {
85
82
  removeHistoryRecords(recordIds: number[]): Promise<void>;
86
83
  getServerTime(): Promise<number>;
87
84
  cleanup(): void;
85
+ getInbounds(): Promise<PushData[]>;
88
86
  }
@@ -1,9 +1,10 @@
1
1
  import EventEmitter from '../classes/EventEmitter';
2
2
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
3
+ import { TCapabilities } from '../types/Capabilities';
3
4
  import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
4
5
  import { PerfStatReport } from '../types/PerfStatReporter';
5
6
  import { NetworkStatReport } from '../types/NetworkStatReport';
6
- import { TransportTopology } from '../classes/transport/Transport';
7
+ import TransportTopology from '../enums/TransportTopology';
7
8
  import ConversationFeature from '../enums/ConversationFeature';
8
9
  import ConversationOption from '../enums/ConversationOption';
9
10
  import MediaOption from '../enums/MediaOption';
@@ -61,14 +62,12 @@ export default abstract class BaseSignaling extends EventEmitter {
61
62
  abstract sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
62
63
  abstract changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
63
64
  abstract changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
64
- abstract hold(hold: boolean): Promise<SignalingMessage>;
65
+ abstract hold(hold: boolean, capabilities?: TCapabilities): Promise<SignalingMessage>;
65
66
  abstract putHandsDown(): Promise<SignalingMessage>;
66
67
  abstract addParticipant(externalIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
67
68
  abstract addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
68
69
  abstract removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
69
- abstract allocateConsumer(description: RTCSessionDescription | null, capabilities: {
70
- [key: string]: number | boolean | string;
71
- }): Promise<SignalingMessage>;
70
+ abstract allocateConsumer(description: RTCSessionDescription | null, capabilities: TCapabilities): Promise<SignalingMessage>;
72
71
  abstract acceptProducer(description: RTCSessionDescriptionInit, ssrcs: string[], sessionId: string): Promise<SignalingMessage>;
73
72
  /**
74
73
  * @deprecated Use updateDisplayLayout instead