@vkontakte/calls-sdk 2.8.13-dev.f163e503.0 → 2.8.13-dev.f6e48354.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 (49) hide show
  1. package/CallsSDK.d.ts +9 -2
  2. package/abstract/BaseApi.d.ts +12 -8
  3. package/calls-sdk.cjs.js +7 -7
  4. package/calls-sdk.esm.js +3121 -2348
  5. package/classes/AudioFix.d.ts +2 -2
  6. package/classes/AudioOutput.d.ts +3 -3
  7. package/classes/MediaSource.d.ts +6 -2
  8. package/classes/SpecListener.d.ts +2 -2
  9. package/classes/VolumesDetector.d.ts +0 -1
  10. package/classes/codec/LibVPxDecoder.d.ts +2 -2
  11. package/classes/codec/LibVPxEncoder.d.ts +2 -2
  12. package/classes/codec/WebCodecsDecoder.d.ts +2 -2
  13. package/classes/codec/WebCodecsEncoder.d.ts +2 -2
  14. package/classes/codec/WorkerBase.d.ts +3 -3
  15. package/classes/conversation/Conversation.d.ts +1 -0
  16. package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
  17. package/classes/screenshare/ScreenCaptureSender.d.ts +2 -2
  18. package/classes/screenshare/StreamBuilder.d.ts +2 -2
  19. package/classes/stat/ApiCallStats.d.ts +12 -0
  20. package/classes/stat/BatteryStats.d.ts +25 -0
  21. package/classes/stat/CallLifecycleStats.d.ts +2 -2
  22. package/classes/stat/CodecStatsAggregator.d.ts +2 -2
  23. package/classes/stat/ConversationStats.d.ts +16 -2
  24. package/classes/stat/StatAggregator.d.ts +10 -3
  25. package/classes/stat/StatClock.d.ts +28 -0
  26. package/classes/stat/StatDrainScheduler.d.ts +92 -0
  27. package/classes/stat/StatEventCollector.d.ts +50 -0
  28. package/classes/stat/StatPings.d.ts +2 -2
  29. package/classes/stat/StatQueue.d.ts +79 -0
  30. package/classes/stat/StatSignalingCommands.d.ts +2 -2
  31. package/classes/stat/StatUnloadJournal.d.ts +27 -0
  32. package/classes/transport/DirectTransport.d.ts +6 -2
  33. package/classes/transport/ServerTransport.d.ts +2 -2
  34. package/classes/transport/SimulcastSender.d.ts +2 -2
  35. package/classes/transport/Transport.d.ts +2 -2
  36. package/default/Api.d.ts +10 -1
  37. package/default/Signaling.d.ts +11 -3
  38. package/enums/SessionError.d.ts +10 -0
  39. package/enums/Stat.d.ts +5 -1
  40. package/package.json +1 -1
  41. package/static/ApiTransport.d.ts +4 -0
  42. package/static/External.d.ts +7 -0
  43. package/static/Params.d.ts +35 -0
  44. package/static/SessionStore.d.ts +29 -0
  45. package/static/SimulcastInfo.d.ts +1 -0
  46. package/static/WebRTCUtils.d.ts +5 -5
  47. package/types/ClientStatsEvent.d.ts +11 -0
  48. package/types/IEventualStatLog.d.ts +1 -1
  49. package/types/Params.d.ts +1 -1
package/CallsSDK.d.ts CHANGED
@@ -28,6 +28,7 @@ import RoomsEventType from './enums/RoomsEventType';
28
28
  import SignalingCommandType from './enums/SignalingCommandType';
29
29
  import SignalingConnectionType from './enums/SignalingConnectionType';
30
30
  import SignalingNotification from './enums/SignalingNotification';
31
+ import Stat from './enums/Stat';
31
32
  import UserRole from './enums/UserRole';
32
33
  import UserType from './enums/UserType';
33
34
  import { DebugMessageType } from './static/Debug';
@@ -59,6 +60,7 @@ import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from './type
59
60
  import { ScreenCaptureSettings } from './types/ScreenCaptureSettings';
60
61
  import SignalingMessage, { GetRoomsSignalingResponse, GetParticipantsSignalingResponse } from './types/SignalingMessage';
61
62
  import { StatResult } from './types/Statistics';
63
+ import { ClientStatsEvent } from './types/ClientStatsEvent';
62
64
  import { IStartStreamData, IStopStreamData, IPublishStreamData } from './types/Streams';
63
65
  import { WaitingHallResponse } from './types/WaitingHall';
64
66
  import { ArrayDequeue } from './utils/ArrayDequeue';
@@ -266,6 +268,11 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
266
268
  export declare function processPush(conversationId: string, conversationParams?: string): Promise<void>;
267
269
  export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
268
270
  export declare function getInbounds(): Promise<PushData[]>;
271
+ /**
272
+ * Запускает отправку клиентской статистики. Нужен только при
273
+ * `autoStartStats: false`; повторные вызовы ничего не делают.
274
+ */
275
+ export declare function startStats(): void;
269
276
  /**
270
277
  * Авторизоваться для совершения звонков
271
278
  *
@@ -804,5 +811,5 @@ export declare function getSyncedTime(): number;
804
811
  * Версия SDK
805
812
  */
806
813
  export declare function version(): string;
807
- 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, FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams, };
808
- 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, };
814
+ export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, ClientStatsEvent, 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, FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams, };
815
+ 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, Stat, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
@@ -7,18 +7,12 @@ import ConversationResponse from '../types/ConversationResponse';
7
7
  import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
8
8
  import { OkUserId, ParticipantId } from '../types/Participant';
9
9
  import PushData from '../types/PushData';
10
+ import { ApiCallStats } from '../classes/stat/ApiCallStats';
10
11
  export type ClientStats = {
11
12
  call_topology: 'D' | 'S';
12
13
  vcid: ConversationData['id'] | null;
13
14
  [k: string]: string | number | boolean | null;
14
15
  };
15
- export type ClientEvent = {
16
- timestamp: number;
17
- call_topology: 'D' | 'S';
18
- event_type: string;
19
- vcid: ConversationData['id'] | null;
20
- [k: string]: string | number | boolean | null;
21
- };
22
16
  export type LogItem = {
23
17
  count?: number;
24
18
  custom: ClientStats;
@@ -33,6 +27,9 @@ export type LogItem = {
33
27
  };
34
28
  export default abstract class BaseApi {
35
29
  protected _abortSignal?: AbortSignal;
30
+ protected _apiCallStats: ApiCallStats | null;
31
+ /** Куда писать время выполнения запросов, появляется вместе со звонком */
32
+ setApiCallStats(apiCallStats: ApiCallStats | null): void;
36
33
  /**
37
34
  * Устанавливает сигнал прерывания для запуска звонка, если не успели отменить до установки соединения с другим участником, то он больше ни как не будет использоваться
38
35
  * @param signal - Сигнал прерывания или undefined для очистки
@@ -69,8 +66,15 @@ export default abstract class BaseApi {
69
66
  log(items: LogItem[]): void;
70
67
  /**
71
68
  * method: vchat.clientStats
69
+ *
70
+ * Резолвится только после подтверждённой сервером отправки.
71
+ */
72
+ logClientStats(items: ClientStats[]): Promise<void>;
73
+ /**
74
+ * method: vchat.clientStats под сохранённым session_key другого
75
+ * пользователя. Одна попытка, без перелогина; AuthData не трогает.
72
76
  */
73
- logClientStats(items: ClientStats[]): void;
77
+ logClientStatsWith(sessionKey: string, items: ClientStats[]): Promise<void>;
74
78
  abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
75
79
  getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
76
80
  getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;