@vkontakte/calls-sdk 2.8.13-dev.ab19d582.0 → 2.8.13-dev.b0dfcfc5.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 (52) hide show
  1. package/CallsSDK.d.ts +5 -0
  2. package/abstract/BaseApi.d.ts +20 -18
  3. package/calls-sdk.cjs.js +7 -7
  4. package/calls-sdk.esm.js +3473 -2476
  5. package/classes/AudioFix.d.ts +2 -2
  6. package/classes/AudioOutput.d.ts +3 -3
  7. package/classes/ExternalIdCache.d.ts +9 -13
  8. package/classes/MediaSource.d.ts +6 -2
  9. package/classes/SpecListener.d.ts +2 -2
  10. package/classes/VolumesDetector.d.ts +0 -1
  11. package/classes/codec/LibVPxDecoder.d.ts +2 -2
  12. package/classes/codec/LibVPxEncoder.d.ts +2 -2
  13. package/classes/codec/WebCodecsDecoder.d.ts +2 -2
  14. package/classes/codec/WebCodecsEncoder.d.ts +2 -2
  15. package/classes/codec/WorkerBase.d.ts +3 -3
  16. package/classes/conversation/Conversation.d.ts +12 -4
  17. package/classes/conversation/Conversation.testUtils.d.ts +2 -0
  18. package/classes/conversation/DisplayLayoutRequester.d.ts +3 -1
  19. package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
  20. package/classes/screenshare/ScreenCaptureSender.d.ts +2 -2
  21. package/classes/screenshare/StreamBuilder.d.ts +3 -2
  22. package/classes/stat/ApiCallStats.d.ts +12 -0
  23. package/classes/stat/CallLifecycleStats.d.ts +2 -2
  24. package/classes/stat/CodecStatsAggregator.d.ts +2 -2
  25. package/classes/stat/ConversationStats.d.ts +14 -2
  26. package/classes/stat/PeerConnectionStats.d.ts +19 -0
  27. package/classes/stat/SdpStats.d.ts +38 -0
  28. package/classes/stat/StatAggregator.d.ts +10 -3
  29. package/classes/stat/StatClock.d.ts +28 -0
  30. package/classes/stat/StatDrainScheduler.d.ts +92 -0
  31. package/classes/stat/StatEventCollector.d.ts +50 -0
  32. package/classes/stat/StatPings.d.ts +2 -2
  33. package/classes/stat/StatQueue.d.ts +79 -0
  34. package/classes/stat/StatSignalingCommands.d.ts +2 -2
  35. package/classes/stat/StatUnloadJournal.d.ts +27 -0
  36. package/classes/transport/DirectTransport.d.ts +8 -2
  37. package/classes/transport/PerfStatReporter.d.ts +2 -0
  38. package/classes/transport/ServerTransport.d.ts +4 -2
  39. package/classes/transport/SimulcastSender.d.ts +2 -2
  40. package/classes/transport/Transport.d.ts +2 -2
  41. package/default/Api.d.ts +18 -11
  42. package/default/Signaling.d.ts +11 -3
  43. package/enums/SessionError.d.ts +10 -0
  44. package/enums/Stat.d.ts +20 -0
  45. package/package.json +1 -1
  46. package/static/ApiTransport.d.ts +4 -0
  47. package/static/External.d.ts +10 -0
  48. package/static/Params.d.ts +57 -1
  49. package/static/SessionStore.d.ts +29 -0
  50. package/static/SimulcastInfo.d.ts +1 -0
  51. package/static/WebRTCUtils.d.ts +5 -5
  52. package/types/IEventualStatLog.d.ts +1 -1
package/CallsSDK.d.ts CHANGED
@@ -266,6 +266,11 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
266
266
  export declare function processPush(conversationId: string, conversationParams?: string): Promise<void>;
267
267
  export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
268
268
  export declare function getInbounds(): Promise<PushData[]>;
269
+ /**
270
+ * Запускает отправку клиентской статистики. Нужен только при
271
+ * `autoStartStats: false`; повторные вызовы ничего не делают.
272
+ */
273
+ export declare function startStats(): void;
269
274
  /**
270
275
  * Авторизоваться для совершения звонков
271
276
  *
@@ -5,20 +5,14 @@ import { ConversationData } from '../types/Conversation';
5
5
  import ConversationParams from '../types/ConversationParams';
6
6
  import ConversationResponse from '../types/ConversationResponse';
7
7
  import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
8
- import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
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,13 +27,16 @@ 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 для очистки
39
36
  */
40
37
  setAbortSignal(signal: AbortSignal | undefined): void;
41
38
  abstract authorize(): Promise<void>;
42
- abstract userId(participantId: ParticipantId): ExternalParticipantId;
39
+ abstract userId(participantId: ParticipantId): ExternalParticipantId | null;
43
40
  abstract deviceId(): string;
44
41
  abstract createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, createConversationParameters?: {
45
42
  onlyAdminCanShareMovie?: boolean;
@@ -69,17 +66,22 @@ 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
- getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
76
- getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
77
- getCachedExternalIdByOkId(okId: OkUserId): ExternalParticipantId | null;
78
- cacheExternalId(compositeId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
79
- mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, okId: OkUserId | CompositeUserId): void;
80
- unmapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId): void;
81
- getDecorativeIdByInitialId(okId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
82
- replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
79
+ getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
80
+ getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
81
+ cacheExternalId(participantId: ParticipantId, externalId: ExternalParticipantId): void;
82
+ mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
83
+ unmapDecorativeId(initialId: ParticipantId): void;
84
+ getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
83
85
  hangupConversation(conversationId: string, reason?: HangupType, hangupParams?: Partial<IHangupParams>): void;
84
86
  removeHistoryRecords(recordIds: number[]): Promise<void>;
85
87
  getServerTime(): Promise<number>;