@vkontakte/calls-sdk 2.8.6-dev.ef990bf5.0 → 2.8.6-dev.f0d660f5.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 (46) hide show
  1. package/CallsSDK.d.ts +28 -12
  2. package/abstract/BaseApi.d.ts +2 -1
  3. package/abstract/BaseSignaling.d.ts +5 -3
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/Conversation.d.ts +20 -10
  7. package/classes/Logger.d.ts +3 -0
  8. package/classes/MediaSource.d.ts +4 -0
  9. package/classes/SignalingActor.d.ts +9 -0
  10. package/classes/codec/IEncoder.d.ts +0 -1
  11. package/classes/screenshare/BaseStreamBuilder.d.ts +1 -1
  12. package/classes/stat/CodecStatsAggregator.d.ts +19 -0
  13. package/classes/stat/EventMetricsService.d.ts +9 -0
  14. package/classes/transport/Statistics.d.ts +23 -10
  15. package/default/Api.d.ts +2 -1
  16. package/default/Signaling.d.ts +20 -12
  17. package/enums/ChatRoomEventType.d.ts +1 -1
  18. package/enums/ConversationOption.d.ts +3 -3
  19. package/enums/RecordRole.d.ts +1 -1
  20. package/enums/SignalingTransportStat.d.ts +17 -0
  21. package/enums/Stat.d.ts +36 -21
  22. package/package.json +7 -3
  23. package/static/ApiTransport.d.ts +1 -1
  24. package/static/External.d.ts +2 -2
  25. package/static/Params.d.ts +48 -17
  26. package/static/SimulcastInfo.d.ts +1 -1
  27. package/static/Utils.d.ts +1 -1
  28. package/types/Conversation.d.ts +28 -1
  29. package/types/ConversationParams.d.ts +14 -1
  30. package/types/ConversationResponse.d.ts +9 -0
  31. package/types/ExternalId.d.ts +3 -0
  32. package/types/FastStart.d.ts +46 -0
  33. package/types/Participant.d.ts +9 -0
  34. package/types/PerfStatReporter.d.ts +1 -0
  35. package/types/SignalingMessage.d.ts +2 -1
  36. package/types/Statistics.d.ts +147 -0
  37. package/types/Streams.d.ts +1 -0
  38. package/types/WebTransport.d.ts +25 -0
  39. package/utils/LengthPrefixed.d.ts +48 -0
  40. package/utils/Lz4.d.ts +1 -0
  41. package/utils/MsgPackerBufferUtils.d.ts +1 -1
  42. package/utils/VariableLengthInteger.d.ts +18 -0
  43. package/worker/LibVPxDecoderWorker.d.ts +0 -1
  44. package/worker/LibVPxEncoderWorker.d.ts +0 -1
  45. package/worker/WebCodecsDecoderWorker.d.ts +0 -1
  46. package/worker/WebCodecsEncoderWorker.d.ts +0 -1
package/CallsSDK.d.ts CHANGED
@@ -48,7 +48,7 @@ import { IVideoDimentions, MediaSettings } from './types/MediaSettings';
48
48
  import { IAddMovieParams, IMovieMetaData, IMoviePreview, IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStateResponse, ISharedMovieStoppedInfo, IUpdateMovieData } from './types/MovieShare';
49
49
  import MuteStates, { IMuteParticipantInternalParams, IMuteParticipantParams } from './types/MuteStates';
50
50
  import { IAPIBaseUrl, IApiEnv } from './types/Params';
51
- import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantListMarker, ParticipantListMarkers, ParticipantListType, ParticipantsStateList, ParticipantStateMapped } from './types/Participant';
51
+ import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantListMarker, ParticipantListMarkers, ParticipantListType, ParticipantsStateList, ParticipantStateMapped, ParticipantStateData, ParticipantStateDataKey, ParticipantStateDataValue } from './types/Participant';
52
52
  import ParticipantLayout, { Layout, RequestKeyFrame, StopStream } from './types/ParticipantLayout';
53
53
  import { ParticipantListChunkParameters } from './types/ParticipantListChunk';
54
54
  import ParticipantPriority from './types/ParticipantPriority';
@@ -64,6 +64,7 @@ import { ApiExternal } from './default/ApiExternal';
64
64
  import AuthData from './static/AuthData';
65
65
  import { VmojiError } from './types/Vmoji';
66
66
  import { VolumeDetector } from './classes/VolumeDetector';
67
+ import { FastStartHandler, FastStartParams } from './types/FastStart';
67
68
  /**
68
69
  * Информация о текущем браузере
69
70
  */
