@vkontakte/calls-sdk 2.8.11-dev.aeebd796.0 → 2.8.11-dev.b9508cee.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 +29 -38
- package/abstract/BaseApi.d.ts +5 -8
- package/abstract/BaseSignaling.d.ts +5 -7
- package/calls-sdk.cjs.js +9 -9
- package/calls-sdk.esm.js +4625 -3776
- package/classes/AudioFix.d.ts +5 -1
- package/classes/AudioOutput.d.ts +5 -1
- package/classes/CallRegistry.d.ts +26 -0
- package/classes/Conversation.d.ts +45 -13
- package/classes/ConversationResponseValidator.d.ts +3 -0
- package/classes/DebugInfo.d.ts +3 -0
- package/classes/DisplayLayoutRequester.d.ts +39 -0
- package/classes/ExternalIdCache.d.ts +19 -0
- package/classes/MediaSource.d.ts +12 -1
- package/classes/ParticipantIdRegistry.d.ts +3 -0
- package/classes/ProducerCommandSerializationService.d.ts +3 -0
- package/classes/SignalingActor.d.ts +3 -1
- package/classes/SpeakerDetector.d.ts +2 -1
- package/classes/SpecListener.d.ts +10 -1
- package/classes/{Logger.d.ts → StatsLogger.d.ts} +3 -13
- package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
- package/classes/asr/AsrReceiver.d.ts +3 -1
- package/classes/codec/LibVPxDecoder.d.ts +3 -0
- package/classes/codec/LibVPxEncoder.d.ts +3 -1
- package/classes/codec/WebCodecsDecoder.d.ts +3 -0
- package/classes/codec/WebCodecsEncoder.d.ts +3 -1
- package/classes/codec/WorkerBase.d.ts +7 -0
- package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
- package/classes/screenshare/CanvasRenderer.d.ts +3 -1
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
- package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
- package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
- package/classes/screenshare/StreamBuilder.d.ts +5 -1
- package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
- package/classes/screenshare/WebmBuilder.d.ts +3 -1
- package/classes/stat/CodecStatsAggregator.d.ts +7 -7
- package/classes/stat/ConversationStats.d.ts +21 -0
- package/classes/stat/StatAggregator.d.ts +6 -6
- package/classes/stat/StatFirstMediaReceived.d.ts +6 -2
- package/classes/stat/StatPings.d.ts +9 -9
- package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
- package/classes/stat/StatSignalingCommands.d.ts +8 -8
- package/classes/transport/BaseTransport.d.ts +1 -1
- package/classes/transport/DirectStatReporter.d.ts +3 -1
- package/classes/transport/DirectTransport.d.ts +12 -1
- package/classes/transport/PerfStatReporter.d.ts +5 -1
- package/classes/transport/ServerTransport.d.ts +10 -2
- package/classes/transport/Transport.d.ts +13 -14
- package/default/Api.d.ts +12 -19
- package/default/Signaling.d.ts +39 -45
- package/default/SignalingTransport.d.ts +68 -0
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingNotification.d.ts +3 -1
- package/enums/TransportState.d.ts +10 -0
- package/enums/TransportTopology.d.ts +5 -0
- package/package.json +1 -1
- package/static/Capabilities.d.ts +5 -0
- package/static/Debug.d.ts +27 -8
- package/static/External.d.ts +146 -71
- package/static/Params.d.ts +106 -78
- package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
- package/static/Utils.d.ts +3 -2
- package/static/WebRTCUtils.d.ts +6 -4
- package/types/Capabilities.d.ts +24 -0
- package/types/Conversation.d.ts +1 -1
- package/types/ExternalId.d.ts +1 -1
- package/types/FastStart.d.ts +1 -0
- package/types/Participant.d.ts +12 -1
- package/types/ParticipantLayout.d.ts +33 -0
- package/types/PushData.d.ts +3 -0
- package/types/SignalingMessage.d.ts +19 -2
- package/types/Statistics.d.ts +1 -1
- package/types/WebTransport.d.ts +4 -0
- package/utils/DebugStorage.d.ts +1 -2
- package/classes/stat/EventMetricsService.d.ts +0 -9
package/default/Signaling.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
|
+
import StatsLogger from '../classes/StatsLogger';
|
|
2
3
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
4
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
-
import {
|
|
5
|
+
import { StatAggregator } from '../classes/stat/StatAggregator';
|
|
6
|
+
import { StatPings } from '../classes/stat/StatPings';
|
|
7
|
+
import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
|
|
8
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
5
9
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
6
10
|
import ConversationOption from '../enums/ConversationOption';
|
|
7
11
|
import MediaOption from '../enums/MediaOption';
|
|
8
|
-
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
9
12
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
10
13
|
import UserRole from '../enums/UserRole';
|
|
14
|
+
import { type DebugLogger } from '../static/Debug';
|
|
11
15
|
import { JSONObject } from '../static/Json';
|
|
12
16
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
13
17
|
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
@@ -21,41 +25,39 @@ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/Partici
|
|
|
21
25
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
22
26
|
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
23
27
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
24
|
-
import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse
|
|
25
|
-
import { IPublishStreamData,
|
|
28
|
+
import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
|
|
29
|
+
import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
26
30
|
export default class Signaling extends BaseSignaling {
|
|
27
|
-
private
|
|
28
|
-
|
|
31
|
+
private transport;
|
|
32
|
+
private sequence;
|
|
29
33
|
private lastStamp;
|
|
30
34
|
private websocketCommandsQueue;
|
|
31
35
|
private datachannelCommandsQueue;
|
|
32
36
|
private incomingCache;
|
|
33
37
|
private responseHandlers;
|
|
34
38
|
private connectionType;
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private wtEndpoint;
|
|
38
|
-
protected conversationResolve: Function | null;
|
|
39
|
-
protected conversationReject: Function | null;
|
|
39
|
+
private conversationResolve;
|
|
40
|
+
private conversationReject;
|
|
40
41
|
private connected;
|
|
41
42
|
private listenersReady;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
private reconnectTimer;
|
|
43
|
+
private peerId;
|
|
44
|
+
private conversationId;
|
|
45
45
|
private connectionMessageWaitTimer;
|
|
46
|
-
private doctorTimer;
|
|
47
46
|
private participantIdRegistry;
|
|
48
47
|
private producerNotificationDataChannel;
|
|
49
48
|
private producerCommandDataChannel;
|
|
50
49
|
private producerCommandDataChannelEnabled;
|
|
51
50
|
private producerCommandSerializationService;
|
|
52
|
-
private
|
|
53
|
-
private
|
|
54
|
-
private
|
|
51
|
+
private readonly _debug;
|
|
52
|
+
private readonly _logger;
|
|
53
|
+
private readonly _statAggregator;
|
|
54
|
+
private readonly _statPings;
|
|
55
|
+
private readonly _statSignalingCommands;
|
|
55
56
|
private static get WAIT_CONNECTION_DELAY();
|
|
56
57
|
private static get WAIT_RESPONSE_DELAY();
|
|
57
|
-
private static get WAIT_MESSAGE_DELAY();
|
|
58
58
|
get ready(): boolean;
|
|
59
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, statPings?: StatPings | null, statSignalingCommands?: StatSignalingCommands | null);
|
|
60
|
+
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
59
61
|
setEndpoint(endpoint: string): void;
|
|
60
62
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
61
63
|
setConversationId(conversationId: string): void;
|
|
@@ -71,15 +73,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
71
73
|
* Open a connection with a signaling server
|
|
72
74
|
*/
|
|
73
75
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
74
|
-
/**
|
|
75
|
-
* Send a command to a signaling server
|
|
76
|
-
*/
|
|
77
|
-
protected _send<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
|
|
78
|
-
/**
|
|
79
|
-
* Send a raw command to a signaling server
|
|
80
|
-
*/
|
|
81
|
-
protected _sendRaw<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
|
|
82
|
-
private _isDataChannelCommand;
|
|
83
76
|
getNextCommandSequenceNumber(): number;
|
|
84
77
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
85
78
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
@@ -119,7 +112,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
119
112
|
startStream(data: IStartStreamData): Promise<SignalingMessage>;
|
|
120
113
|
stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
|
|
121
114
|
publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
|
|
122
|
-
recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
|
|
123
115
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
124
116
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
125
117
|
requestRealloc(): Promise<SignalingMessage>;
|
|
@@ -163,34 +155,36 @@ export default class Signaling extends BaseSignaling {
|
|
|
163
155
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
164
156
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
165
157
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Send a command to a signaling server
|
|
160
|
+
*/
|
|
161
|
+
private _send;
|
|
162
|
+
/**
|
|
163
|
+
* Send a raw command to a signaling server
|
|
164
|
+
*/
|
|
165
|
+
private _sendRaw;
|
|
166
|
+
private _isDataChannelCommand;
|
|
169
167
|
private _onOpen;
|
|
170
168
|
private _onMessage;
|
|
171
|
-
|
|
169
|
+
private _handleMessage;
|
|
172
170
|
private _handleErrorMessage;
|
|
173
|
-
|
|
171
|
+
private _handleCachedMessages;
|
|
174
172
|
private _throwError;
|
|
175
173
|
private _onError;
|
|
176
174
|
private _serializeErrorEvent;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
protected _reconnect(): void;
|
|
175
|
+
private _onClose;
|
|
176
|
+
private _closeSocket;
|
|
180
177
|
private _handleCommandResponse;
|
|
181
178
|
private _handleCommandsQueue;
|
|
182
179
|
private _startResponseTimer;
|
|
183
180
|
private _serializeBinary;
|
|
184
181
|
private _serializeJson;
|
|
185
182
|
private _convertDisplayLayout;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
private _startDoctor;
|
|
192
|
-
private _stopDoctor;
|
|
193
|
-
private isWebTransportAvailable;
|
|
183
|
+
private _waitConnectionMessage;
|
|
184
|
+
private _stopWaitConnectionMessage;
|
|
185
|
+
private _onTransportFailed;
|
|
186
|
+
private _onTransportReconnectScheduled;
|
|
187
|
+
private _onTransportConnectionDead;
|
|
194
188
|
private _getSocketType;
|
|
195
189
|
private _markTransportStat;
|
|
196
190
|
private _logTransportStat;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
2
|
+
import { SignalingTransportType } from '../enums/SignalingTransportStat';
|
|
3
|
+
export declare enum SignalingTransportFailure {
|
|
4
|
+
EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
|
|
5
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
6
|
+
ABORTED = "ABORTED"
|
|
7
|
+
}
|
|
8
|
+
export type SignalingTransportFailedEvent = {
|
|
9
|
+
failure: SignalingTransportFailure;
|
|
10
|
+
message: string;
|
|
11
|
+
remote?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type SignalingTransportReconnectEvent = {
|
|
14
|
+
count: number;
|
|
15
|
+
delay: number;
|
|
16
|
+
};
|
|
17
|
+
export type SignalingTransportHandlers = {
|
|
18
|
+
onOpen: () => void;
|
|
19
|
+
onMessage: (event: MessageEvent) => void;
|
|
20
|
+
onError: (event: Event) => void;
|
|
21
|
+
onClose: (event: CloseEvent) => void;
|
|
22
|
+
onFailed: (event: SignalingTransportFailedEvent) => void;
|
|
23
|
+
onReconnectScheduled: (event: SignalingTransportReconnectEvent) => void;
|
|
24
|
+
onConnectionDead: () => void;
|
|
25
|
+
};
|
|
26
|
+
export default class SignalingTransport {
|
|
27
|
+
private readonly handlers;
|
|
28
|
+
private socket;
|
|
29
|
+
private endpoint;
|
|
30
|
+
private wtEndpoint;
|
|
31
|
+
private peerId;
|
|
32
|
+
private lastStamp;
|
|
33
|
+
private connectionType;
|
|
34
|
+
private reconnectCount;
|
|
35
|
+
private reconnectTimer;
|
|
36
|
+
private doctorTimer;
|
|
37
|
+
private forceWebSocket;
|
|
38
|
+
private abortSignal;
|
|
39
|
+
private manualClose;
|
|
40
|
+
private currentType;
|
|
41
|
+
constructor(handlers: SignalingTransportHandlers);
|
|
42
|
+
get readyState(): number | null;
|
|
43
|
+
get type(): SignalingTransportType;
|
|
44
|
+
setEndpoint(endpoint: string): void;
|
|
45
|
+
setWebTransportEndpoint(endpoint: string | null): void;
|
|
46
|
+
setPeerId(peerId: number | null): void;
|
|
47
|
+
setLastStamp(lastStamp: number): void;
|
|
48
|
+
setAbortSignal(signal?: AbortSignal): void;
|
|
49
|
+
resetReconnectCount(): void;
|
|
50
|
+
connect(connectionType: SignalingConnectionType): void;
|
|
51
|
+
close(code?: number): void;
|
|
52
|
+
send(data: string | ArrayBuffer): void;
|
|
53
|
+
private _connect;
|
|
54
|
+
private _connectWebTransport;
|
|
55
|
+
private _connectWebSocket;
|
|
56
|
+
private _setSocketHandlers;
|
|
57
|
+
private _buildUrl;
|
|
58
|
+
private _canUseWebTransport;
|
|
59
|
+
private _onOpen;
|
|
60
|
+
private _onMessage;
|
|
61
|
+
private _onError;
|
|
62
|
+
private _onClose;
|
|
63
|
+
private _disconnect;
|
|
64
|
+
private _scheduleReconnect;
|
|
65
|
+
private _getReconnectDelay;
|
|
66
|
+
private _startDoctor;
|
|
67
|
+
private _stopDoctor;
|
|
68
|
+
}
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ declare enum HangupType {
|
|
|
53
53
|
* - Приложение вызываемого не запущено или упало
|
|
54
54
|
* - Брандмауэр или сетевые ограничения блокируют подключение
|
|
55
55
|
*/
|
|
56
|
-
CALL_TIMEOUT = "CALL_TIMEOUT"
|
|
56
|
+
CALL_TIMEOUT = "CALL_TIMEOUT",
|
|
57
|
+
OBSOLETE_CLIENT = "OBSOLETE_CLIENT"
|
|
57
58
|
}
|
|
58
59
|
export default HangupType;
|
|
@@ -24,6 +24,7 @@ declare enum SignalingNotification {
|
|
|
24
24
|
REALLOC_CON = "realloc-con",
|
|
25
25
|
AUDIO_ACTIVITY = "audio-activity",
|
|
26
26
|
SPEAKER_CHANGED = "speaker-changed",
|
|
27
|
+
SESSION_STATE = "session-state",
|
|
27
28
|
STALLED_ACTIVITY = "stalled-activity",
|
|
28
29
|
CHAT_MESSAGE = "chat-message",
|
|
29
30
|
CUSTOM_DATA = "custom-data",
|
|
@@ -50,6 +51,7 @@ declare enum SignalingNotification {
|
|
|
50
51
|
ASR_STARTED = "asr-started",
|
|
51
52
|
ASR_STOPPED = "asr-stopped",
|
|
52
53
|
DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed",
|
|
53
|
-
VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
|
|
54
|
+
VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest",
|
|
55
|
+
HOLD = "hold"
|
|
54
56
|
}
|
|
55
57
|
export default SignalingNotification;
|
package/package.json
CHANGED
package/static/Debug.d.ts
CHANGED
|
@@ -7,14 +7,33 @@ export declare enum DebugMessageType {
|
|
|
7
7
|
WARN = "WARN",
|
|
8
8
|
ERROR = "ERROR"
|
|
9
9
|
}
|
|
10
|
+
export type DebugMessageContext = {
|
|
11
|
+
readonly sessionId: string | null;
|
|
12
|
+
readonly conversationId: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type DebugLogger = {
|
|
15
|
+
debug(...args: any[]): void;
|
|
16
|
+
log(...args: any[]): void;
|
|
17
|
+
warn(...args: any[]): void;
|
|
18
|
+
error(...args: any[]): void;
|
|
19
|
+
};
|
|
20
|
+
export type DebugSessionLogger = DebugLogger & {
|
|
21
|
+
readonly sessionId: string | null;
|
|
22
|
+
readonly conversationId: string | null;
|
|
23
|
+
setConversationId(conversationId: string | null): void;
|
|
24
|
+
};
|
|
10
25
|
declare namespace Debug {
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
26
|
+
type ContextProvider = () => DebugMessageContext;
|
|
27
|
+
export function debug(...args: any[]): void;
|
|
28
|
+
export function log(...args: any[]): void;
|
|
29
|
+
export function warn(...args: any[]): void;
|
|
30
|
+
export function error(...args: any[]): void;
|
|
31
|
+
export function enabled(): boolean;
|
|
32
|
+
export function toggle(enable: boolean): void;
|
|
33
|
+
export function send(type: DebugMessageType, ...args: any[]): void;
|
|
34
|
+
export function createLogger(getContext: ContextProvider): DebugLogger;
|
|
35
|
+
export function createSessionLogger(initialConversationId?: string | null): DebugSessionLogger;
|
|
36
|
+
export function test(tag: string, ...args: any[]): void;
|
|
37
|
+
export {};
|
|
19
38
|
}
|
|
20
39
|
export default Debug;
|