@vkontakte/calls-sdk 2.8.12-dev.8c2bbcbf.0 → 2.8.12-dev.a4b1a09a.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 +16 -6
- package/abstract/BaseApi.d.ts +7 -9
- package/abstract/BaseSignaling.d.ts +6 -5
- package/calls-sdk.cjs.js +10 -10
- package/calls-sdk.esm.js +2738 -2150
- package/classes/CallRegistry.d.ts +1 -1
- package/classes/ExternalIdCache.d.ts +11 -12
- package/classes/MediaSource.d.ts +4 -0
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +43 -38
- package/classes/conversation/Conversation.testUtils.d.ts +150 -0
- package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
- package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +8 -6
- package/classes/conversation/index.d.ts +1 -0
- package/classes/stat/CallFinishClassifier.d.ts +11 -0
- package/classes/stat/CallLifecycleStats.d.ts +1 -6
- package/classes/stat/StatAggregator.d.ts +4 -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/default/Signaling.d.ts +12 -15
- package/default/SignalingTransport.d.ts +7 -1
- package/enums/ClientHangupReason.d.ts +7 -0
- package/enums/HangupType.d.ts +0 -1
- package/enums/Stat.d.ts +0 -1
- package/package.json +2 -2
- package/static/External.d.ts +11 -1
- package/static/Params.d.ts +22 -1
- package/static/Utils.d.ts +1 -1
- package/static/WebRTCUtils.d.ts +8 -7
- package/types/SignalingMessage.d.ts +4 -1
- package/types/WebTransport.d.ts +14 -15
- package/utils/IceServers.d.ts +2 -0
- package/utils/NavigatorPermissions.d.ts +2 -2
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../types/Participant';
|
|
3
3
|
export declare class ExternalIdCache {
|
|
4
|
-
private
|
|
5
|
-
private
|
|
4
|
+
private static _normalizeType;
|
|
5
|
+
private _participantIdToExternalId;
|
|
6
|
+
private _externalIdToParticipantId;
|
|
6
7
|
private _decorativeIdToInitialId;
|
|
7
8
|
private _initialIdToDecorativeId;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
getExternalId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
10
|
+
getParticipantId(externalId: ExternalId): ParticipantId | null;
|
|
10
11
|
hasByExternalId(externalId: ExternalId): boolean;
|
|
11
|
-
|
|
12
|
-
cache(participantId:
|
|
13
|
-
mapDecorativeId(decorativeId:
|
|
14
|
-
unmapDecorativeId(initialId:
|
|
15
|
-
getDecorativeIdByInitialId(initialId:
|
|
16
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
17
|
-
getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
12
|
+
hasByParticipantId(participantId: ParticipantId): boolean;
|
|
13
|
+
cache(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
14
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
15
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
16
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
18
17
|
clear(): void;
|
|
19
18
|
}
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
58
58
|
private readonly _videoEffectsFpsLimiter?;
|
|
59
59
|
private readonly _debug;
|
|
60
60
|
private readonly _logger;
|
|
61
|
+
private _cameraTrackSetAt;
|
|
62
|
+
private _cameraMuteRecoveredAt;
|
|
61
63
|
constructor(debug?: DebugLogger, logger?: StatsLogger | null);
|
|
62
64
|
get cameraVideoTrack(): MediaStreamTrack | null;
|
|
63
65
|
set cameraVideoTrack(track: MediaStreamTrack | null);
|
|
@@ -97,6 +99,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
97
99
|
protected getSilentAudioShareTrack(): MediaStreamTrack;
|
|
98
100
|
protected getBlackScreenShareTrack(): MediaStreamTrack;
|
|
99
101
|
protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
102
|
+
protected _replaceTrack(oldTrack: MediaStreamTrack, newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
103
|
+
protected _addLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
100
104
|
private _setEffect;
|
|
101
105
|
private _stopEffect;
|
|
102
106
|
destroy(): void;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
2
|
import type { RGBTuple } from '@vkontakte/calls-vmoji';
|
|
3
|
-
import BaseApi from '
|
|
4
|
-
import BaseLogger from '
|
|
5
|
-
import { AddParticipantParams } from '
|
|
6
|
-
import ConversationFeature from '
|
|
7
|
-
import ConversationOption from '
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
3
|
+
import BaseApi from '../../abstract/BaseApi';
|
|
4
|
+
import BaseLogger from '../../abstract/BaseLogger';
|
|
5
|
+
import { AddParticipantParams } from '../../abstract/BaseSignaling';
|
|
6
|
+
import ConversationFeature from '../../enums/ConversationFeature';
|
|
7
|
+
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
+
import type ClientHangupReason from '../../enums/ClientHangupReason';
|
|
9
|
+
import MediaOption from '../../enums/MediaOption';
|
|
10
|
+
import UpdateDisplayLayoutErrorReason from '../../enums/UpdateDisplayLayoutErrorReason';
|
|
11
|
+
import UserRole from '../../enums/UserRole';
|
|
12
|
+
import UserType from '../../enums/UserType';
|
|
13
|
+
import { DebugMessageType } from '../../static/Debug';
|
|
14
|
+
import { JSONObject } from '../../static/Json';
|
|
15
|
+
import { IAsrStartParams, IAsrStopParams } from '../../types/Asr';
|
|
16
|
+
import { AudienceModeHandsResponse } from '../../types/AudienceMode';
|
|
17
|
+
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '../../types/Conversation';
|
|
18
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '../../types/ExternalId';
|
|
19
|
+
import MediaModifiers from '../../types/MediaModifiers';
|
|
20
|
+
import MediaSettings, { IVideoDimentions } from '../../types/MediaSettings';
|
|
21
|
+
import { IAddMovieParams, IUpdateMovieData } from '../../types/MovieShare';
|
|
22
|
+
import MuteStates from '../../types/MuteStates';
|
|
23
|
+
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../../types/Participant';
|
|
24
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
25
|
+
import { ParticipantListChunkParameters } from '../../types/ParticipantListChunk';
|
|
26
|
+
import ParticipantPriority from '../../types/ParticipantPriority';
|
|
27
|
+
import { ParticipantStreamDescription } from '../../types/ParticipantStreamDescription';
|
|
28
|
+
import { ScreenCaptureSettings } from '../../types/ScreenCaptureSettings';
|
|
29
|
+
import SignalingMessage from '../../types/SignalingMessage';
|
|
30
|
+
import { WaitingHallResponse } from '../../types/WaitingHall';
|
|
31
|
+
import EventEmitter from '../EventEmitter';
|
|
31
32
|
export default class Conversation extends EventEmitter {
|
|
32
33
|
private readonly _api;
|
|
33
34
|
private readonly _signaling;
|
|
@@ -42,7 +43,6 @@ export default class Conversation extends EventEmitter {
|
|
|
42
43
|
private _waitingHallHoldPending;
|
|
43
44
|
private _participantState;
|
|
44
45
|
private _participants;
|
|
45
|
-
private _pendingParticipants;
|
|
46
46
|
private _directTransportIsMaster?;
|
|
47
47
|
private _transport;
|
|
48
48
|
private _debugInfo;
|
|
@@ -57,6 +57,8 @@ export default class Conversation extends EventEmitter {
|
|
|
57
57
|
private _serverSettings;
|
|
58
58
|
private _serverTimeOffset;
|
|
59
59
|
private _delayedHangup;
|
|
60
|
+
private _hangupEmitted;
|
|
61
|
+
private _hangupPromise;
|
|
60
62
|
private _abortController;
|
|
61
63
|
private _registeredPeerReceived;
|
|
62
64
|
private _calleeUnavailableTimer;
|
|
@@ -87,7 +89,8 @@ export default class Conversation extends EventEmitter {
|
|
|
87
89
|
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
88
90
|
static getSyncedTime(): number;
|
|
89
91
|
get debugSessionId(): string | null;
|
|
90
|
-
|
|
92
|
+
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
93
|
+
private _onNonFatalError;
|
|
91
94
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
92
95
|
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
93
96
|
private _onJoinPart2;
|
|
@@ -103,8 +106,8 @@ export default class Conversation extends EventEmitter {
|
|
|
103
106
|
private _getMainRoomParticipants;
|
|
104
107
|
private _decodeExternalConversationParams;
|
|
105
108
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
106
|
-
decline(): Promise<void>;
|
|
107
|
-
hangup(): Promise<void>;
|
|
109
|
+
decline(reason?: ClientHangupReason): Promise<void>;
|
|
110
|
+
hangup(reason?: ClientHangupReason): Promise<void>;
|
|
108
111
|
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
|
|
109
112
|
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
110
113
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
@@ -113,8 +116,10 @@ export default class Conversation extends EventEmitter {
|
|
|
113
116
|
private _openTransport;
|
|
114
117
|
private _allocateParticipantTransport;
|
|
115
118
|
private _cleanupRegistry;
|
|
119
|
+
private _emitHangupOnce;
|
|
116
120
|
private _close;
|
|
117
|
-
destroy():
|
|
121
|
+
destroy(): void;
|
|
122
|
+
private _destroy;
|
|
118
123
|
private _getConversationParams;
|
|
119
124
|
private _setConversationParams;
|
|
120
125
|
private _buildSignalingEndpoint;
|
|
@@ -155,7 +160,8 @@ export default class Conversation extends EventEmitter {
|
|
|
155
160
|
private _registerParticipantInCache;
|
|
156
161
|
private _getExistedParticipantByIdOrCreate;
|
|
157
162
|
private _getExternalIdByParticipantId;
|
|
158
|
-
private
|
|
163
|
+
private _getExternalIdsByParticipantIds;
|
|
164
|
+
private _reportMissingExternalIds;
|
|
159
165
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
160
166
|
private _warnParticipantNotInConversation;
|
|
161
167
|
private _denormalizeMarkers;
|
|
@@ -198,7 +204,7 @@ export default class Conversation extends EventEmitter {
|
|
|
198
204
|
private _cleanupTransportForHold;
|
|
199
205
|
private _cleanupSpeakerDetector;
|
|
200
206
|
private _cleanupSpecListener;
|
|
201
|
-
private
|
|
207
|
+
private _disposeSignaling;
|
|
202
208
|
private _onAddParticipant;
|
|
203
209
|
private _onRemoveParticipant;
|
|
204
210
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
@@ -231,7 +237,7 @@ export default class Conversation extends EventEmitter {
|
|
|
231
237
|
private _getWaitingForPromotionStatus;
|
|
232
238
|
putHandsDown(): Promise<void>;
|
|
233
239
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
234
|
-
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
240
|
+
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void | SignalingMessage>;
|
|
235
241
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
236
242
|
requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
237
243
|
feedback(key: string): Promise<SignalingMessage>;
|
|
@@ -360,7 +366,7 @@ export default class Conversation extends EventEmitter {
|
|
|
360
366
|
private _onRecordInfo;
|
|
361
367
|
private _onStopRecordInfo;
|
|
362
368
|
private _changePinnedParticipantForRoom;
|
|
363
|
-
_changeRecordInfoForRoom():
|
|
369
|
+
_changeRecordInfoForRoom(): void;
|
|
364
370
|
private _changeAsrInfoForRoom;
|
|
365
371
|
private _changeUrlSharingInfoForRoom;
|
|
366
372
|
private _onParticipantAnimojiChanged;
|
|
@@ -435,7 +441,6 @@ export default class Conversation extends EventEmitter {
|
|
|
435
441
|
private _setMuteStatesForRoomId;
|
|
436
442
|
private _forceOpenTransportForAloneInCall;
|
|
437
443
|
private _registerParticipant;
|
|
438
|
-
private _getParticipants;
|
|
439
444
|
private _getParticipant;
|
|
440
445
|
}
|
|
441
446
|
declare function _resetPendingInstance(): void;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { FetchMock } from 'vitest-fetch-mock';
|
|
2
|
+
import { Mock } from 'vitest';
|
|
3
|
+
import { Client, Server } from 'mock-socket';
|
|
4
|
+
import { ISharedMovieInfo, OkUserId } from '../../CallsSDK';
|
|
5
|
+
import Api from '../../default/Api';
|
|
6
|
+
import CallDirection from '../../enums/CallDirection';
|
|
7
|
+
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
+
import TransportState from '../../enums/TransportState';
|
|
9
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
10
|
+
import { ParticipantStatus } from '../../static/External';
|
|
11
|
+
import { ExternalParticipantId } from '../../types/ExternalId';
|
|
12
|
+
import { ParticipantListMarkers } from '../../types/Participant';
|
|
13
|
+
import SignalingMessage from '../../types/SignalingMessage';
|
|
14
|
+
import Conversation from './Conversation';
|
|
15
|
+
declare function createParams(): {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
apiEnv: string;
|
|
18
|
+
onLocalStream: Mock<import("@vitest/spy").Procedure>;
|
|
19
|
+
onLocalStatus: Mock<import("@vitest/spy").Procedure>;
|
|
20
|
+
onConversation: Mock<import("@vitest/spy").Procedure>;
|
|
21
|
+
onLocalSharedMovieInfo: Mock<import("@vitest/spy").Procedure>;
|
|
22
|
+
onRemoteSharedMovieInfo: Mock<import("@vitest/spy").Procedure>;
|
|
23
|
+
onRemoteSharedUrl: Mock<import("@vitest/spy").Procedure>;
|
|
24
|
+
onCallState: Mock<import("@vitest/spy").Procedure>;
|
|
25
|
+
onOptionsChanged: Mock<import("@vitest/spy").Procedure>;
|
|
26
|
+
onPinnedParticipant: Mock<import("@vitest/spy").Procedure>;
|
|
27
|
+
onRemoteMediaSettings: Mock<import("@vitest/spy").Procedure>;
|
|
28
|
+
onRemoteParticipantState: Mock<import("@vitest/spy").Procedure>;
|
|
29
|
+
onLocalPin: Mock<import("@vitest/spy").Procedure>;
|
|
30
|
+
onDebugMessage: Mock<import("@vitest/spy").Procedure>;
|
|
31
|
+
onHangup: Mock<import("@vitest/spy").Procedure>;
|
|
32
|
+
onRemoteRemoved: Mock<import("@vitest/spy").Procedure>;
|
|
33
|
+
onConversationParticipantListChunk: Mock<import("@vitest/spy").Procedure>;
|
|
34
|
+
onRoomParticipantsUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
35
|
+
onChatRoomUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
36
|
+
onRemoteStatus: Mock<import("@vitest/spy").Procedure>;
|
|
37
|
+
onSpeakerChanged: Mock<import("@vitest/spy").Procedure>;
|
|
38
|
+
onAcceptedCall: Mock<import("@vitest/spy").Procedure>;
|
|
39
|
+
onNonFatalError: Mock<import("@vitest/spy").Procedure>;
|
|
40
|
+
};
|
|
41
|
+
export type ConversationTestParams = ReturnType<typeof createParams>;
|
|
42
|
+
export type ConversationTestTools = {
|
|
43
|
+
readonly endpointURL: string;
|
|
44
|
+
readonly fetchMocker: FetchMock;
|
|
45
|
+
readonly params: ConversationTestParams;
|
|
46
|
+
readonly server: Server;
|
|
47
|
+
readonly wsBaseURL: string;
|
|
48
|
+
createConnectionMessage(data?: Partial<SignalingMessage.Connection>): SignalingMessage.Connection;
|
|
49
|
+
createConversation(options?: {
|
|
50
|
+
api?: Api;
|
|
51
|
+
}): Conversation;
|
|
52
|
+
createExternalIdMock(id: string, data?: Partial<ExternalParticipantId>): ExternalParticipantId;
|
|
53
|
+
createMarkers(data?: Partial<ParticipantListMarkers>): ParticipantListMarkers;
|
|
54
|
+
createMovieShareInfo(initiatorId: string, data?: Partial<ISharedMovieInfo> | null): ISharedMovieInfo;
|
|
55
|
+
createParticipant(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
56
|
+
createParticipantWithMarkers(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
57
|
+
createPromoteParticipantMessage(): SignalingMessage.PromoteParticipant;
|
|
58
|
+
createSignallingConversation(okUserId: OkUserId, peerId: SignalingMessage.PeerId, data?: Partial<SignalingMessage.Conversation>): SignalingMessage.Conversation;
|
|
59
|
+
createWaitingHallConversationData(): ReturnType<typeof createWaitingHallConversationData>;
|
|
60
|
+
emitMessageOnConnection(wsServer: Server, message?: SignalingMessage.Connection): void;
|
|
61
|
+
enableParticipantListChunk(): void;
|
|
62
|
+
expectRemoteStatus(status: ParticipantStatus, participantId?: string): Promise<void>;
|
|
63
|
+
expectRemoteStatusCall(status: ParticipantStatus, participantId?: string): void;
|
|
64
|
+
forgetConversation(conversation: Conversation): void;
|
|
65
|
+
getActiveSocket(wsServer: Server): Client;
|
|
66
|
+
hasRemoteStatusCall(status: ParticipantStatus, participantId?: string): boolean;
|
|
67
|
+
isCapabilityEnabled(predicateIndex: number, wsServer: Server): boolean;
|
|
68
|
+
parseUrlSearch(search: string): Record<string, string>;
|
|
69
|
+
resetRemoteStatusCallbacks(): void;
|
|
70
|
+
respondOnGetParticipantListChunkWith(data: Partial<SignalingMessage.ParticipantListChunk>): void;
|
|
71
|
+
sendAcceptedCall(participant: SignalingMessage.Participant): void;
|
|
72
|
+
sendHungup(participant: SignalingMessage.Participant): void;
|
|
73
|
+
sendSessionState(participant: SignalingMessage.Participant | number, connected: boolean, data?: Partial<SignalingMessage.SessionState>): void;
|
|
74
|
+
setApiAuth(data?: {
|
|
75
|
+
sessionKey?: string;
|
|
76
|
+
sessionSecretKey?: string;
|
|
77
|
+
}): void;
|
|
78
|
+
setTransportState(conversation: Conversation, state: TransportState): void;
|
|
79
|
+
socketRespondWith(socket: Client, command: string, response: SignalingMessage): void;
|
|
80
|
+
socketSendNotification(socket: Client, notification: string, response?: SignalingMessage): void;
|
|
81
|
+
startConversation(message?: SignalingMessage.Connection): Promise<Conversation>;
|
|
82
|
+
startConversationWithParticipants(participants: SignalingMessage.Participant[], peerId?: SignalingMessage.PeerId): Promise<Conversation>;
|
|
83
|
+
startConversationWithRemoteParticipant(remoteParticipantData?: Partial<SignalingMessage.Participant>): Promise<{
|
|
84
|
+
conversation: Conversation;
|
|
85
|
+
meParticipant: SignalingMessage.Participant;
|
|
86
|
+
remoteParticipant: SignalingMessage.Participant;
|
|
87
|
+
}>;
|
|
88
|
+
stubApiRequest(endpoint: string, method: string, data: object): void;
|
|
89
|
+
waitFor(fn: () => Promise<boolean> | boolean, message?: string, timeout?: number): Promise<true>;
|
|
90
|
+
flushSdkCallbacks(): Promise<null>;
|
|
91
|
+
};
|
|
92
|
+
export declare function defineConversationTests(name: string, defineTests: (tools: ConversationTestTools) => void): void;
|
|
93
|
+
export declare function createExternalIdMock(id: string, data?: Partial<ExternalParticipantId>): ExternalParticipantId;
|
|
94
|
+
export declare function enableParticipantListChunk(): void;
|
|
95
|
+
export declare function setApiAuth(data?: {
|
|
96
|
+
sessionKey?: string;
|
|
97
|
+
sessionSecretKey?: string;
|
|
98
|
+
}): void;
|
|
99
|
+
export declare function setTransportState(conversation: Conversation, state: TransportState): void;
|
|
100
|
+
export declare function socketRespondWith(socket: Client, command: string, response: SignalingMessage): void;
|
|
101
|
+
export declare function socketSendNotification(socket: Client, notification: string, response?: SignalingMessage): void;
|
|
102
|
+
export declare function createWaitingHallConversationData(): {
|
|
103
|
+
acceptTime: null;
|
|
104
|
+
asrInfo: null;
|
|
105
|
+
asrInfoByRoom: Map<any, any>;
|
|
106
|
+
audienceMode: boolean;
|
|
107
|
+
chatId: null;
|
|
108
|
+
compositeUserId: string;
|
|
109
|
+
concurrent: boolean;
|
|
110
|
+
direction: CallDirection;
|
|
111
|
+
externalId: ExternalParticipantId;
|
|
112
|
+
features: never[];
|
|
113
|
+
featuresPerRole: null;
|
|
114
|
+
id: string;
|
|
115
|
+
mediaModifiers: {
|
|
116
|
+
denoise: boolean;
|
|
117
|
+
denoiseAnn: boolean;
|
|
118
|
+
};
|
|
119
|
+
muteStates: Map<any, any>;
|
|
120
|
+
muteStatesPersonal: {};
|
|
121
|
+
needRate: boolean;
|
|
122
|
+
networkRating: number;
|
|
123
|
+
observer: boolean;
|
|
124
|
+
options: ConversationOption[];
|
|
125
|
+
participantsLimit: number;
|
|
126
|
+
pinnedParticipantIdByRoom: Map<any, any>;
|
|
127
|
+
recordsInfoByRoom: Map<any, any>;
|
|
128
|
+
restricted: boolean;
|
|
129
|
+
roles: never[];
|
|
130
|
+
roomId: number | null;
|
|
131
|
+
topology: TransportTopology;
|
|
132
|
+
urlSharingInfoByRoom: Map<any, any>;
|
|
133
|
+
userId: number;
|
|
134
|
+
waitForAdmin: boolean;
|
|
135
|
+
waitingHall: boolean;
|
|
136
|
+
};
|
|
137
|
+
export declare function createPromoteParticipantMessage(): SignalingMessage.PromoteParticipant;
|
|
138
|
+
export declare function emitMessageOnConnection(wsServer: Server, message?: SignalingMessage.Connection): void;
|
|
139
|
+
export declare function getActiveSocket(wsServer: Server): Client;
|
|
140
|
+
export declare function isCapabilityEnabled(predicateIndex: number, wsServer: Server): boolean;
|
|
141
|
+
export declare function parseUrlSearch(search: string): Record<string, string>;
|
|
142
|
+
export declare function flushSdkCallbacks(): Promise<null>;
|
|
143
|
+
export declare function waitFor(fn: () => Promise<boolean> | boolean, message?: string, timeout?: number): Promise<true>;
|
|
144
|
+
export declare function createSignallingConversation(okUserId: OkUserId, peerId: SignalingMessage.PeerId, data?: Partial<SignalingMessage.Conversation>): SignalingMessage.Conversation;
|
|
145
|
+
export declare function createConnectionMessage(data?: Partial<SignalingMessage.Connection>): SignalingMessage.Connection;
|
|
146
|
+
export declare function createParticipant(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
147
|
+
export declare function createParticipantWithMarkers(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
148
|
+
export declare function createMarkers(data?: Partial<ParticipantListMarkers>): ParticipantListMarkers;
|
|
149
|
+
export declare function createMovieShareInfo(initiatorId: string, data?: Partial<ISharedMovieInfo> | null): ISharedMovieInfo;
|
|
150
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ConversationResponse from '
|
|
1
|
+
import ConversationResponse from '../../types/ConversationResponse';
|
|
2
2
|
export type ConversationResponseSource = 'startConversation' | 'joinConversation' | 'joinConversationByLink' | 'fastStart' | 'fastJoin';
|
|
3
3
|
export declare function assertValidConversationResponse(response: ConversationResponse | null | undefined, source: ConversationResponseSource): void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import BaseApi from '
|
|
2
|
-
import type { DebugLogger } from '
|
|
3
|
-
import { DisplayLayoutRequest, ParticipantLayout } from '
|
|
4
|
-
import { Participant, ParticipantId } from '
|
|
1
|
+
import BaseApi from '../../abstract/BaseApi';
|
|
2
|
+
import type { DebugLogger } from '../../static/Debug';
|
|
3
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
4
|
+
import { Participant, ParticipantId } from '../../types/Participant';
|
|
5
5
|
type DisplayLayoutRequesterParams = {
|
|
6
6
|
api: BaseApi;
|
|
7
7
|
debug: DebugLogger;
|
|
8
|
-
getParticipants: () =>
|
|
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 @@
|
|
|
1
|
+
export { default } from './Conversation';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SemanticCallFinishReason = 'hangup' | 'canceled' | 'rejected' | 'busy' | 'missed' | 'timeout' | 'another_device' | 'removed' | 'banned' | 'initially_closed' | 'call_timeout' | 'socket_closed' | 'killed' | 'killed_without_delete' | 'obsolete_client' | 'unavailable';
|
|
2
|
+
export type ClassifiedCallFinish = {
|
|
3
|
+
reason: SemanticCallFinishReason;
|
|
4
|
+
string_value?: string;
|
|
5
|
+
} | {
|
|
6
|
+
reason: 'error';
|
|
7
|
+
string_value: string;
|
|
8
|
+
} | {
|
|
9
|
+
reason: 'failed';
|
|
10
|
+
};
|
|
11
|
+
export declare function classifyCallFinish(error: unknown): ClassifiedCallFinish;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import HangupReason from '../HangupReason';
|
|
2
1
|
import StatsLogger from '../StatsLogger';
|
|
3
2
|
export type CallLifecycleSource = 'outgoing' | 'incoming' | 'join' | 'anonym_join';
|
|
4
3
|
export interface CallLifecycleInitializationParams {
|
|
@@ -15,9 +14,7 @@ export declare class CallLifecycleStats {
|
|
|
15
14
|
private _conversationId;
|
|
16
15
|
private _callStartLabel;
|
|
17
16
|
private _lifecycleStartedAtMonotonic;
|
|
18
|
-
private _warmupStartedAtMonotonic;
|
|
19
17
|
private _pendingEvents;
|
|
20
|
-
private _warmupCompleted;
|
|
21
18
|
private _callStarted;
|
|
22
19
|
private _accepted;
|
|
23
20
|
private _firstMediaSent;
|
|
@@ -28,13 +25,11 @@ export declare class CallLifecycleStats {
|
|
|
28
25
|
get terminated(): boolean;
|
|
29
26
|
markInitializationStarted({ source, conversationId }: CallLifecycleInitializationParams): void;
|
|
30
27
|
bindConversationId(conversationId: string): void;
|
|
31
|
-
markWarmupStarted(): void;
|
|
32
|
-
markWarmupCompleted(): void;
|
|
33
28
|
markCallStarted(): void;
|
|
34
29
|
markOutgoingAccepted(): void;
|
|
35
30
|
markIncomingAccepted(concurrent: boolean): void;
|
|
36
31
|
markFirstMediaSent(): void;
|
|
37
|
-
markFinished(reason:
|
|
32
|
+
markFinished(reason: unknown): void;
|
|
38
33
|
markTerminated(): void;
|
|
39
34
|
destroy(): void;
|
|
40
35
|
private _canRecord;
|
|
@@ -4,9 +4,13 @@ import StatsLogger from '../StatsLogger';
|
|
|
4
4
|
export declare class StatAggregator {
|
|
5
5
|
private readonly _logger;
|
|
6
6
|
private readonly _eventualLogs;
|
|
7
|
+
private _lastCallStatContext;
|
|
7
8
|
constructor(logger: StatsLogger);
|
|
8
9
|
logCallStat(params: ICallStatLog): void;
|
|
9
10
|
/** @link https://wiki.odkl.ru/pages/viewpage.action?pageId=100892588 */
|
|
10
11
|
logEventualStat(params: IEventualStatLog): void;
|
|
11
12
|
destroy(): void;
|
|
13
|
+
private _getCallStatContext;
|
|
14
|
+
private _flushEventualStats;
|
|
15
|
+
private _logEventualStat;
|
|
12
16
|
}
|
|
@@ -57,6 +57,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
57
57
|
private _disposePeerConnection;
|
|
58
58
|
setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
|
|
59
59
|
close(error?: Error): void;
|
|
60
|
+
private _finishClose;
|
|
60
61
|
private _setState;
|
|
61
62
|
private _onSignalingNotification;
|
|
62
63
|
private _handleTransmittedData;
|
|
@@ -43,6 +43,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
43
43
|
private _producerSessionId;
|
|
44
44
|
private _newAudioShareTrack;
|
|
45
45
|
private _simulcastInfo;
|
|
46
|
+
private _isSimulcastNegotiated;
|
|
46
47
|
private readonly _debug;
|
|
47
48
|
private readonly _logger;
|
|
48
49
|
private readonly _statAggregator;
|
package/default/Api.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import HangupType from '../enums/HangupType';
|
|
|
4
4
|
import ConversationParams from '../types/ConversationParams';
|
|
5
5
|
import ConversationResponse from '../types/ConversationResponse';
|
|
6
6
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
7
|
-
import {
|
|
7
|
+
import { OkUserId, ParticipantId } from '../types/Participant';
|
|
8
8
|
import PushData from '../types/PushData';
|
|
9
9
|
export default class Api extends BaseApi {
|
|
10
10
|
private _uuid;
|
|
11
11
|
private _idCache;
|
|
12
12
|
private _callUnsafe;
|
|
13
|
-
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
14
|
-
userId(participantId: ParticipantId):
|
|
13
|
+
protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
|
|
14
|
+
userId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
15
15
|
authorize(): Promise<void>;
|
|
16
16
|
private _getAnonymLoginCacheKey;
|
|
17
17
|
private _getCachedAnonymLogin;
|
|
@@ -45,13 +45,11 @@ export default class Api extends BaseApi {
|
|
|
45
45
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
46
46
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
47
47
|
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
54
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
48
|
+
getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
49
|
+
cacheExternalId(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
50
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
51
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
52
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
55
53
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
56
54
|
getUserId(): OkUserId | null;
|
|
57
55
|
setUserId(userId: OkUserId): void;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
|
-
import StatsLogger from '../classes/StatsLogger';
|
|
3
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
4
3
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
5
4
|
import { StatAggregator } from '../classes/stat/StatAggregator';
|
|
6
5
|
import { StatPings } from '../classes/stat/StatPings';
|
|
7
6
|
import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
|
|
8
|
-
import
|
|
7
|
+
import StatsLogger from '../classes/StatsLogger';
|
|
9
8
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
10
9
|
import ConversationOption from '../enums/ConversationOption';
|
|
11
10
|
import MediaOption from '../enums/MediaOption';
|
|
12
11
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
12
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
13
13
|
import UserRole from '../enums/UserRole';
|
|
14
14
|
import { type DebugLogger } from '../static/Debug';
|
|
15
15
|
import { JSONObject } from '../static/Json';
|
|
@@ -35,13 +35,13 @@ export default class Signaling extends BaseSignaling {
|
|
|
35
35
|
private datachannelCommandsQueue;
|
|
36
36
|
private incomingCache;
|
|
37
37
|
private responseHandlers;
|
|
38
|
+
private disposed;
|
|
38
39
|
private connectionType;
|
|
39
40
|
private conversationResolve;
|
|
40
41
|
private conversationReject;
|
|
41
42
|
private connected;
|
|
42
43
|
private listenersReady;
|
|
43
44
|
private peerId;
|
|
44
|
-
private conversationId;
|
|
45
45
|
private connectionMessageWaitTimer;
|
|
46
46
|
private participantIdRegistry;
|
|
47
47
|
private producerNotificationDataChannel;
|
|
@@ -60,22 +60,17 @@ export default class Signaling extends BaseSignaling {
|
|
|
60
60
|
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
61
61
|
setEndpoint(endpoint: string): void;
|
|
62
62
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
63
|
-
setConversationId(conversationId: string): void;
|
|
64
63
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
65
64
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
66
65
|
setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
|
|
67
66
|
useCommandDataChannel(status: boolean): void;
|
|
68
|
-
/**
|
|
69
|
-
* Free used resources
|
|
70
|
-
*/
|
|
71
|
-
cleanup(): void;
|
|
72
67
|
/**
|
|
73
68
|
* Open a connection with a signaling server
|
|
74
69
|
*/
|
|
75
70
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
76
71
|
getNextCommandSequenceNumber(): number;
|
|
77
|
-
hangup(reason: string): Promise<SignalingMessage
|
|
78
|
-
sendCandidate(participantId: ParticipantId, candidate:
|
|
72
|
+
hangup(reason: string): Promise<SignalingMessage>;
|
|
73
|
+
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidateInit): Promise<SignalingMessage>;
|
|
79
74
|
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
80
75
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
81
76
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -138,10 +133,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
138
133
|
acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
|
|
139
134
|
feedback(key: string): Promise<SignalingMessage>;
|
|
140
135
|
getHandQueue(): Promise<SignalingMessage>;
|
|
141
|
-
|
|
142
|
-
* Close a connection with a signaling server
|
|
143
|
-
*/
|
|
144
|
-
close(): void;
|
|
136
|
+
dispose(cause?: Error): void;
|
|
145
137
|
/**
|
|
146
138
|
* Этот метод нужен т.к. после получения сообщения "connected" устанавливается транспорт
|
|
147
139
|
* и подписывается на сигналинг. Данные приходят очень быстро и транспорт пропускает
|
|
@@ -173,20 +165,25 @@ export default class Signaling extends BaseSignaling {
|
|
|
173
165
|
private _onError;
|
|
174
166
|
private _serializeErrorEvent;
|
|
175
167
|
private _onClose;
|
|
176
|
-
private
|
|
168
|
+
private _terminate;
|
|
169
|
+
private _fail;
|
|
177
170
|
private _isRecordCommand;
|
|
178
171
|
private _resolvePendingRecordCommands;
|
|
179
172
|
private _handleCommandResponse;
|
|
180
173
|
private _handleCommandsQueue;
|
|
181
174
|
private _startResponseTimer;
|
|
175
|
+
private _resolveCommandWithoutResponse;
|
|
182
176
|
private _serializeBinary;
|
|
183
177
|
private _serializeJson;
|
|
184
178
|
private _convertDisplayLayout;
|
|
185
179
|
private _waitConnectionMessage;
|
|
186
180
|
private _stopWaitConnectionMessage;
|
|
181
|
+
private _onTransportConnecting;
|
|
187
182
|
private _onTransportFailed;
|
|
188
183
|
private _onTransportReconnectScheduled;
|
|
189
184
|
private _onTransportConnectionDead;
|
|
185
|
+
private _attachNotificationCallError;
|
|
186
|
+
private _createSignalingCallError;
|
|
190
187
|
private _getSocketType;
|
|
191
188
|
private _markTransportStat;
|
|
192
189
|
private _logTransportStat;
|