@@ -233,9 +234,10 @@ export declare function init(params: Partial<ParamsObject>): Promise<void>;
233
234
  * @param joiningAllowed Создать токен комнаты для подключения по ссылке
234
235
  * @param requireAuthToJoin Запретить анонимам подключаться по ссылке (если поддерживается сервером)
235
236
  * @param onlyAdminCanShareMovie Только администратор может включать совметсный просмотр
237
+ * @param onFastStart Функция для обработки быстрого старта
236
238
  */
237
- export declare function callTo(externalId?: ExternalId | ExternalId[], mediaOptions?: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean): Promise<ConversationData>;
238
- export declare function callInternal(ids: OkUserId[], type: CallType | undefined, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean): Promise<ConversationData>;
239
+ export declare function callTo(externalId?: ExternalId | ExternalId[], mediaOptions?: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean, onFastStart?: FastStartHandler): Promise<ConversationData>;
240
+ export declare function callInternal(ids: OkUserId[], type: CallType | undefined, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean, externalIds?: ExternalId[], onFastStart?: FastStartHandler): Promise<ConversationData>;
239
241
  /**
240
242
  * Обработать пуш о входящем звонке
241
243
  *
@@ -245,9 +247,10 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
245
247
  * `acceptCall` и `declineCall` будут работать только после вызова `processPush`
246
248
  *
247
249
  * @param conversationId ID звонка
250
+ * @param conversationParams conversationParams в base64
248
251
  */
249
- export declare function processPush(conversationId: string): Promise<void>;
250
- export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
252
+ export declare function processPush(conversationId: string, conversationParams?: string): Promise<void>;
253
+ export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
251
254
  /**
252
255
  * Авторизоваться для совершения звонков
253
256
  *
@@ -294,6 +297,11 @@ export declare function hangup(): Promise<void>;
294
297
  * @param params Параметры
295
298
  */
296
299
  export declare function addParticipant(externalIds: ExternalId | ExternalId[], params?: AddParticipantParams): Promise<void>;
300
+ /**
301
+ * @deprecated - используйте addParticipant
302
+ * @param uids
303
+ * @param params
304
+ */
297
305
  export declare function addParticipantInternal(uids: OkUserId[], params?: AddParticipantParams): Promise<void>;
298
306
  /**
299
307
  * Удалить собеседника из звонка
@@ -302,6 +310,11 @@ export declare function addParticipantInternal(uids: OkUserId[], params?: AddPar
302
310
  * @param ban Забанить пользователя
303
311
  */
304
312
  export declare function removeParticipant(externalId: ExternalId, ban?: boolean): Promise<void>;
313
+ /**
314
+ * @deprecated - используйте removeParticipant
315
+ * @param uid
316
+ * @param ban
317
+ */
305
318
  export declare function removeParticipantInternal(uid: OkUserId, ban?: boolean): Promise<void>;
306
319
  /**
307
320
  * Изменить камеру на фронтальную или заднюю (для мобильных устройств)
@@ -376,7 +389,7 @@ export declare function changePriorities(priorities: ParticipantPriority[]): Pro
376
389
  * @param state Список состояний в виде ключ-значение. Максимальная длина ключей и значений - 5 символов. Пустые значения будут пропущены
377
390
  * @param externalId Внешний ID пользователя
378
391
  */
379
- export declare function changeParticipantState(state: Record<string, string>, externalId?: ExternalId): Promise<void>;
392
+ export declare function changeParticipantState(state: ParticipantStateData, externalId?: ExternalId): Promise<void>;
380
393
  /**
381
394
  * Принудительно опустить руки участников в текущем сессионном зале админа
382
395
  */
