@vkontakte/calls-sdk 2.8.12-dev.e23c81f4.0 → 2.8.12-dev.ec5956ec.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.
Files changed (39) hide show
  1. package/CallsSDK.d.ts +20 -6
  2. package/abstract/BaseApi.d.ts +1 -0
  3. package/abstract/BaseSignaling.d.ts +5 -4
  4. package/calls-sdk.cjs.js +9 -9
  5. package/calls-sdk.esm.js +3706 -2907
  6. package/classes/CallRegistry.d.ts +5 -1
  7. package/classes/ExternalIdCache.d.ts +1 -0
  8. package/classes/StatsLogger.d.ts +17 -2
  9. package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +49 -47
  10. package/classes/conversation/Conversation.testUtils.d.ts +148 -0
  11. package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
  12. package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +5 -5
  13. package/classes/conversation/index.d.ts +1 -0
  14. package/classes/stat/CallFinishClassifier.d.ts +11 -0
  15. package/classes/stat/CallLifecycleStats.d.ts +42 -0
  16. package/classes/stat/ConversationStats.d.ts +5 -4
  17. package/classes/stat/FirstMediaSentProbe.d.ts +13 -0
  18. package/classes/stat/StatPings.d.ts +1 -2
  19. package/classes/stat/StatSignalingCommands.d.ts +1 -2
  20. package/classes/transport/BaseTransport.d.ts +7 -1
  21. package/classes/transport/DirectTransport.d.ts +2 -1
  22. package/classes/transport/ServerTransport.d.ts +2 -1
  23. package/classes/transport/Transport.d.ts +6 -1
  24. package/default/Api.d.ts +1 -2
  25. package/default/Signaling.d.ts +11 -14
  26. package/default/SignalingTransport.d.ts +10 -2
  27. package/enums/ClientHangupReason.d.ts +7 -0
  28. package/enums/HangupType.d.ts +0 -1
  29. package/enums/Stat.d.ts +5 -1
  30. package/package.json +1 -1
  31. package/static/AuthData.d.ts +10 -0
  32. package/static/Debug.d.ts +1 -0
  33. package/static/External.d.ts +1 -1
  34. package/static/Params.d.ts +1 -10
  35. package/static/WebRTCUtils.d.ts +4 -0
  36. package/types/Conversation.d.ts +12 -2
  37. package/types/SignalingMessage.d.ts +5 -1
  38. package/types/WebTransport.d.ts +17 -16
  39. package/utils/IceServers.d.ts +2 -0
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): Promise<void>;
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): Promise<void>;
310
+ export declare function hangup(conversationId?: string, params?: {
311
+ reason?: ClientHangupReason;
312
+ }): Promise<void>;
300
313
  /**
301
314
  * Добавить собеседника в звонок
302
315
  *
@@ -635,6 +648,10 @@ export declare function debug(enabled: boolean): void;
635
648
  * @param args
636
649
  */
637
650
  export declare function debugMessage(type: DebugMessageType, ...args: any[]): void;
651
+ /**
652
+ * Добавить сообщение в отладочный лог конкретного звонка.
653
+ */
654
+ export declare function debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): void;
638
655
  /**
639
656
  * Локальные отладочные логи, сохраненные в браузере.
640
657
  *
@@ -765,9 +782,6 @@ export declare function stopAsr(params?: IAsrStopParams): Promise<void>;
765
782
  export declare function requestAsr(request: boolean): Promise<void>;
766
783
  export declare function startUrlSharing(sharedUrl: string): Promise<void>;
767
784
  export declare function stopUrlSharing(): Promise<void>;
768
- export declare function sendTestCommand(name: string, params?: any): void;
769
- export declare function startAnalyzingAudio(expectAudio: boolean, expectedActiveTracks?: number | null, expectedTrackFrequencies?: number[] | null): void;
770
- export declare function stopAnalyzingAudio(): void;
771
785
  export declare function switchCall(conversationId: string): Promise<void>;
772
786
  export declare function getActiveCallId(): string | null;
773
787
  /**
@@ -780,5 +794,5 @@ export declare function getSyncedTime(): number;
780
794
  * Версия SDK
781
795
  */
782
796
  export declare function version(): string;
783
- 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, };
784
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, };
@@ -7,6 +7,7 @@ import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/Exte
7
7
  import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
8
8
  import PushData from '../types/PushData';
9
9
  export type ClientStats = {
10
+ call_topology: 'D' | 'S';
10
11
  vcid: ConversationData['id'] | null;
11
12
  [k: string]: string | number | boolean | null;
12
13
  };
@@ -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,7 +58,7 @@ 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 close(): void;
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>;
@@ -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
- cleanup(): void;
136
- requestTestMode(consumerCommand: string, producerCommand: string | null): void;
137
+ requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage | void>;
137
138
  getNextCommandSequenceNumber(): number;
138
139
  }