@vkontakte/calls-sdk 2.8.13-dev.7195a780.0 → 2.8.13-dev.805c82c2.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/abstract/BaseApi.d.ts +8 -10
- package/calls-sdk.cjs.js +7 -7
- package/calls-sdk.esm.js +468 -391
- package/classes/ExternalIdCache.d.ts +9 -13
- package/classes/VolumesDetector.d.ts +0 -1
- package/classes/conversation/Conversation.d.ts +11 -4
- package/classes/conversation/Conversation.testUtils.d.ts +2 -0
- package/classes/conversation/DisplayLayoutRequester.d.ts +3 -1
- package/classes/screenshare/StreamBuilder.d.ts +1 -0
- package/classes/transport/DirectTransport.d.ts +4 -0
- package/default/Api.d.ts +8 -10
- package/package.json +1 -1
- package/static/External.d.ts +10 -0
- package/static/Params.d.ts +28 -1
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../types/Participant';
|
|
3
3
|
export declare class ExternalIdCache {
|
|
4
4
|
private static _normalizeType;
|
|
5
|
-
private
|
|
6
|
-
private
|
|
5
|
+
private _participantIdToExternalId;
|
|
6
|
+
private _externalIdToParticipantId;
|
|
7
7
|
private _decorativeIdToInitialId;
|
|
8
8
|
private _initialIdToDecorativeId;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
16
|
-
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
17
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
18
|
-
getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
9
|
+
getExternalId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
10
|
+
getParticipantId(externalId: ExternalId): ParticipantId | null;
|
|
11
|
+
cache(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
12
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
13
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
14
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
19
15
|
clear(): void;
|
|
20
16
|
}
|
|
@@ -20,7 +20,7 @@ import MediaModifiers from '../../types/MediaModifiers';
|
|
|
20
20
|
import MediaSettings, { IVideoDimentions } from '../../types/MediaSettings';
|
|
21
21
|
import { IAddMovieParams, IUpdateMovieData } from '../../types/MovieShare';
|
|
22
22
|
import MuteStates from '../../types/MuteStates';
|
|
23
|
-
import { CompositeUserId, IGetParticipantsParameters,
|
|
23
|
+
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../../types/Participant';
|
|
24
24
|
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
25
25
|
import { ParticipantListChunkParameters } from '../../types/ParticipantListChunk';
|
|
26
26
|
import ParticipantPriority from '../../types/ParticipantPriority';
|
|
@@ -85,12 +85,18 @@ export default class Conversation extends EventEmitter {
|
|
|
85
85
|
get externalId(): ExternalParticipantId | undefined;
|
|
86
86
|
get mediaSettings(): MediaSettings | undefined;
|
|
87
87
|
get isCallHeld(): boolean;
|
|
88
|
+
get isIncomingRinging(): boolean;
|
|
88
89
|
static debugSessionId(): string | null;
|
|
89
90
|
static debugMessage(type: DebugMessageType, ...args: any[]): boolean;
|
|
90
91
|
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
91
92
|
static getSyncedTime(): number;
|
|
92
93
|
get debugSessionId(): string | null;
|
|
93
|
-
|
|
94
|
+
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
95
|
+
private _onNonFatalError;
|
|
96
|
+
/**
|
|
97
|
+
* Внешний id звонящего во входящем звонке, либо null, если звонящий не найден.
|
|
98
|
+
*/
|
|
99
|
+
getIncomingCallerExternalId(): ExternalParticipantId | null;
|
|
94
100
|
private _buildInternalParams;
|
|
95
101
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
96
102
|
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
@@ -164,8 +170,9 @@ export default class Conversation extends EventEmitter {
|
|
|
164
170
|
private _registerParticipantInCache;
|
|
165
171
|
private _getExistedParticipantByIdOrCreate;
|
|
166
172
|
private _getExternalIdByParticipantId;
|
|
167
|
-
private
|
|
168
|
-
private
|
|
173
|
+
private _getExternalIdsByParticipantIds;
|
|
174
|
+
private _reportMissingExternalIds;
|
|
175
|
+
private _reportMissingExternalIdsById;
|
|
169
176
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
170
177
|
private _warnParticipantNotInConversation;
|
|
171
178
|
private _denormalizeMarkers;
|
|
@@ -35,6 +35,8 @@ declare function createParams(): {
|
|
|
35
35
|
onChatRoomUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
36
36
|
onRemoteStatus: Mock<import("@vitest/spy").Procedure>;
|
|
37
37
|
onSpeakerChanged: Mock<import("@vitest/spy").Procedure>;
|
|
38
|
+
onAcceptedCall: Mock<import("@vitest/spy").Procedure>;
|
|
39
|
+
onNonFatalError: Mock<import("@vitest/spy").Procedure>;
|
|
38
40
|
};
|
|
39
41
|
export type ConversationTestParams = ReturnType<typeof createParams>;
|
|
40
42
|
export type ConversationTestTools = {
|
|
@@ -8,6 +8,7 @@ type DisplayLayoutRequesterParams = {
|
|
|
8
8
|
getParticipants: () => Record<ParticipantId, Participant>;
|
|
9
9
|
isMe: (participantId: ParticipantId) => boolean;
|
|
10
10
|
updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
|
|
11
|
+
onNonFatalError: (message: string) => void;
|
|
11
12
|
};
|
|
12
13
|
export default class DisplayLayoutRequester {
|
|
13
14
|
private readonly _api;
|
|
@@ -15,6 +16,7 @@ export default class DisplayLayoutRequester {
|
|
|
15
16
|
private readonly _getParticipants;
|
|
16
17
|
private readonly _isMe;
|
|
17
18
|
private readonly _updateDisplayLayout;
|
|
19
|
+
private readonly _onNonFatalError;
|
|
18
20
|
private _requestedLayouts;
|
|
19
21
|
private _uncertainLayouts;
|
|
20
22
|
private _pendingRequests;
|
|
@@ -25,7 +27,7 @@ export default class DisplayLayoutRequester {
|
|
|
25
27
|
private _lastFlushAt;
|
|
26
28
|
private _generation;
|
|
27
29
|
private _forceNextFlush;
|
|
28
|
-
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout }: DisplayLayoutRequesterParams);
|
|
30
|
+
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout, onNonFatalError }: DisplayLayoutRequesterParams);
|
|
29
31
|
request(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
30
32
|
resend(): void;
|
|
31
33
|
cleanupParticipant(participantId: ParticipantId): void;
|
|
@@ -9,6 +9,7 @@ export default class StreamBuilder extends BaseStreamBuilder {
|
|
|
9
9
|
private _decoderReady;
|
|
10
10
|
private _decoderBusy;
|
|
11
11
|
private _decoderQueue;
|
|
12
|
+
private _webCodecsRetryAttempted;
|
|
12
13
|
private _fpsMeter;
|
|
13
14
|
private readonly _logger;
|
|
14
15
|
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, onKeyFrameRequested: VoidFunction, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
@@ -72,6 +72,10 @@ export default class DirectTransport extends BaseTransport {
|
|
|
72
72
|
private _markConnected;
|
|
73
73
|
private _onConnectionStateChange;
|
|
74
74
|
private _startReconnection;
|
|
75
|
+
/**
|
|
76
|
+
* Запрашивает у сигналинга переход на серверную топологию.
|
|
77
|
+
* Обычно это делает только мастер, `fromAnySide` снимает это ограничение.
|
|
78
|
+
*/
|
|
75
79
|
private _requestTopologySwitch;
|
|
76
80
|
private _stopReconnection;
|
|
77
81
|
private _startIceRestart;
|
package/default/Api.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import { IHangupParams } from '../types/Api';
|
|
|
5
5
|
import ConversationParams from '../types/ConversationParams';
|
|
6
6
|
import ConversationResponse from '../types/ConversationResponse';
|
|
7
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
8
|
-
import {
|
|
8
|
+
import { OkUserId, ParticipantId } from '../types/Participant';
|
|
9
9
|
import PushData from '../types/PushData';
|
|
10
10
|
export default class Api extends BaseApi {
|
|
11
11
|
private _uuid;
|
|
12
12
|
private _idCache;
|
|
13
13
|
private _callUnsafe;
|
|
14
14
|
protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
|
|
15
|
-
userId(participantId: ParticipantId): ExternalParticipantId;
|
|
15
|
+
userId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
16
16
|
authorize(): Promise<void>;
|
|
17
17
|
private _getAnonymLoginCacheKey;
|
|
18
18
|
private _getCachedAnonymLogin;
|
|
@@ -47,14 +47,12 @@ export default class Api extends BaseApi {
|
|
|
47
47
|
}>;
|
|
48
48
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
49
49
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
57
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
50
|
+
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
51
|
+
getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
52
|
+
cacheExternalId(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
53
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
54
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
55
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
58
56
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
59
57
|
getUserId(): OkUserId | null;
|
|
60
58
|
setUserId(userId: OkUserId): void;
|
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -638,5 +638,15 @@ declare namespace External {
|
|
|
638
638
|
* Собеседник подключился к сигналлингу
|
|
639
639
|
*/
|
|
640
640
|
function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
|
|
641
|
+
/**
|
|
642
|
+
* SDK обнаружил ошибку, после которой звонок может продолжаться.
|
|
643
|
+
*
|
|
644
|
+
* Callback предназначен для отправки ошибки в клиентский мониторинг.
|
|
645
|
+
* Его вызов не означает завершение звонка.
|
|
646
|
+
*
|
|
647
|
+
* @param error
|
|
648
|
+
* @param conversationId ID звонка
|
|
649
|
+
*/
|
|
650
|
+
function onNonFatalError(error: Error, conversationId: string | null): void;
|
|
641
651
|
}
|
|
642
652
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ export type ParamsObject = {
|
|
|
37
37
|
platform: string;
|
|
38
38
|
/** @hidden */
|
|
39
39
|
clientStatsPlatform: string;
|
|
40
|
+
/**
|
|
41
|
+
* Версия приложения-хоста, уходит в статистику и сигналинг, например `'26.31.0:6822'`.
|
|
42
|
+
* По умолчанию `'0.0.0'`
|
|
43
|
+
*/
|
|
44
|
+
appVersion: string;
|
|
40
45
|
/** @hidden */
|
|
41
46
|
clientType: string;
|
|
42
47
|
/** @hidden */
|
|
@@ -230,6 +235,13 @@ export type ParamsObject = {
|
|
|
230
235
|
iceRestartWaitTime: number;
|
|
231
236
|
/** @hidden */
|
|
232
237
|
transportConnectionWaitTime: number;
|
|
238
|
+
/**
|
|
239
|
+
* Разрешить запрашивать переход на серверную топологию не только звонящему,
|
|
240
|
+
* но и принимающей стороне, если не удалось восстановить оборвавшееся p2p-соединение
|
|
241
|
+
*
|
|
242
|
+
* _По умолчанию: `false`_
|
|
243
|
+
*/
|
|
244
|
+
switchTopologyOnReconnectFromAnySide: boolean;
|
|
233
245
|
/**
|
|
234
246
|
* Частота получения статистики в миллисекундах
|
|
235
247
|
*
|
|
@@ -911,6 +923,13 @@ export type ParamsObject = {
|
|
|
911
923
|
* Собеседник подключился к сигналлингу
|
|
912
924
|
*/
|
|
913
925
|
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
926
|
+
/**
|
|
927
|
+
* SDK обнаружил ошибку, после которой звонок может продолжаться.
|
|
928
|
+
*
|
|
929
|
+
* Callback предназначен для отправки ошибки в клиентский мониторинг.
|
|
930
|
+
* Его вызов не означает завершение звонка.
|
|
931
|
+
*/
|
|
932
|
+
onNonFatalError?: (error: Error, conversationId: string | null) => void;
|
|
914
933
|
};
|
|
915
934
|
export default abstract class Params {
|
|
916
935
|
private static _params;
|
|
@@ -920,7 +939,13 @@ export default abstract class Params {
|
|
|
920
939
|
static getScreenFrameRate(fastScreenShare: boolean): number;
|
|
921
940
|
static get<N extends keyof ParamsObject>(name: N): ParamsObject[N];
|
|
922
941
|
static get appName(): string;
|
|
923
|
-
static get appVersion():
|
|
942
|
+
static get appVersion(): string;
|
|
943
|
+
/**
|
|
944
|
+
* Версия клиента для `client_version` в `auth.anonymLogin`. Бэкенд валидирует формат,
|
|
945
|
+
* поэтому это фиксированное значение, а не версия приложения-хоста (см. {@link Params.appVersion}).
|
|
946
|
+
* @hidden
|
|
947
|
+
*/
|
|
948
|
+
static get apiClientVersion(): number;
|
|
924
949
|
static get sdkVersion(): string;
|
|
925
950
|
static get debug(): boolean;
|
|
926
951
|
static get protocolVersion(): 5 | 6;
|
|
@@ -1000,6 +1025,7 @@ export default abstract class Params {
|
|
|
1000
1025
|
};
|
|
1001
1026
|
static get iceRestartWaitTime(): number;
|
|
1002
1027
|
static get transportConnectionWaitTime(): number;
|
|
1028
|
+
static get switchTopologyOnReconnectFromAnySide(): boolean;
|
|
1003
1029
|
static get statisticsInterval(): number;
|
|
1004
1030
|
static set statisticsInterval(value: number);
|
|
1005
1031
|
static get networkStatisticsInterval(): number;
|
|
@@ -1080,6 +1106,7 @@ export default abstract class Params {
|
|
|
1080
1106
|
movieShare: boolean;
|
|
1081
1107
|
clientType: string;
|
|
1082
1108
|
clientStatsPlatform: string;
|
|
1109
|
+
appVersion: string;
|
|
1083
1110
|
consumerScreenDataChannelPacketSize: number;
|
|
1084
1111
|
switchVideoAtBadNetwork: boolean;
|
|
1085
1112
|
simulcast: boolean;
|