@vkontakte/calls-sdk 2.8.12-dev.a3089173.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 +2758 -2104
- package/classes/CallRegistry.d.ts +5 -1
- package/classes/ExternalIdCache.d.ts +11 -12
- package/classes/MediaSource.d.ts +4 -0
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +44 -37
- 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} +7 -5
- 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 -11
- 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/AuthData.d.ts +10 -0
- 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
package/CallsSDK.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import Api from './default/Api';
|
|
|
14
14
|
import Signaling from './default/Signaling';
|
|
15
15
|
import CallDirection from './enums/CallDirection';
|
|
16
16
|
import CallType from './enums/CallType';
|
|
17
|
+
import type ClientHangupReason from './enums/ClientHangupReason';
|
|
17
18
|
import ChatRoomEventType from './enums/ChatRoomEventType';
|
|
18
19
|
import ConversationFeature from './enums/ConversationFeature';
|
|
19
20
|
import ConversationOption from './enums/ConversationOption';
|
|
@@ -272,8 +273,14 @@ export declare function authorize(authToken?: string, apiBaseUrl?: IAPIBaseUrl):
|
|
|
272
273
|
export declare function acceptCall(mediaOptions?: MediaOption[], conversationId?: string): Promise<ConversationData>;
|
|
273
274
|
/**
|
|
274
275
|
* Отклонить входящий звонок
|
|
276
|
+
*
|
|
277
|
+
* @param conversationId ID звонка
|
|
278
|
+
* @param params.reason Причина завершения для проброса в сигналинг
|
|
279
|
+
* (по умолчанию `REJECTED`). См. {@link ClientHangupReason}.
|
|
275
280
|
*/
|
|
276
|
-
export declare function declineCall(conversationId?: string
|
|
281
|
+
export declare function declineCall(conversationId?: string, params?: {
|
|
282
|
+
reason?: ClientHangupReason;
|
|
283
|
+
}): Promise<void>;
|
|
277
284
|
/**
|
|
278
285
|
* Присоединиться к активному звонку
|
|
279
286
|
*
|
|
@@ -295,8 +302,14 @@ export declare function joinCallInternal(conversationId: string, mediaOptions: M
|
|
|
295
302
|
export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOption[], anonymToken?: string, observedIds?: ExternalUserId[], payload?: string, onFastJoin?: FastJoinHandler): Promise<ConversationData>;
|
|
296
303
|
/**
|
|
297
304
|
* Завершить текущий разговор
|
|
305
|
+
*
|
|
306
|
+
* @param conversationId ID звонка
|
|
307
|
+
* @param params.reason Причина завершения для проброса в сигналинг.
|
|
308
|
+
* По умолчанию `HUNGUP` (если звонок активен) или `CANCELED`. См. {@link ClientHangupReason}.
|
|
298
309
|
*/
|
|
299
|
-
export declare function hangup(conversationId?: string
|
|
310
|
+
export declare function hangup(conversationId?: string, params?: {
|
|
311
|
+
reason?: ClientHangupReason;
|
|
312
|
+
}): Promise<void>;
|
|
300
313
|
/**
|
|
301
314
|
* Добавить собеседника в звонок
|
|
302
315
|
*
|
|
@@ -769,9 +782,6 @@ export declare function stopAsr(params?: IAsrStopParams): Promise<void>;
|
|
|
769
782
|
export declare function requestAsr(request: boolean): Promise<void>;
|
|
770
783
|
export declare function startUrlSharing(sharedUrl: string): Promise<void>;
|
|
771
784
|
export declare function stopUrlSharing(): Promise<void>;
|
|
772
|
-
export declare function sendTestCommand(name: string, params?: any): void;
|
|
773
|
-
export declare function startAnalyzingAudio(expectAudio: boolean, expectedActiveTracks?: number | null, expectedTrackFrequencies?: number[] | null): void;
|
|
774
|
-
export declare function stopAnalyzingAudio(): void;
|
|
775
785
|
export declare function switchCall(conversationId: string): Promise<void>;
|
|
776
786
|
export declare function getActiveCallId(): string | null;
|
|
777
787
|
/**
|
|
@@ -784,5 +794,5 @@ export declare function getSyncedTime(): number;
|
|
|
784
794
|
* Версия SDK
|
|
785
795
|
*/
|
|
786
796
|
export declare function version(): string;
|
|
787
|
-
export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, CustomError, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, DisplayLayoutRequest, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAPIBaseUrl, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, ParticipantStateData, ParticipantStateDataKey, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, ParticipantListMarker, RequestKeyFrame, Rooms, IGetParticipantsParameters, ScreenCaptureSettings, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IMovieMetaData, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IRoomId, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, IMuteParticipantParams, IMuteParticipantInternalParams, IStartStreamData, IStopStreamData, IPublishStreamData, VmojiError, FastStartHandler, FastStartParams, FastJoinHandler, FastJoinParams, FastJoinResponse, };
|
|
797
|
+
export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, CustomError, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, DisplayLayoutRequest, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAPIBaseUrl, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, ParticipantStateData, ParticipantStateDataKey, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, ParticipantListMarker, RequestKeyFrame, Rooms, IGetParticipantsParameters, ScreenCaptureSettings, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IMovieMetaData, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IRoomId, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, IMuteParticipantParams, IMuteParticipantInternalParams, IStartStreamData, IStopStreamData, IPublishStreamData, VmojiError, FastStartHandler, FastStartParams, FastJoinHandler, FastJoinParams, FastJoinResponse, };
|
|
788
798
|
export { Api, AuthData, BaseLogger, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStateDataValue, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
|
package/abstract/BaseApi.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ConversationData } from '../types/Conversation';
|
|
|
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 type ClientStats = {
|
|
10
10
|
call_topology: 'D' | 'S';
|
|
@@ -38,7 +38,7 @@ export default abstract class BaseApi {
|
|
|
38
38
|
*/
|
|
39
39
|
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
40
40
|
abstract authorize(): Promise<void>;
|
|
41
|
-
abstract userId(participantId: ParticipantId): ExternalParticipantId;
|
|
41
|
+
abstract userId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
42
42
|
abstract deviceId(): string;
|
|
43
43
|
abstract createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, createConversationParameters?: {
|
|
44
44
|
onlyAdminCanShareMovie?: boolean;
|
|
@@ -72,13 +72,11 @@ export default abstract class BaseApi {
|
|
|
72
72
|
logClientStats(items: ClientStats[]): void;
|
|
73
73
|
abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
74
74
|
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
getDecorativeIdByInitialId(okId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
81
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
75
|
+
getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
76
|
+
cacheExternalId(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
77
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
78
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
79
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
82
80
|
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
83
81
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
84
82
|
getServerTime(): Promise<number>;
|
|
@@ -42,6 +42,9 @@ export interface AddParticipantParams {
|
|
|
42
42
|
*/
|
|
43
43
|
payload?: string;
|
|
44
44
|
}
|
|
45
|
+
export declare class SignalingDisposedError extends Error {
|
|
46
|
+
constructor(command?: string);
|
|
47
|
+
}
|
|
45
48
|
/**
|
|
46
49
|
* Should trigger SignalingEvent.NOTIFICATION on notification message and SignalingEvent.FAILED on error
|
|
47
50
|
* https://wiki.odkl.ru/display/projects/Signaling+API#SignalingAPI-Notifications
|
|
@@ -55,11 +58,11 @@ export default abstract class BaseSignaling extends EventEmitter {
|
|
|
55
58
|
*/
|
|
56
59
|
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
57
60
|
abstract connect(connectionType: SignalingConnectionType, conversation?: ConversationResponse): Promise<SignalingMessage.Connection>;
|
|
58
|
-
abstract
|
|
61
|
+
abstract dispose(cause?: Error): void;
|
|
59
62
|
abstract hangup(reason: string): Promise<SignalingMessage | void>;
|
|
60
63
|
abstract acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
61
64
|
abstract sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
62
|
-
abstract sendCandidate(participantId: ParticipantId, candidate:
|
|
65
|
+
abstract sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidateInit): Promise<SignalingMessage>;
|
|
63
66
|
abstract changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
64
67
|
abstract changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
|
|
65
68
|
abstract hold(hold: boolean, capabilities?: TCapabilities): Promise<SignalingMessage>;
|
|
@@ -130,9 +133,7 @@ export default abstract class BaseSignaling extends EventEmitter {
|
|
|
130
133
|
requestRealloc(): void;
|
|
131
134
|
setEndpoint(endpoint: string): void;
|
|
132
135
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
133
|
-
setConversationId(conversationId: string): void;
|
|
134
136
|
readyToSend(isReady?: boolean): void;
|
|
135
|
-
|
|
136
|
-
requestTestMode(consumerCommand: string, producerCommand: string | null): void;
|
|
137
|
+
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage | void>;
|
|
137
138
|
getNextCommandSequenceNumber(): number;
|
|
138
139
|
}
|