@vkontakte/calls-sdk 2.8.11-dev.89ba1e7f.0 → 2.8.11-dev.af7eda54.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
@@ -30,6 +30,7 @@ import SignalingNotification from './enums/SignalingNotification';
30
30
  import UserRole from './enums/UserRole';
31
31
  import UserType from './enums/UserType';
32
32
  import { DebugMessageType } from './static/Debug';
33
+ import * as DebugStorage from './utils/DebugStorage';
33
34
  import { ParticipantStatus } from './static/External';
34
35
  import { JSONArray, JSONObject, JSONType } from './static/Json';
35
36
  import { ParamsObject } from './static/Params';
@@ -66,6 +67,7 @@ import { VmojiError } from './types/Vmoji';
66
67
  import { VolumeDetector } from './classes/VolumeDetector';
67
68
  import { FastStartHandler, FastStartParams } from './types/FastStart';
68
69
  import { FastJoinHandler, FastJoinParams, FastJoinResponse } from './types/FastJoin';
70
+ export type { CurrentLogItem, DebugLogGetParams, DebugLogSessionInfo, DebugLogStorageStats } from './utils/DebugStorage';
69
71
  /**
70
72
  * Информация о текущем браузере
71
73
  */
@@ -265,11 +267,11 @@ export declare function authorize(authToken?: string, apiBaseUrl?: IAPIBaseUrl):
265
267
  *
266
268
  * @param mediaOptions Нужно ли включать камеру и микрофон
267
269
  */
268
- export declare function acceptCall(mediaOptions?: MediaOption[], conversationId?: string): Promise<ConversationData>;
270
+ export declare function acceptCall(mediaOptions?: MediaOption[]): Promise<ConversationData>;
269
271
  /**
270
272
  * Отклонить входящий звонок
271
273
  */
272
- export declare function declineCall(conversationId?: string): Promise<void>;
274
+ export declare function declineCall(): Promise<void>;
273
275
  /**
274
276
  * Присоединиться к активному звонку
275
277
  *
@@ -292,7 +294,7 @@ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOpt
292
294
  /**
293
295
  * Завершить текущий разговор
294
296
  */
295
- export declare function hangup(conversationId?: string): Promise<void>;
297
+ export declare function hangup(): Promise<void>;
296
298
  /**
297
299
  * Добавить собеседника в звонок
298
300
  *
@@ -340,7 +342,7 @@ export declare function changeDevice(kind: MediaDeviceKind, deviceId: string): P
340
342
  * state Включить или выключить захват экрана
341
343
  * settings Параметры захваты экрана
342
344
  */
343
- export declare function captureScreen(stateOrSettings: boolean | ScreenCaptureSettings, conversationId?: string): Promise<void>;
345
+ export declare function captureScreen(stateOrSettings: boolean | ScreenCaptureSettings): Promise<void>;
344
346
  /**
345
347
  * Включить/выключить передачу точек вимоджи
346
348
  *
@@ -361,13 +363,13 @@ export declare function setVideoStream(stream: MediaStream, isScreen?: boolean):
361
363
  *
362
364
  * @param enabled
363
365
  */
364
- export declare function toggleLocalVideo(enabled: boolean, conversationId?: string): Promise<void>;
366
+ export declare function toggleLocalVideo(enabled: boolean): Promise<void>;
365
367
  /**
366
368
  * Включить или выключить свой микрофон
367
369
  *
368
370
  * @param enabled
369
371
  */
370
- export declare function toggleLocalAudio(enabled: boolean, conversationId?: string): Promise<void>;
372
+ export declare function toggleLocalAudio(enabled: boolean): Promise<void>;
371
373
  /**
372
374
  * Изменяет размеры локального видео
373
375
  *
@@ -393,6 +395,12 @@ export declare function changePriorities(priorities: ParticipantPriority[]): Pro
393
395
  * @param externalId Внешний ID пользователя
394
396
  */
395
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>;
396
404
  /**
397
405
  * Принудительно опустить руки участников в текущем сессионном зале админа
398
406
  */
@@ -555,16 +563,6 @@ export declare function stopStream(roomId?: number | null, remove?: boolean): Pr
555
563
  * @param roomId
556
564
  */
557
565
  export declare function publishStream(roomId?: number | null): Promise<undefined>;
