@vkontakte/calls-sdk 2.8.11-dev.a7bd7233.0 → 2.8.11-dev.ad82f51b.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 +2 -9
- package/abstract/BaseApi.d.ts +3 -4
- package/calls-sdk.cjs.js +9 -9
- package/calls-sdk.esm.js +1789 -1120
- package/classes/CallRegistry.d.ts +1 -0
- package/classes/Conversation.d.ts +29 -17
- package/classes/ConversationResponseValidator.d.ts +3 -0
- package/classes/StatsLogger.d.ts +17 -5
- package/classes/codec/WorkerBase.d.ts +2 -0
- package/classes/stat/CallLifecycleStats.d.ts +47 -0
- package/classes/stat/ConversationStats.d.ts +5 -4
- package/classes/stat/FirstMediaSentProbe.d.ts +13 -0
- package/classes/stat/StatFirstMediaReceived.d.ts +2 -1
- package/classes/stat/StatPings.d.ts +1 -2
- package/classes/stat/StatSignalingCommands.d.ts +1 -2
- package/classes/transport/BaseTransport.d.ts +7 -1
- package/classes/transport/DirectTransport.d.ts +6 -1
- package/classes/transport/ServerTransport.d.ts +1 -1
- package/classes/transport/Transport.d.ts +8 -1
- package/default/Api.d.ts +8 -2
- package/default/Signaling.d.ts +29 -45
- package/default/SignalingTransport.d.ts +68 -0
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingNotification.d.ts +1 -0
- package/enums/Stat.d.ts +6 -1
- package/package.json +1 -1
- package/static/Params.d.ts +8 -8
- package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
- package/types/Conversation.d.ts +12 -2
- package/types/Participant.d.ts +11 -1
- package/types/PushData.d.ts +3 -0
- package/types/SignalingMessage.d.ts +11 -1
- package/types/WebTransport.d.ts +4 -0
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",
|
package/enums/Stat.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
declare const enum Stat {
|
|
2
|
+
CALL_INIT = "call_init",
|
|
3
|
+
CALL_WARMUP = "call_warmup",
|
|
4
|
+
CALL_START = "call_start",
|
|
5
|
+
CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing",
|
|
6
|
+
CALL_ACCEPTED_INCOMING = "call_accepted_incoming",
|
|
7
|
+
FIRST_MEDIA_SENT = "first_media_sent",
|
|
2
8
|
CALL_FINISH = "call_finish",// событие отправляемое в конце звонка
|
|
3
9
|
CODEC_USAGE = "codec_usage",// событие когда меняется кодек
|
|
4
10
|
SIGNALING_CONNECTED = "signaling_connected",// measure
|
|
@@ -7,7 +13,6 @@ declare const enum Stat {
|
|
|
7
13
|
FIRST_MEDIA_RECEIVED = "first_media_received",
|
|
8
14
|
CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally",
|
|
9
15
|
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
|
|
10
|
-
CALL_START = "call_start",
|
|
11
16
|
SIGNALING_PING_SUMMARY = "signaling_ping_summary",
|
|
12
17
|
SIGNALING_COMMAND_SUMMARY = "signaling_command_summary",
|
|
13
18
|
WEBSOCKET_CONNECTED = "websocket_connected",
|
package/package.json
CHANGED
package/static/Params.d.ts
CHANGED
|
@@ -256,13 +256,6 @@ export type ParamsObject = {
|
|
|
256
256
|
perfStatReportEnabled: boolean;
|
|
257
257
|
/** @hidden */
|
|
258
258
|
callStatReportEnabled: boolean;
|
|
259
|
-
/**
|
|
260
|
-
* Включает логирование событий продуктовой статистики.
|
|
261
|
-
*
|
|
262
|
-
* _По умолчанию: `false`_
|
|
263
|
-
* @hidden
|
|
264
|
-
*/
|
|
265
|
-
clientEventsLoggingEnabled: boolean;
|
|
266
259
|
/**
|
|
267
260
|
* Отдавать приоритет кодеку H264 для исходящего видео
|
|
268
261
|
*
|
|
@@ -500,6 +493,12 @@ export type ParamsObject = {
|
|
|
500
493
|
* _По умолчанию: `false`_
|
|
501
494
|
*/
|
|
502
495
|
transparentAudio: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Включить получение обновлений состояния медийной сессии участников
|
|
498
|
+
*
|
|
499
|
+
* _По умолчанию: `false`_
|
|
500
|
+
*/
|
|
501
|
+
enableSessionStateUpdates: boolean;
|
|
503
502
|
/**
|
|
504
503
|
* Получен локальный стрим с камеры/микрофона
|
|
505
504
|
*/
|
|
@@ -977,7 +976,6 @@ export default abstract class Params {
|
|
|
977
976
|
static get networkStatisticsInterval(): number;
|
|
978
977
|
static get perfStatReportEnabled(): boolean;
|
|
979
978
|
static get callStatReportEnabled(): boolean;
|
|
980
|
-
static get clientEventsLoggingEnabled(): boolean;
|
|
981
979
|
static get enableLogPerfStatReport(): boolean;
|
|
982
980
|
static get asrDataChannel(): boolean;
|
|
983
981
|
static get consumerScreenDataChannelPacketSize(): number;
|
|
@@ -1021,6 +1019,7 @@ export default abstract class Params {
|
|
|
1021
1019
|
static get webtransport(): boolean;
|
|
1022
1020
|
static get webtransportFF(): boolean;
|
|
1023
1021
|
static get transparentAudio(): boolean;
|
|
1022
|
+
static get enableSessionStateUpdates(): boolean;
|
|
1024
1023
|
static toJSON(): {
|
|
1025
1024
|
apiKey: string;
|
|
1026
1025
|
apiEnv: string;
|
|
@@ -1056,5 +1055,6 @@ export default abstract class Params {
|
|
|
1056
1055
|
webtransport: boolean;
|
|
1057
1056
|
webtransportFF: boolean;
|
|
1058
1057
|
transparentAudio: boolean;
|
|
1058
|
+
enableSessionStateUpdates: boolean;
|
|
1059
1059
|
};
|
|
1060
1060
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ParticipantConnectionStatus, ParticipantSessionState } from '../types/Participant';
|
|
2
|
+
import { ParticipantStatus } from './External';
|
|
3
|
+
import TransportState from '../enums/TransportState';
|
|
4
|
+
type StatusTransition = {
|
|
5
|
+
status: ParticipantStatus;
|
|
6
|
+
shouldNotify: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare namespace ParticipantConnectionStatusUtils {
|
|
9
|
+
function create(status?: Partial<ParticipantConnectionStatus> | null): ParticipantConnectionStatus;
|
|
10
|
+
function fromTransportState(state?: TransportState): ParticipantStatus | null;
|
|
11
|
+
function computeEffective(status: ParticipantConnectionStatus): ParticipantStatus;
|
|
12
|
+
function setSessionState(status: ParticipantConnectionStatus, sessionState?: ParticipantSessionState, sessionStateConnectedBySpeaker?: boolean): StatusTransition;
|
|
13
|
+
function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
|
|
14
|
+
function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
|
|
15
|
+
}
|
|
16
|
+
export default ParticipantConnectionStatusUtils;
|
package/types/Conversation.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import MediaOption from '../enums/MediaOption';
|
|
|
7
7
|
import UserRole from '../enums/UserRole';
|
|
8
8
|
import { AsrInfo } from './Asr';
|
|
9
9
|
import { IFeaturesPerRole } from './ConversationFeature';
|
|
10
|
-
import { ExternalId, ExternalParticipantId } from './ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipantId, ExternalUserId } from './ExternalId';
|
|
11
|
+
import { FastJoinHandler } from './FastJoin';
|
|
11
12
|
import { FastStartHandler } from './FastStart';
|
|
12
13
|
import MediaModifiers from './MediaModifiers';
|
|
13
14
|
import MuteStates from './MuteStates';
|
|
@@ -84,6 +85,16 @@ export type ConversationOnStartParams = {
|
|
|
84
85
|
onFastStart?: FastStartHandler;
|
|
85
86
|
conversationId?: string;
|
|
86
87
|
};
|
|
88
|
+
export type ConversationOnJoinParams = {
|
|
89
|
+
conversationId?: string;
|
|
90
|
+
mediaOptions: MediaOption[];
|
|
91
|
+
chatId?: string;
|
|
92
|
+
joinLink?: string;
|
|
93
|
+
observedIds?: ExternalUserId[];
|
|
94
|
+
payload?: string;
|
|
95
|
+
onFastJoin?: FastJoinHandler;
|
|
96
|
+
anonymous?: boolean;
|
|
97
|
+
};
|
|
87
98
|
export type StartConversationParams = {
|
|
88
99
|
opponentIds?: OkUserId[];
|
|
89
100
|
opponentType: CallType;
|
|
@@ -94,7 +105,6 @@ export type StartConversationParams = {
|
|
|
94
105
|
requireAuthToJoin?: boolean;
|
|
95
106
|
onlyAdminCanShareMovie?: boolean;
|
|
96
107
|
externalIds?: ExternalId[];
|
|
97
|
-
startedTime: number;
|
|
98
108
|
onFastStart?: FastStartHandler;
|
|
99
109
|
conversationId?: string;
|
|
100
110
|
};
|
package/types/Participant.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ export interface ParticipantStateMapped {
|
|
|
44
44
|
ts: number;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
export interface ParticipantSessionState {
|
|
48
|
+
connected: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface ParticipantConnectionStatus {
|
|
51
|
+
transport: ParticipantStatus;
|
|
52
|
+
sessionState?: ParticipantSessionState;
|
|
53
|
+
sessionStateApplicable: boolean;
|
|
54
|
+
sessionStateConnectedBySpeaker: boolean;
|
|
55
|
+
lastEffective: ParticipantStatus;
|
|
56
|
+
}
|
|
47
57
|
/**
|
|
48
58
|
* Состояния участников звонка
|
|
49
59
|
*/
|
|
@@ -63,7 +73,6 @@ export interface Participant {
|
|
|
63
73
|
externalId: ExternalParticipantId;
|
|
64
74
|
mediaSettings: MediaSettings;
|
|
65
75
|
state: ParticipantState;
|
|
66
|
-
status: ParticipantStatus;
|
|
67
76
|
remoteStream?: MediaStream | null;
|
|
68
77
|
remoteAudioTrack?: MediaStreamTrack | null;
|
|
69
78
|
secondStream?: MediaStream | null;
|
|
@@ -73,6 +82,7 @@ export interface Participant {
|
|
|
73
82
|
roles: UserRole[];
|
|
74
83
|
participantState: ParticipantStateMapped;
|
|
75
84
|
isOnHold?: boolean;
|
|
85
|
+
connectionStatus: ParticipantConnectionStatus;
|
|
76
86
|
networkRating: number;
|
|
77
87
|
lastRequestedLayouts: {
|
|
78
88
|
[key: StreamDescriptionString]: ParticipantLayout;
|
package/types/PushData.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import IceServer from './IceServer';
|
|
1
2
|
type PushData = {
|
|
2
3
|
caller_id: string;
|
|
3
4
|
caller_client_type?: string;
|
|
4
5
|
conversation_id: string;
|
|
5
6
|
endpoint: string;
|
|
7
|
+
wt_endpoint?: string;
|
|
8
|
+
turn_server?: IceServer;
|
|
6
9
|
is_video: boolean;
|
|
7
10
|
token: string;
|
|
8
11
|
sdp_offer?: string;
|
|
@@ -19,7 +19,7 @@ import MediaModifiers from './MediaModifiers';
|
|
|
19
19
|
import MediaSettings from './MediaSettings';
|
|
20
20
|
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
|
|
21
21
|
import MuteStates from './MuteStates';
|
|
22
|
-
import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
|
|
22
|
+
import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType, ParticipantSessionState } from './Participant';
|
|
23
23
|
import { MediaType, ParticipantStreamDescription } from './ParticipantStreamDescription';
|
|
24
24
|
import { IRoomId } from './Room';
|
|
25
25
|
import VideoSettings from './VideoSettings';
|
|
@@ -89,6 +89,7 @@ declare namespace SignalingMessage {
|
|
|
89
89
|
state: Record<string, string>;
|
|
90
90
|
stateUpdateTs: Record<string, number>;
|
|
91
91
|
};
|
|
92
|
+
sessionState?: ParticipantSessionState;
|
|
92
93
|
roles?: UserRole[];
|
|
93
94
|
peerId?: PeerId;
|
|
94
95
|
restricted?: boolean;
|
|
@@ -97,6 +98,7 @@ declare namespace SignalingMessage {
|
|
|
97
98
|
markers?: ParticipantListMarkers;
|
|
98
99
|
observedIds?: CompositeUserId[];
|
|
99
100
|
movieShareInfos?: ISharedMovieInfo[];
|
|
101
|
+
onHold?: boolean;
|
|
100
102
|
}
|
|
101
103
|
export interface ParticipantListChunk extends Notification {
|
|
102
104
|
participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
|
|
@@ -190,6 +192,7 @@ declare namespace SignalingMessage {
|
|
|
190
192
|
deviceIdx?: number;
|
|
191
193
|
peerId: PeerId;
|
|
192
194
|
reason: HangupType;
|
|
195
|
+
errorCode?: string;
|
|
193
196
|
markers?: ParticipantListMarkers;
|
|
194
197
|
}
|
|
195
198
|
export interface ClosedConversation extends Notification {
|
|
@@ -322,6 +325,13 @@ declare namespace SignalingMessage {
|
|
|
322
325
|
export interface SpeakerChanged extends Notification {
|
|
323
326
|
speaker: ParticipantId;
|
|
324
327
|
}
|
|
328
|
+
export interface SessionState extends Notification {
|
|
329
|
+
connected: boolean;
|
|
330
|
+
participantId: OkUserId;
|
|
331
|
+
participantType: UserType;
|
|
332
|
+
deviceIdx?: number;
|
|
333
|
+
markers?: ParticipantListMarkers;
|
|
334
|
+
}
|
|
325
335
|
export interface OptionsChanged extends Notification {
|
|
326
336
|
options: ConversationOption[];
|
|
327
337
|
}
|
package/types/WebTransport.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ declare class WebTransportEventual {
|
|
|
7
7
|
private readonly url;
|
|
8
8
|
private readonly options;
|
|
9
9
|
private readonly compression;
|
|
10
|
+
private closeRequested;
|
|
11
|
+
private closeEventEmitted;
|
|
10
12
|
private encoder;
|
|
11
13
|
private decoder;
|
|
12
14
|
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
@@ -22,6 +24,8 @@ declare class WebTransportEventual {
|
|
|
22
24
|
send(data: string): Promise<void>;
|
|
23
25
|
private createErrorEvent;
|
|
24
26
|
close(code?: number, reason?: string): void;
|
|
27
|
+
private closeConnectedTransport;
|
|
28
|
+
private emitClose;
|
|
25
29
|
static isBrowserSupported(): boolean;
|
|
26
30
|
}
|
|
27
31
|
export { WebTransportEventual as WebTransport };
|