@vkontakte/calls-sdk 2.8.11-dev.cb5b05f6.0 → 2.8.11-dev.d5496fb5.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 +61 -36
- package/abstract/BaseApi.d.ts +5 -9
- package/abstract/BaseSignaling.d.ts +5 -7
- package/calls-sdk.cjs.js +16 -13
- package/calls-sdk.esm.js +12192 -13
- 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 +44 -12
- 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/StatsLogger.d.ts +26 -0
- 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 +11 -15
- package/default/Signaling.d.ts +40 -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 +7 -4
- package/types/Capabilities.d.ts +24 -0
- package/types/Conversation.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/PerfStatReporter.d.ts +2 -1
- 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 +5 -0
- package/utils/DebugStorage.d.ts +100 -1
- package/classes/Logger.d.ts +0 -41
- package/classes/stat/EventMetricsService.d.ts +0 -9
- package/static/ConversationDebugLogger.d.ts +0 -13
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,42 +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
|
-
private
|
|
43
|
-
|
|
44
|
-
protected conversationId: string | null;
|
|
45
|
-
private reconnectTimer;
|
|
43
|
+
private peerId;
|
|
44
|
+
private conversationId;
|
|
46
45
|
private connectionMessageWaitTimer;
|
|
47
|
-
private doctorTimer;
|
|
48
46
|
private participantIdRegistry;
|
|
49
47
|
private producerNotificationDataChannel;
|
|
50
48
|
private producerCommandDataChannel;
|
|
51
49
|
private producerCommandDataChannelEnabled;
|
|
52
50
|
private producerCommandSerializationService;
|
|
53
|
-
private
|
|
54
|
-
private
|
|
55
|
-
private
|
|
51
|
+
private readonly _debug;
|
|
52
|
+
private readonly _logger;
|
|
53
|
+
private readonly _statAggregator;
|
|
54
|
+
private readonly _statPings;
|
|
55
|
+
private readonly _statSignalingCommands;
|
|
56
56
|
private static get WAIT_CONNECTION_DELAY();
|
|
57
57
|
private static get WAIT_RESPONSE_DELAY();
|
|
58
|
-
private static get WAIT_MESSAGE_DELAY();
|
|
59
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;
|
|
60
61
|
setEndpoint(endpoint: string): void;
|
|
61
62
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
62
63
|
setConversationId(conversationId: string): void;
|
|
@@ -72,15 +73,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
72
73
|
* Open a connection with a signaling server
|
|
73
74
|
*/
|
|
74
75
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
75
|
-
/**
|
|
76
|
-
* Send a command to a signaling server
|
|
77
|
-
*/
|
|
78
|
-
protected _send<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
|
|
79
|
-
/**
|
|
80
|
-
* Send a raw command to a signaling server
|
|
81
|
-
*/
|
|
82
|
-
protected _sendRaw<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
|
|
83
|
-
private _isDataChannelCommand;
|
|
84
76
|
getNextCommandSequenceNumber(): number;
|
|
85
77
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
86
78
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
@@ -120,7 +112,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
120
112
|
startStream(data: IStartStreamData): Promise<SignalingMessage>;
|
|
121
113
|
stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
|
|
122
114
|
publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
|
|
123
|
-
recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
|
|
124
115
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
125
116
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
126
117
|
requestRealloc(): Promise<SignalingMessage>;
|
|
@@ -164,32 +155,36 @@ export default class Signaling extends BaseSignaling {
|
|
|
164
155
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
165
156
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
166
157
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
private _serializeErrorEvent;
|
|
175
|
+
private _onClose;
|
|
176
|
+
private _closeSocket;
|
|
179
177
|
private _handleCommandResponse;
|
|
180
178
|
private _handleCommandsQueue;
|
|
181
179
|
private _startResponseTimer;
|
|
182
180
|
private _serializeBinary;
|
|
183
181
|
private _serializeJson;
|
|
184
182
|
private _convertDisplayLayout;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
private _startDoctor;
|
|
191
|
-
private _stopDoctor;
|
|
192
|
-
private isWebTransportAvailable;
|
|
183
|
+
private _waitConnectionMessage;
|
|
184
|
+
private _stopWaitConnectionMessage;
|
|
185
|
+
private _onTransportFailed;
|
|
186
|
+
private _onTransportReconnectScheduled;
|
|
187
|
+
private _onTransportConnectionDead;
|
|
193
188
|
private _getSocketType;
|
|
194
189
|
private _markTransportStat;
|
|
195
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|