@@ -400,8 +413,8 @@ export declare function grantRolesInternal(uid: OkUserId, deviceIdx: number, rol
400
413
  /**
401
414
  * Выключить или выключить микрофон и/или камеру собеседнику (только если есть соответствующая роль)
402
415
  */
403
- export declare function muteParticipant({ externalId, muteStates, requestedMedia, roomId, }: IMuteParticipantParams): Promise<void>;
404
- export declare function muteParticipantInternal({ uid, muteStates, requestedMedia, deviceIdx, roomId, }: IMuteParticipantInternalParams): Promise<void>;
416
+ export declare function muteParticipant({ externalId, muteStates, requestedMedia, roomId }: IMuteParticipantParams): Promise<void>;
417
+ export declare function muteParticipantInternal({ uid, muteStates, requestedMedia, deviceIdx, roomId }: IMuteParticipantInternalParams): Promise<void>;
405
418
  /**
406
419
  * Закрепить/открепить выбранного собеседника у всех (только если есть соответствующая роль)
407
420
  *
@@ -481,7 +494,7 @@ export declare function startConversation(payload?: string, requireAuthToJoin?:
481
494
  * @param speakerIds Список внешних ID пользователей, которые будут выступать в роли спикеров
482
495
  * @returns Токен комнаты
483
496
  */
484
- export declare function startAudienceConversation(payload: string | undefined, requireAuthToJoin: boolean | undefined, { onlyAdminCanShareMovie, audioOnly, }: {
497
+ export declare function startAudienceConversation(payload: string | undefined, requireAuthToJoin: boolean | undefined, { onlyAdminCanShareMovie, audioOnly }: {
485
498
  onlyAdminCanShareMovie?: boolean | undefined;
486
499
  audioOnly?: boolean | undefined;
487
500
  } | undefined, speakerIds: ExternalUserId[]): Promise<string>;
@@ -526,8 +539,9 @@ export declare function startStream(isRecord?: boolean, name?: string | null, mo
526
539
  /**
527
540
  * Завершить трансляцию звонка
528
541
  * @param roomId
542
+ * @param remove не сохранять запись звонка
529
543
  */
530
- export declare function stopStream(roomId?: number | null): Promise<undefined>;
544
+ export declare function stopStream(roomId?: number | null, remove?: boolean): Promise<undefined>;
531
545
  /**
532
546
  * Опубликовать трансляцию звонка
533
547
  * @param roomId
@@ -721,9 +735,11 @@ export declare function requestAsr(request: boolean): Promise<void>;
721
735
  export declare function startUrlSharing(sharedUrl: string): Promise<void>;
722
736
  export declare function stopUrlSharing(): Promise<void>;
723
737
  export declare function sendTestCommand(name: string, params?: any): void;
738
+ export declare function startAnalyzingAudio(expectAudio: boolean): void;
739
+ export declare function stopAnalyzingAudio(): void;
724
740
  /**
725
741
  * Версия SDK
726
742
  */
727
743
  export declare function version(): string;
728
- 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, 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, };
729
- export { Api, AuthData, BaseLogger, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
744
+ 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, };
745
+ 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, };
@@ -30,6 +30,7 @@ export type LogItem = {
30
30
  export default abstract class BaseApi {
31
31
  abstract authorize(): Promise<void>;
32
32
  abstract userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
33
+ abstract deviceId(): string;
33
34
  abstract createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, createConversationParameters?: {
34
35
  onlyAdminCanShareMovie?: boolean;
35
36
  audienceMode?: boolean;
@@ -37,7 +38,7 @@ export default abstract class BaseApi {
37
38
  }, speakerIds?: OkUserId[]): Promise<ConversationResponse>;
38
39
  abstract startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, createConversationParameters?: {
39
40
  onlyAdminCanShareMovie?: boolean;
40
- }): Promise<ConversationResponse>;
41
+ }, externalIds?: ExternalId[]): Promise<ConversationResponse>;
41
42
  abstract joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
42
43
  createJoinLink(conversationId: string): Promise<{
43
44
  join_link: string;
@@ -16,7 +16,7 @@ import MediaModifiers from '../types/MediaModifiers';
16
16
  import MediaSettings from '../types/MediaSettings';
17
17
  import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
18
18
  import MuteStates from '../types/MuteStates';
19
- import { CompositeUserId, ParticipantId } from '../types/Participant';
19
+ import { CompositeUserId, ParticipantId, ParticipantStateData } from '../types/Participant';
20
20
  import { ParticipantLayout, RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
21
21
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
22
22
  import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
@@ -54,9 +54,10 @@ export default abstract class BaseSignaling extends EventEmitter {
54
54
  abstract sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
55
55
  abstract sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
56
56
  abstract changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
57
- abstract changeParticipantState(state: Record<string, string>, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
57
+ abstract changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
58
58
  abstract putHandsDown(): Promise<SignalingMessage>;
59
- abstract addParticipant(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
59
+ abstract addParticipant(externalIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
60
+ abstract addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
60
61
  abstract removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
61
62
  abstract allocateConsumer(description: RTCSessionDescription | null, capabilities: {
62
63
  [key: string]: number | boolean | string;
@@ -123,6 +124,7 @@ export default abstract class BaseSignaling extends EventEmitter {
123
124
  setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
124
125
  requestRealloc(): void;
125
126
  setEndpoint(endpoint: string): void;
127
+ setWebTransportEndpoint(endpoint: string | null): void;
126
128
  setConversationId(conversationId: string): void;
127
129
  readyToSend(isReady?: boolean): void;
128
130
  cleanup(): void;