@vkontakte/calls-sdk 2.8.13-dev.f163e503.0 → 2.8.13-dev.f9dea6d5.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 +38 -13
- package/abstract/BaseApi.d.ts +12 -8
- package/calls-sdk.cjs.js +7 -7
- package/calls-sdk.esm.js +4231 -3033
- package/classes/AudioFix.d.ts +2 -2
- package/classes/AudioOutput.d.ts +3 -3
- package/classes/CallRegistry.d.ts +17 -4
- package/classes/MediaSource.d.ts +8 -2
- package/classes/SpecListener.d.ts +2 -2
- package/classes/VolumesDetector.d.ts +0 -1
- package/classes/codec/LibVPxDecoder.d.ts +2 -2
- package/classes/codec/LibVPxEncoder.d.ts +2 -2
- package/classes/codec/WebCodecsDecoder.d.ts +2 -2
- package/classes/codec/WebCodecsEncoder.d.ts +2 -2
- package/classes/codec/WorkerBase.d.ts +3 -3
- package/classes/conversation/Conversation.d.ts +18 -6
- package/classes/conversation/Conversation.testUtils.d.ts +1 -0
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
- package/classes/screenshare/ScreenCaptureSender.d.ts +2 -2
- package/classes/screenshare/StreamBuilder.d.ts +2 -2
- package/classes/stat/ApiCallStats.d.ts +12 -0
- package/classes/stat/CallLifecycleStats.d.ts +2 -2
- package/classes/stat/CodecStatsAggregator.d.ts +2 -2
- package/classes/stat/ConversationStats.d.ts +15 -2
- package/classes/stat/NetworkAdaptationStats.d.ts +35 -0
- package/classes/stat/PeerConnectionStats.d.ts +22 -0
- package/classes/stat/Stat.testUtils.d.ts +10 -0
- package/classes/stat/StatAggregator.d.ts +10 -3
- package/classes/stat/StatClock.d.ts +28 -0
- package/classes/stat/StatDrainScheduler.d.ts +92 -0
- package/classes/stat/StatEventCollector.d.ts +50 -0
- package/classes/stat/StatPings.d.ts +4 -2
- package/classes/stat/StatQueue.d.ts +79 -0
- package/classes/stat/StatSignalingCommands.d.ts +2 -2
- package/classes/stat/StatUnloadJournal.d.ts +27 -0
- package/classes/transport/DirectTransport.d.ts +12 -2
- package/classes/transport/PerfStatReporter.d.ts +6 -1
- package/classes/transport/ServerTransport.d.ts +5 -2
- package/classes/transport/SimulcastSender.d.ts +2 -2
- package/classes/transport/Transport.d.ts +2 -2
- package/default/Api.d.ts +13 -1
- package/default/Signaling.d.ts +11 -3
- package/default/SignalingTransport.d.ts +5 -1
- package/enums/SessionError.d.ts +10 -0
- package/enums/Stat.d.ts +14 -1
- package/package.json +1 -1
- package/static/ApiTransport.d.ts +4 -0
- package/static/AuthData.d.ts +11 -1
- package/static/BrowserEnvironment.d.ts +90 -0
- package/static/External.d.ts +11 -0
- package/static/Params.d.ts +59 -2
- package/static/SessionStore.d.ts +29 -0
- package/static/SimulcastInfo.d.ts +1 -0
- package/static/WebRTCUtils.d.ts +5 -76
- package/types/ClientStatsEvent.d.ts +12 -0
- package/types/FastHangup.d.ts +7 -5
- package/types/IEventualStatLog.d.ts +1 -1
- package/types/Params.d.ts +1 -1
- package/types/PerfStatReporter.d.ts +17 -0
- package/types/SignalingMessage.d.ts +1 -0
- package/types/Statistics.d.ts +17 -0
package/CallsSDK.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import RoomsEventType from './enums/RoomsEventType';
|
|
|
28
28
|
import SignalingCommandType from './enums/SignalingCommandType';
|
|
29
29
|
import SignalingConnectionType from './enums/SignalingConnectionType';
|
|
30
30
|
import SignalingNotification from './enums/SignalingNotification';
|
|
31
|
+
import Stat from './enums/Stat';
|
|
31
32
|
import UserRole from './enums/UserRole';
|
|
32
33
|
import UserType from './enums/UserType';
|
|
33
34
|
import { DebugMessageType } from './static/Debug';
|
|
@@ -36,7 +37,8 @@ import { ParticipantStatus } from './static/External';
|
|
|
36
37
|
import { JSONArray, JSONObject, JSONType } from './static/Json';
|
|
37
38
|
import { ParamsObject } from './static/Params';
|
|
38
39
|
import Utils from './static/Utils';
|
|
39
|
-
import
|
|
40
|
+
import BrowserEnvironment, { BrowserName } from './static/BrowserEnvironment';
|
|
41
|
+
import WebRTCUtils, { FacingMode } from './static/WebRTCUtils';
|
|
40
42
|
import { IAsrData, IAsrStartParams, IAsrStopParams } from './types/Asr';
|
|
41
43
|
import { ConversationData } from './types/Conversation';
|
|
42
44
|
import { IFeaturesPerRole } from './types/ConversationFeature';
|
|
@@ -59,6 +61,7 @@ import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from './type
|
|
|
59
61
|
import { ScreenCaptureSettings } from './types/ScreenCaptureSettings';
|
|
60
62
|
import SignalingMessage, { GetRoomsSignalingResponse, GetParticipantsSignalingResponse } from './types/SignalingMessage';
|
|
61
63
|
import { StatResult } from './types/Statistics';
|
|
64
|
+
import { ClientStatsEvent } from './types/ClientStatsEvent';
|
|
62
65
|
import { IStartStreamData, IStopStreamData, IPublishStreamData } from './types/Streams';
|
|
63
66
|
import { WaitingHallResponse } from './types/WaitingHall';
|
|
64
67
|
import { ArrayDequeue } from './utils/ArrayDequeue';
|
|
@@ -144,43 +147,57 @@ export declare const browser: {
|
|
|
144
147
|
*
|
|
145
148
|
* _Метод доступен до инициализации_
|
|
146
149
|
*/
|
|
147
|
-
isBrowserSupported: typeof
|
|
150
|
+
isBrowserSupported: typeof BrowserEnvironment.isBrowserSupported;
|
|
148
151
|
/**
|
|
149
152
|
* Проверяет поддержку трансляции экрана браузером
|
|
150
153
|
*
|
|
151
154
|
* _Метод доступен до инициализации_
|
|
152
155
|
*/
|
|
153
|
-
isScreenCapturingSupported: typeof
|
|
156
|
+
isScreenCapturingSupported: typeof BrowserEnvironment.isScreenCapturingSupported;
|
|
157
|
+
/**
|
|
158
|
+
* Проверяет поддержку выбора микрофона браузером, независимо от списка устройств и разрешений.
|
|
159
|
+
* Не запрашивает разрешения и не захватывает медиа.
|
|
160
|
+
*
|
|
161
|
+
* _Метод доступен до инициализации_
|
|
162
|
+
*/
|
|
163
|
+
canSelectAudioInput: typeof BrowserEnvironment.canSelectAudioInput;
|
|
164
|
+
/**
|
|
165
|
+
* Проверяет поддержку выбора аудиовыхода браузером, независимо от списка устройств и разрешений.
|
|
166
|
+
* Не запрашивает разрешения и не меняет аудиовыход.
|
|
167
|
+
*
|
|
168
|
+
* _Метод доступен до инициализации_
|
|
169
|
+
*/
|
|
170
|
+
canSelectAudioOutput: typeof BrowserEnvironment.canSelectAudioOutput;
|
|
154
171
|
/**
|
|
155
172
|
* Имя операционной системы
|
|
156
173
|
*
|
|
157
174
|
* _Метод доступен до инициализации_
|
|
158
175
|
*/
|
|
159
|
-
os: typeof
|
|
176
|
+
os: typeof BrowserEnvironment.os;
|
|
160
177
|
/**
|
|
161
178
|
* Мобильный браузер или нет
|
|
162
179
|
*
|
|
163
180
|
* _Метод доступен до инициализации_
|
|
164
181
|
*/
|
|
165
|
-
isMobile: typeof
|
|
182
|
+
isMobile: typeof BrowserEnvironment.isMobile;
|
|
166
183
|
/**
|
|
167
184
|
* Имя браузера
|
|
168
185
|
*
|
|
169
186
|
* _Метод доступен до инициализации_
|
|
170
187
|
*/
|
|
171
|
-
browserName: typeof
|
|
188
|
+
browserName: typeof BrowserEnvironment.browserName;
|
|
172
189
|
/**
|
|
173
190
|
* Версия браузера
|
|
174
191
|
*
|
|
175
192
|
* _Метод доступен до инициализации_
|
|
176
193
|
*/
|
|
177
|
-
browserVersion: typeof
|
|
194
|
+
browserVersion: typeof BrowserEnvironment.browserVersion;
|
|
178
195
|
/**
|
|
179
196
|
* Если браузер основан на хроме - возвращает версию
|
|
180
197
|
*
|
|
181
198
|
* _Метод доступен до инициализации_
|
|
182
199
|
*/
|
|
183
|
-
baseChromeVersion: typeof
|
|
200
|
+
baseChromeVersion: typeof BrowserEnvironment.baseChromeVersion;
|
|
184
201
|
/**
|
|
185
202
|
* Возвращает AudioContext
|
|
186
203
|
*/
|
|
@@ -190,7 +207,7 @@ export declare const browser: {
|
|
|
190
207
|
*
|
|
191
208
|
* _Метод доступен до инициализации_
|
|
192
209
|
*/
|
|
193
|
-
isAudioShareSupported: typeof
|
|
210
|
+
isAudioShareSupported: typeof BrowserEnvironment.isAudioShareSupported;
|
|
194
211
|
};
|
|
195
212
|
/**
|
|
196
213
|
* Вспомогательные функции
|
|
@@ -258,7 +275,7 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
|
|
|
258
275
|
* Для любого входящего пуша нужно вызвать этот метод.
|
|
259
276
|
* Если уже есть активный звонок, метод отправит "занято" вызывающему абоненту
|
|
260
277
|
*
|
|
261
|
-
* `acceptCall` и `declineCall`
|
|
278
|
+
* Перед `acceptCall` и `declineCall` необходимо дождаться успешного завершения `processPush`.
|
|
262
279
|
*
|
|
263
280
|
* @param conversationId ID звонка
|
|
264
281
|
* @param conversationParams conversationParams в base64
|
|
@@ -266,6 +283,11 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
|
|
|
266
283
|
export declare function processPush(conversationId: string, conversationParams?: string): Promise<void>;
|
|
267
284
|
export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
|
|
268
285
|
export declare function getInbounds(): Promise<PushData[]>;
|
|
286
|
+
/**
|
|
287
|
+
* Запускает отправку клиентской статистики. Нужен только при
|
|
288
|
+
* `autoStartStats: false`; повторные вызовы ничего не делают.
|
|
289
|
+
*/
|
|
290
|
+
export declare function startStats(): void;
|
|
269
291
|
/**
|
|
270
292
|
* Авторизоваться для совершения звонков
|
|
271
293
|
*
|
|
@@ -316,7 +338,10 @@ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOpt
|
|
|
316
338
|
* для проброса в сигналинг: по умолчанию `HUNGUP` (если звонок активен) или `CANCELED`.
|
|
317
339
|
* См. {@link ClientHangupReason}.
|
|
318
340
|
* `params.onFastHangup` — опционально: вместо Calls API hangup, если обработчик передан.
|
|
319
|
-
* Без него API
|
|
341
|
+
* Без него отправляется Calls API beacon, если серверный ID уже известен. На `pagehide` всегда beacon.
|
|
342
|
+
* Локальное завершение и постановка onHangup в очередь происходят сразу; Promise ждёт известную SDK работу по завершению
|
|
343
|
+
* в пределах waitResponseDelay, без подтверждения доставки beacon или signaling HANGUP.
|
|
344
|
+
* Повторный вызов для того же завершающегося звонка возвращает тот же Promise.
|
|
320
345
|
* См. {@link HangupParams}.
|
|
321
346
|
*/
|
|
322
347
|
export declare function hangup(params?: HangupParams): Promise<void>;
|
|
@@ -804,5 +829,5 @@ export declare function getSyncedTime(): number;
|
|
|
804
829
|
* Версия SDK
|
|
805
830
|
*/
|
|
806
831
|
export declare function version(): string;
|
|
807
|
-
export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, 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, FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams, };
|
|
808
|
-
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, };
|
|
832
|
+
export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, ClientStatsEvent, 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, FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams, };
|
|
833
|
+
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, Stat, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
|
package/abstract/BaseApi.d.ts
CHANGED
|
@@ -7,18 +7,12 @@ import ConversationResponse from '../types/ConversationResponse';
|
|
|
7
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
8
8
|
import { OkUserId, ParticipantId } from '../types/Participant';
|
|
9
9
|
import PushData from '../types/PushData';
|
|
10
|
+
import { ApiCallStats } from '../classes/stat/ApiCallStats';
|
|
10
11
|
export type ClientStats = {
|
|
11
12
|
call_topology: 'D' | 'S';
|
|
12
13
|
vcid: ConversationData['id'] | null;
|
|
13
14
|
[k: string]: string | number | boolean | null;
|
|
14
15
|
};
|
|
15
|
-
export type ClientEvent = {
|
|
16
|
-
timestamp: number;
|
|
17
|
-
call_topology: 'D' | 'S';
|
|
18
|
-
event_type: string;
|
|
19
|
-
vcid: ConversationData['id'] | null;
|
|
20
|
-
[k: string]: string | number | boolean | null;
|
|
21
|
-
};
|
|
22
16
|
export type LogItem = {
|
|
23
17
|
count?: number;
|
|
24
18
|
custom: ClientStats;
|
|
@@ -33,6 +27,9 @@ export type LogItem = {
|
|
|
33
27
|
};
|
|
34
28
|
export default abstract class BaseApi {
|
|
35
29
|
protected _abortSignal?: AbortSignal;
|
|
30
|
+
protected _apiCallStats: ApiCallStats | null;
|
|
31
|
+
/** Куда писать время выполнения запросов, появляется вместе со звонком */
|
|
32
|
+
setApiCallStats(apiCallStats: ApiCallStats | null): void;
|
|
36
33
|
/**
|
|
37
34
|
* Устанавливает сигнал прерывания для запуска звонка, если не успели отменить до установки соединения с другим участником, то он больше ни как не будет использоваться
|
|
38
35
|
* @param signal - Сигнал прерывания или undefined для очистки
|
|
@@ -69,8 +66,15 @@ export default abstract class BaseApi {
|
|
|
69
66
|
log(items: LogItem[]): void;
|
|
70
67
|
/**
|
|
71
68
|
* method: vchat.clientStats
|
|
69
|
+
*
|
|
70
|
+
* Резолвится только после подтверждённой сервером отправки.
|
|
71
|
+
*/
|
|
72
|
+
logClientStats(items: ClientStats[]): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* method: vchat.clientStats под сохранённым session_key другого
|
|
75
|
+
* пользователя. Одна попытка, без перелогина; AuthData не трогает.
|
|
72
76
|
*/
|
|
73
|
-
|
|
77
|
+
logClientStatsWith(sessionKey: string, items: ClientStats[]): Promise<void>;
|
|
74
78
|
abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
75
79
|
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
76
80
|
getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
|