558
- /**
559
- * Устанавливает роль участника в запись звонка
560
- * Если хотя бы у одного участника звонка выставлена роль, то в записи звонка будут
561
- * видны только те участники, у кого есть роль.
562
- * @param king участник показывается крупно в записи звонка (только один участник имеет такую роль)
563
- * @param pawns участник показывается в записи звонка
564
- * @param hideParticipantCount скрыть/показать количество невидимых участников
565
- * @param roomId комната
566
- */
567
- export declare function recordSetConf(king?: ExternalId, pawns?: ExternalId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
568
566
  /**
569
567
  * Получить информацию о трансляции звонка
570
568
  */
@@ -635,6 +633,38 @@ export declare function debug(enabled: boolean): void;
635
633
  * @param args
636
634
  */
637
635
  export declare function debugMessage(type: DebugMessageType, ...args: any[]): void;
636
+ /**
637
+ * Локальные отладочные логи, сохраненные в браузере.
638
+ *
639
+ * Работает при включенном параметре `debugLog: true`.
640
+ * Логи хранятся в IndexedDB: последние 10 звонков, максимум 25 МБ суммарно.
641
+ */
642
+ export declare const debugLogs: {
643
+ /**
644
+ * Возвращает список сохраненных локальных сессий логирования.
645
+ */
646
+ list: typeof DebugStorage.list;
647
+ /**
648
+ * Возвращает логи конкретного звонка.
649
+ */
650
+ get: typeof DebugStorage.get;
651
+ /**
652
+ * Возвращает логи конкретного звонка JSON-строкой.
653
+ */
654
+ getJson: typeof DebugStorage.getJson;
655
+ /**
656
+ * Скачивает логи конкретного звонка JSON-файлом.
657
+ */
658
+ download: typeof DebugStorage.download;
659
+ /**
660
+ * Очищает логи конкретного звонка или все локальные логи SDK.
661
+ */
662
+ clear: typeof DebugStorage.clear;
663
+ /**
664
+ * Возвращает статистику локального хранилища логов.
665
+ */
666
+ stats: typeof DebugStorage.stats;
667
+ };
638
668
  /**
639
669
  * Отправляет клиенские логи по conversationId на сервер OK
640
670
  * @example можно посмотреть в examples/anonym/index.html
@@ -745,8 +775,6 @@ export declare function stopUrlSharing(): Promise<void>;
745
775
  export declare function sendTestCommand(name: string, params?: any): void;
746
776
  export declare function startAnalyzingAudio(expectAudio: boolean, expectedActiveTracks?: number | null, expectedTrackFrequencies?: number[] | null): void;
747
777
  export declare function stopAnalyzingAudio(): void;
748
- export declare function switchCall(conversationId: string): Promise<void>;
749
- export declare function getActiveCallId(): string | null;
750
778
  /**
751
779
  * Возвращает текущее время, скорректированное на смещение относительно серверного времени.
752
780
  * Доступно после установки соединения (начало/присоединение к звонку).
@@ -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,6 +1,5 @@
1
1
  import EventEmitter from '../classes/EventEmitter';
2
2
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
3
- import { TCapabilities } from '../types/Capabilities';
4
3
  import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
5
4
  import { PerfStatReport } from '../types/PerfStatReporter';
6
5
  import { NetworkStatReport } from '../types/NetworkStatReport';
@@ -22,7 +21,7 @@ import { ParticipantLayout, RequestKeyFrame, StopStream } from '../types/Partici
22
21
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
23
22
  import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
24
23
  import { ChangeSimulcast } from '../types/ChangeSimulcast';
25
- import { IPublishStreamData, IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
24
+ import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
26
25
  import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
27
26
  /**
28
27
  * Параметры добавления пользователя в звонок
@@ -62,12 +61,14 @@ export default abstract class BaseSignaling extends EventEmitter {
62
61
  abstract sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
63
62
  abstract changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
64
63
  abstract changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
65
- abstract hold(hold: boolean, capabilities?: TCapabilities): Promise<SignalingMessage>;
64
+ abstract hold(hold: boolean): Promise<SignalingMessage>;
66
65
  abstract putHandsDown(): Promise<SignalingMessage>;
67
66
  abstract addParticipant(externalIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
68
67
  abstract addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
69
68
  abstract removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
70
- abstract allocateConsumer(description: RTCSessionDescription | null, capabilities: TCapabilities): Promise<SignalingMessage>;
69
+ abstract allocateConsumer(description: RTCSessionDescription | null, capabilities: {
70
+ [key: string]: number | boolean | string;
71
+ }): Promise<SignalingMessage>;
71
72
  abstract acceptProducer(description: RTCSessionDescriptionInit, ssrcs: string[], sessionId: string): Promise<SignalingMessage>;
72
73
  /**
73
74
  * @deprecated Use updateDisplayLayout instead
@@ -91,7 +92,6 @@ export default abstract class BaseSignaling extends EventEmitter {
91
92
  abstract startStream(data: IStartStreamData): Promise<SignalingMessage>;
92
93
  abstract stopStream(data: IStopStreamData): Promise<SignalingMessage>;
93
94
  abstract publishStream(data: IPublishStreamData): Promise<SignalingMessage>;
94
- abstract recordSetConf(conf: IRecordConfData): Promise<SignalingMessage>;
95
95
  abstract getRecordStatus(): Promise<SignalingMessage>;
96
96
  abstract switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
97
97
  abstract reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;