@vkontakte/calls-sdk 2.8.11-dev.3de63af6.0 → 2.8.11-dev.41bc9113.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/CallsSDK.d.ts CHANGED
@@ -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';
@@ -267,11 +267,11 @@ export declare function authorize(authToken?: string, apiBaseUrl?: IAPIBaseUrl):
267
267
  *
268
268
  * @param mediaOptions Нужно ли включать камеру и микрофон
269
269
  */
270
- export declare function acceptCall(mediaOptions?: MediaOption[]): Promise<ConversationData>;
270
+ export declare function acceptCall(mediaOptions?: MediaOption[], conversationId?: string): Promise<ConversationData>;
271
271
  /**
272
272
  * Отклонить входящий звонок
273
273
  */
274
- export declare function declineCall(): Promise<void>;
274
+ export declare function declineCall(conversationId?: string): Promise<void>;
275
275
  /**
276
276
  * Присоединиться к активному звонку
277
277
  *
@@ -294,7 +294,7 @@ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOpt
294
294
  /**
295
295
  * Завершить текущий разговор
296
296
  */
297
- export declare function hangup(): Promise<void>;
297
+ export declare function hangup(conversationId?: string): Promise<void>;
298
298
  /**
299
299
  * Добавить собеседника в звонок
300
300
  *
@@ -342,7 +342,7 @@ export declare function changeDevice(kind: MediaDeviceKind, deviceId: string): P
342
342
  * state Включить или выключить захват экрана
343
343
  * settings Параметры захваты экрана
344
344
  */
345
- export declare function captureScreen(stateOrSettings: boolean | ScreenCaptureSettings): Promise<void>;
345
+ export declare function captureScreen(stateOrSettings: boolean | ScreenCaptureSettings, conversationId?: string): Promise<void>;
346
346
  /**
347
347
  * Включить/выключить передачу точек вимоджи
348
348
  *
@@ -363,13 +363,13 @@ export declare function setVideoStream(stream: MediaStream, isScreen?: boolean):
363
363
  *
364
364
  * @param enabled
365
365
  */
366
- export declare function toggleLocalVideo(enabled: boolean): Promise<void>;
366
+ export declare function toggleLocalVideo(enabled: boolean, conversationId?: string): Promise<void>;
367
367
  /**
368
368
  * Включить или выключить свой микрофон
369
369
  *
370
370
  * @param enabled
371
371
  */
372
- export declare function toggleLocalAudio(enabled: boolean): Promise<void>;
372
+ export declare function toggleLocalAudio(enabled: boolean, conversationId?: string): Promise<void>;
373
373
  /**
374
374
  * Изменяет размеры локального видео
375
375
  *
@@ -395,12 +395,6 @@ export declare function changePriorities(priorities: ParticipantPriority[]): Pro
395
395
  * @param externalId Внешний ID пользователя
396
396
  */
397
397
  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
398
  /**
405
399
  * Принудительно опустить руки участников в текущем сессионном зале админа
406
400
  */
@@ -412,6 +406,12 @@ export declare function putHandsDown(): Promise<void>;
412
406
  * @param layout Список приоритетов
413
407
  */
414
408
  export declare function updateDisplayLayout(layout: ParticipantLayout[]): Promise<void>;
409
+ /**
410
+ * Запрашивает стримы, которые клиент хочет получать для отображения.
411
+ *
412
+ * @param requests Полный список стримов, которые должны приходить на клиент
413
+ */
414
+ export declare function requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
415
415
  /**
416
416
  * Выдать или забрать роли в звонке пользователю
417
417
  *
@@ -563,16 +563,6 @@ export declare function stopStream(roomId?: number | null, remove?: boolean): Pr
563
563
  * @param roomId
564
564
  */
565
565
  export declare function publishStream(roomId?: number | null): Promise<undefined>;
