@vkontakte/calls-sdk 2.8.13-dev.c9243c68.0 → 2.8.13-dev.f163e503.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 +6 -6
- package/calls-sdk.esm.js +1073 -901
- package/classes/ExternalIdCache.d.ts +9 -13
- package/classes/conversation/Conversation.d.ts +6 -4
- package/classes/conversation/Conversation.testUtils.d.ts +2 -0
- package/classes/conversation/DisplayLayoutRequester.d.ts +3 -1
- package/classes/stat/SdpStats.d.ts +38 -0
- package/classes/transport/DirectTransport.d.ts +1 -0
- package/classes/transport/ServerTransport.d.ts +1 -0
- package/default/Api.d.ts +8 -10
- package/enums/Stat.d.ts +12 -0
- package/package.json +1 -1
- package/static/External.d.ts +10 -0
- package/static/Params.d.ts +20 -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';
|
|
@@ -91,7 +91,8 @@ export default class Conversation extends EventEmitter {
|
|
|
91
91
|
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
92
92
|
static getSyncedTime(): number;
|
|
93
93
|
get debugSessionId(): string | null;
|
|
94
|
-
|
|
94
|
+
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
95
|
+
private _onNonFatalError;
|
|
95
96
|
/**
|
|
96
97
|
* Внешний id звонящего во входящем звонке, либо null, если звонящий не найден.
|
|
97
98
|
*/
|
|
@@ -169,8 +170,9 @@ export default class Conversation extends EventEmitter {
|
|
|
169
170
|
private _registerParticipantInCache;
|
|
170
171
|
private _getExistedParticipantByIdOrCreate;
|
|
171
172
|
private _getExternalIdByParticipantId;
|
|
172
|
-
private
|
|
173
|
-
private
|
|
173
|
+
private _getExternalIdsByParticipantIds;
|
|
174
|
+
private _reportMissingExternalIds;
|
|
175
|
+
private _reportMissingExternalIdsById;
|
|
174
176
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
175
177
|
private _warnParticipantNotInConversation;
|
|
176
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;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StatAggregator } from './StatAggregator';
|
|
2
|
+
type SdpDescription = {
|
|
3
|
+
type: RTCSdpType;
|
|
4
|
+
sdp?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Отправляет в стату согласование SDP: что сгенерировали, что получили от собеседника
|
|
8
|
+
* и на какой операции сломались.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SdpStats {
|
|
11
|
+
private readonly _statAggregator;
|
|
12
|
+
private _pc;
|
|
13
|
+
private _gatheringStartedAt;
|
|
14
|
+
private _remoteSdpReceivedAt;
|
|
15
|
+
private readonly _handleGatheringStateChange;
|
|
16
|
+
constructor(statAggregator: StatAggregator | null);
|
|
17
|
+
/** Начинает следить за сбором кандидатов, предыдущее соединение перестает слушать */
|
|
18
|
+
observe(pc: RTCPeerConnection): void;
|
|
19
|
+
stop(): void;
|
|
20
|
+
/** Сгенерировали свой SDP */
|
|
21
|
+
logSdpGenerated(type: RTCSdpType): void;
|
|
22
|
+
/** Собрали свой ICE-кандидат */
|
|
23
|
+
logCandidateGenerated(candidate: RTCIceCandidate): void;
|
|
24
|
+
/** Получили SDP от собеседника */
|
|
25
|
+
logSdpReceived(type: RTCSdpType): void;
|
|
26
|
+
/** Получили ICE-кандидата от собеседника */
|
|
27
|
+
logCandidateReceived(candidate: RTCIceCandidateInit): void;
|
|
28
|
+
/** Не смогли сгенерировать SDP */
|
|
29
|
+
logCreateFailed(type: RTCSdpType, error: unknown): void;
|
|
30
|
+
/** Не смогли применить свой SDP */
|
|
31
|
+
logSetLocalFailed(sdp: SdpDescription, error: unknown): void;
|
|
32
|
+
/** Не смогли применить SDP собеседника */
|
|
33
|
+
logSetRemoteFailed(sdp: SdpDescription, error: unknown): void;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
private _logFailure;
|
|
36
|
+
private _log;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -39,6 +39,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
39
39
|
private _lastBadConnection;
|
|
40
40
|
private _perfStatReporter;
|
|
41
41
|
private _directStatReporter;
|
|
42
|
+
private readonly _sdpStats;
|
|
42
43
|
private readonly _debug;
|
|
43
44
|
private readonly _logger;
|
|
44
45
|
private readonly _statAggregator;
|
|
@@ -45,6 +45,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
45
45
|
private readonly _debug;
|
|
46
46
|
private readonly _logger;
|
|
47
47
|
private readonly _statAggregator;
|
|
48
|
+
private readonly _sdpStats;
|
|
48
49
|
private readonly _codecStatsAggregator;
|
|
49
50
|
private readonly _simulcast;
|
|
50
51
|
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
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/enums/Stat.d.ts
CHANGED
|
@@ -14,6 +14,18 @@ declare const enum Stat {
|
|
|
14
14
|
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
|
|
15
15
|
SIGNALING_PING_SUMMARY = "signaling_ping_summary",
|
|
16
16
|
SIGNALING_COMMAND_SUMMARY = "signaling_command_summary",
|
|
17
|
+
SDP_CREATE_OFFER = "sdp_create_offer",
|
|
18
|
+
SDP_CREATE_ANSWER = "sdp_create_answer",
|
|
19
|
+
SDP_SET_LOCAL_OFFER = "sdp_set_local_offer",
|
|
20
|
+
SDP_SET_LOCAL_PRANSWER = "sdp_set_local_pranswer",
|
|
21
|
+
SDP_SET_LOCAL_ANSWER = "sdp_set_local_answer",
|
|
22
|
+
SDP_SET_LOCAL_ROLLBACK = "sdp_set_local_rollback",
|
|
23
|
+
SDP_SET_REMOTE_OFFER = "sdp_set_remote_offer",
|
|
24
|
+
SDP_SET_REMOTE_PRANSWER = "sdp_set_remote_pranswer",
|
|
25
|
+
SDP_SET_REMOTE_ANSWER = "sdp_set_remote_answer",
|
|
26
|
+
SDP_SET_REMOTE_ROLLBACK = "sdp_set_remote_rollback",
|
|
27
|
+
SDP_GENERATED = "sdp_generated",
|
|
28
|
+
SDP_RECEIVED = "sdp_received",
|
|
17
29
|
WEBSOCKET_CONNECTED = "websocket_connected",
|
|
18
30
|
WEBSOCKET_RECONNECTED = "websocket_reconnected",
|
|
19
31
|
WEBSOCKET_FAILED_PINGS = "websocket_failed_pings",
|
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 */
|
|
@@ -911,6 +916,13 @@ export type ParamsObject = {
|
|
|
911
916
|
* Собеседник подключился к сигналлингу
|
|
912
917
|
*/
|
|
913
918
|
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
919
|
+
/**
|
|
920
|
+
* SDK обнаружил ошибку, после которой звонок может продолжаться.
|
|
921
|
+
*
|
|
922
|
+
* Callback предназначен для отправки ошибки в клиентский мониторинг.
|
|
923
|
+
* Его вызов не означает завершение звонка.
|
|
924
|
+
*/
|
|
925
|
+
onNonFatalError?: (error: Error, conversationId: string | null) => void;
|
|
914
926
|
};
|
|
915
927
|
export default abstract class Params {
|
|
916
928
|
private static _params;
|
|
@@ -920,7 +932,13 @@ export default abstract class Params {
|
|
|
920
932
|
static getScreenFrameRate(fastScreenShare: boolean): number;
|
|
921
933
|
static get<N extends keyof ParamsObject>(name: N): ParamsObject[N];
|
|
922
934
|
static get appName(): string;
|
|
923
|
-
static get appVersion():
|
|
935
|
+
static get appVersion(): string;
|
|
936
|
+
/**
|
|
937
|
+
* Версия клиента для `client_version` в `auth.anonymLogin`. Бэкенд валидирует формат,
|
|
938
|
+
* поэтому это фиксированное значение, а не версия приложения-хоста (см. {@link Params.appVersion}).
|
|
939
|
+
* @hidden
|
|
940
|
+
*/
|
|
941
|
+
static get apiClientVersion(): number;
|
|
924
942
|
static get sdkVersion(): string;
|
|
925
943
|
static get debug(): boolean;
|
|
926
944
|
static get protocolVersion(): 5 | 6;
|
|
@@ -1080,6 +1098,7 @@ export default abstract class Params {
|
|
|
1080
1098
|
movieShare: boolean;
|
|
1081
1099
|
clientType: string;
|
|
1082
1100
|
clientStatsPlatform: string;
|
|
1101
|
+
appVersion: string;
|
|
1083
1102
|
consumerScreenDataChannelPacketSize: number;
|
|
1084
1103
|
switchVideoAtBadNetwork: boolean;
|
|
1085
1104
|
simulcast: boolean;
|