566
- /**
567
- * Устанавливает роль участника в запись звонка
568
- * Если хотя бы у одного участника звонка выставлена роль, то в записи звонка будут
569
- * видны только те участники, у кого есть роль.
570
- * @param king участник показывается крупно в записи звонка (только один участник имеет такую роль)
571
- * @param pawns участник показывается в записи звонка
572
- * @param hideParticipantCount скрыть/показать количество невидимых участников
573
- * @param roomId комната
574
- */
575
- export declare function recordSetConf(king?: ExternalId, pawns?: ExternalId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
576
566
  /**
577
567
  * Получить информацию о трансляции звонка
578
568
  */
@@ -761,7 +751,7 @@ export declare function userFeedbackStats(userResponse: number, reason?: string,
761
751
  * @param immediatelty Отправить ли событие немедленно
762
752
  */
763
753
  export declare function logClientEvent(eventType: string, eventData?: Record<string, string | number | boolean>, immediately?: boolean): void;
764
- export declare function enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
754
+ export declare function enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[], conversationId?: string): Promise<void>;
765
755
  /**
766
756
  * Удаляет записи истории звонков
767
757
  *
@@ -785,6 +775,8 @@ export declare function stopUrlSharing(): Promise<void>;
785
775
  export declare function sendTestCommand(name: string, params?: any): void;
786
776
  export declare function startAnalyzingAudio(expectAudio: boolean, expectedActiveTracks?: number | null, expectedTrackFrequencies?: number[] | null): void;
787
777
  export declare function stopAnalyzingAudio(): void;
778
+ export declare function switchCall(conversationId: string): Promise<void>;
779
+ export declare function getActiveCallId(): string | null;
788
780
  /**
789
781
  * Возвращает текущее время, скорректированное на смещение относительно серверного времени.
790
782
  * Доступно после установки соединения (начало/присоединение к звонку).
@@ -795,5 +787,5 @@ export declare function getSyncedTime(): number;
795
787
  * Версия SDK
796
788
  */
797
789
  export declare function version(): string;
798
- 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, };
790
+ 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, };
799
791
  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, };
@@ -44,7 +44,7 @@ export default abstract class BaseApi {
44
44
  audioOnly?: boolean;
45
45
  waitForAdmin?: boolean;
46
46
  closedConversation?: boolean;
47
- }, speakerIds?: OkUserId[]): Promise<ConversationResponse>;
47
+ }, speakerIds?: ExternalId[]): Promise<ConversationResponse>;
48
48
  abstract startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, createConversationParameters?: {
49
49
  onlyAdminCanShareMovie?: boolean;
50
50
  }, externalIds?: ExternalId[]): Promise<ConversationResponse>;
@@ -73,10 +73,9 @@ export default abstract class BaseApi {
73
73
  */
74
74
  logClientEvents(items: ClientEvent[]): void;
75
75
  abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
76
- abstract getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
77
- abstract getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
78
76
  abstract getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
79
77
  getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
78
+ getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
80
79
  cacheExternalId(compositeId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
81
80
  mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, okId: OkUserId | CompositeUserId): void;
82
81
  unmapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId): void;
@@ -1,5 +1,6 @@
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';
@@ -21,7 +22,7 @@ import { ParticipantLayout, RequestKeyFrame, StopStream } from '../types/Partici
21
22
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
22
23
  import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
23
24
  import { ChangeSimulcast } from '../types/ChangeSimulcast';
24
- import { IPublishStreamData, IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
25
+ import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
25
26
  import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
26
27
  /**
27
28
  * Параметры добавления пользователя в звонок
@@ -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
@@ -92,7 +91,6 @@ export default abstract class BaseSignaling extends EventEmitter {
92
91
  abstract startStream(data: IStartStreamData): Promise<SignalingMessage>;
93
92
  abstract stopStream(data: IStopStreamData): Promise<SignalingMessage>;
94
93
  abstract publishStream(data: IPublishStreamData): Promise<SignalingMessage>;
95
- abstract recordSetConf(conf: IRecordConfData): Promise<SignalingMessage>;
96
94
  abstract getRecordStatus(): Promise<SignalingMessage>;
97
95
  abstract switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
98
96
  abstract reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;