@vkontakte/calls-sdk 2.8.12-dev.773596bc.0 → 2.8.12-dev.813f751c.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.
@@ -6,11 +6,8 @@ export interface HoldableConversation extends Conversation {
6
6
  }
7
7
  export declare class CallRegistry {
8
8
  private _conversations;
9
- private _reserved;
10
9
  private _activeId;
11
10
  private _mutex;
12
- private _pendingRemovals;
13
- reserve(id: string): void;
14
11
  add(conversation: HoldableConversation): void;
15
12
  remove(id: string | null): void;
16
13
  get(id: string): HoldableConversation | undefined;
@@ -24,7 +21,6 @@ export declare class CallRegistry {
24
21
  setHold(id: string): Promise<void>;
25
22
  switchCall(id: string): Promise<void>;
26
23
  clear(): void;
27
- private _flushPendingRemovals;
28
24
  }
29
25
  declare const callRegistry: CallRegistry;
30
26
  export { callRegistry };
@@ -19,7 +19,7 @@ import MediaModifiers from '../types/MediaModifiers';
19
19
  import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
20
20
  import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
21
21
  import MuteStates from '../types/MuteStates';
22
- import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantStateData } from '../types/Participant';
22
+ import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
23
23
  import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
24
24
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
25
25
  import ParticipantPriority from '../types/ParticipantPriority';
@@ -60,7 +60,6 @@ export default class Conversation extends EventEmitter {
60
60
  private _abortController;
61
61
  private _registeredPeerReceived;
62
62
  private _calleeUnavailableTimer;
63
- private _reservedId;
64
63
  private readonly _onUnload;
65
64
  private readonly _audioOutput;
66
65
  private readonly _stats;
@@ -87,13 +86,12 @@ export default class Conversation extends EventEmitter {
87
86
  static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
88
87
  static getSyncedTime(): number;
89
88
  get debugSessionId(): string | null;
90
- getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
91
89
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
92
90
  onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
93
91
  private _onJoinPart2;
94
92
  private _extractExternalRooms;
95
93
  private _extractExternalRoomsData;
96
- onPush(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
94
+ onPush(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string): Promise<void>;
97
95
  private _isInWaitingHall;
98
96
  private _isWaitForAdmin;
99
97
  private _isRestricted;
@@ -112,9 +110,8 @@ export default class Conversation extends EventEmitter {
112
110
  updateStatisticsInterval(): void;
113
111
  private _openTransport;
114
112
  private _allocateParticipantTransport;
115
- private _cleanupRegistry;
116
113
  private _close;
117
- destroy(): Promise<void>;
114
+ destroy(): void;
118
115
  private _getConversationParams;
119
116
  private _setConversationParams;
120
117
  private _buildSignalingEndpoint;
@@ -156,6 +153,7 @@ export default class Conversation extends EventEmitter {
156
153
  private _getExistedParticipantByIdOrCreate;
157
154
  private _getExternalIdByParticipantId;
158
155
  private _getExternalIdsByOkIdsFromCache;
156
+ private _getOrCacheExternalIdByCompositeId;
159
157
  private _registerParticipantAndSetMarkersIfChunkEnabled;
160
158
  private _warnParticipantNotInConversation;
161
159
  private _denormalizeMarkers;
@@ -360,7 +358,7 @@ export default class Conversation extends EventEmitter {
360
358
  private _onRecordInfo;
361
359
  private _onStopRecordInfo;
362
360
  private _changePinnedParticipantForRoom;
363
- _changeRecordInfoForRoom(): Promise<void>;
361
+ _changeRecordInfoForRoom(): void;
364
362
  private _changeAsrInfoForRoom;
365
363
  private _changeUrlSharingInfoForRoom;
366
364
  private _onParticipantAnimojiChanged;
@@ -5,7 +5,7 @@ import { Participant, ParticipantId } from '../types/Participant';
5
5
  type DisplayLayoutRequesterParams = {
6
6
  api: BaseApi;
7
7
  debug: DebugLogger;
8
- getParticipants: () => Promise<Record<ParticipantId, Participant>>;
8
+ getParticipants: () => Record<ParticipantId, Participant>;
9
9
  isMe: (participantId: ParticipantId) => boolean;
10
10
  updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
11
11
  };
@@ -1,3 +1,4 @@
1
+ import HangupReason from '../HangupReason';
1
2
  import StatsLogger from '../StatsLogger';
2
3
  export type CallLifecycleSource = 'outgoing' | 'incoming' | 'join' | 'anonym_join';
3
4
  export interface CallLifecycleInitializationParams {
@@ -33,7 +34,7 @@ export declare class CallLifecycleStats {
33
34
  markOutgoingAccepted(): void;
34
35
  markIncomingAccepted(concurrent: boolean): void;
35
36
  markFirstMediaSent(): void;
36
- markFinished(reason: unknown): void;
37
+ markFinished(reason: HangupReason): void;
37
38
  markTerminated(): void;
38
39
  destroy(): void;
39
40
  private _canRecord;
package/default/Api.d.ts CHANGED
@@ -7,11 +7,12 @@ 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 default class Api extends BaseApi {
10
+ private _userId;
10
11
  private _uuid;
11
12
  private _idCache;
12
13
  private _callUnsafe;
13
- protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
14
- userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
14
+ protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
15
+ userId(participantId: ParticipantId): ExternalParticipantId;
15
16
  authorize(): Promise<void>;
16
17
  private _getAnonymLoginCacheKey;
17
18
  private _getCachedAnonymLogin;
@@ -1,15 +1,15 @@
1
1
  import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
2
+ import StatsLogger from '../classes/StatsLogger';
2
3
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
3
4
  import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
4
5
  import { StatAggregator } from '../classes/stat/StatAggregator';
5
6
  import { StatPings } from '../classes/stat/StatPings';
6
7
  import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
7
- import StatsLogger from '../classes/StatsLogger';
8
+ import TransportTopology from '../enums/TransportTopology';
8
9
  import ConversationFeature from '../enums/ConversationFeature';
9
10
  import ConversationOption from '../enums/ConversationOption';
10
11
  import MediaOption from '../enums/MediaOption';
11
12
  import SignalingConnectionType from '../enums/SignalingConnectionType';
12
- import TransportTopology from '../enums/TransportTopology';
13
13
  import UserRole from '../enums/UserRole';
14
14
  import { type DebugLogger } from '../static/Debug';
15
15
  import { JSONObject } from '../static/Json';
@@ -187,8 +187,6 @@ export default class Signaling extends BaseSignaling {
187
187
  private _onTransportFailed;
188
188
  private _onTransportReconnectScheduled;
189
189
  private _onTransportConnectionDead;
190
- private _attachNotificationCallError;
191
- private _createSignalingCallError;
192
190
  private _getSocketType;
193
191
  private _markTransportStat;
194
192
  private _logTransportStat;
@@ -9,7 +9,6 @@ export declare enum SignalingTransportFailure {
9
9
  export type SignalingTransportFailedEvent = {
10
10
  failure: SignalingTransportFailure;
11
11
  message: string;
12
- source: SignalingTransportType;
13
12
  remote?: boolean;
14
13
  };
15
14
  export type SignalingTransportReconnectEvent = {
@@ -20,6 +20,7 @@ declare enum HangupType {
20
20
  CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
21
21
  UNKNOWN_ERROR = "UNKNOWN_ERROR",
22
22
  UNSUPPORTED = "UNSUPPORTED",
23
+ OLD_VERSION = "OLD_VERSION",
23
24
  SERVICE_DISABLED = "SERVICE_DISABLED",
24
25
  SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
25
26
  EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.12-dev.773596bc.0",
3
+ "version": "2.8.12-dev.813f751c.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -1,22 +1,12 @@
1
- import type { OkUserId } from '../types/Participant';
2
1
  export default abstract class AuthData {
3
2
  private static _sessionKey;
4
3
  private static _sessionSecretKey;
5
4
  private static _accessToken;
6
- private static _userId;
7
- private static _reauthorizePromise;
8
5
  static get sessionKey(): string | undefined;
9
6
  static set sessionKey(value: string | undefined);
10
7
  static get sessionSecretKey(): string | undefined;
11
8
  static set sessionSecretKey(value: string | undefined);
12
9
  static get accessToken(): string | undefined;
13
10
  static set accessToken(value: string | undefined);
14
- static get userId(): OkUserId | null;
15
- static set userId(value: OkUserId | null);
16
11
  static isEmpty(): boolean;
17
- /**
18
- * Дедуплицирует одновременные попытки реавторизации из разных инстансов Api.
19
- * Первый вызов выполняет authorizeFn, остальные ждут того же промиса.
20
- */
21
- static reauthorize(authorizeFn: () => Promise<void>): Promise<void>;
22
12
  }
@@ -122,10 +122,6 @@ declare namespace WebRTCUtils {
122
122
  * Проверяет поддержку WebRTC браузером
123
123
  */
124
124
  function isBrowserSupported(): boolean;
125
- /**
126
- * Возвращает первую отсутствующую capability в стабильном порядке.
127
- */
128
- function getBrowserSupportFailure(): BrowserSupportFailure | null;
129
125
  /**
130
126
  * Проверяет поддержку шаринга экрана браузером
131
127
  */
@@ -11,8 +11,7 @@ import SignalingMessage from './SignalingMessage';
11
11
  */
12
12
  export declare enum ExternalIdType {
13
13
  USER = "USER",
14
- ANONYM = "ANONYM",
15
- GROUP = "GROUP"
14
+ ANONYM = "ANONYM"
16
15
  }
17
16
  export type ExternalUserId = string;
18
17
  export declare namespace ExternalIdUtils {
@@ -34,11 +34,8 @@ export type RecordInfo = {
34
34
  recordExternalOwnerId?: string;
35
35
  };
36
36
  export interface SignalingResponse extends SignalingMessage {
37
- error?: string;
38
- errorCode?: string;
39
- errorMessage?: string;
40
- message?: string;
41
37
  response?: SignalingCommandType;
38
+ error?: string;
42
39
  reason?: HangupType | FatalError;
43
40
  sequence?: number;
44
41
  type: 'response' | 'error' | 'timeout';
@@ -1,32 +1,33 @@
1
1
  import { WebTransportOptions } from '@fails-components/webtransport';
2
2
  import { DebugLogger } from '../static/Debug';
3
3
  declare class WebTransportEventual {
4
- static isBrowserSupported(): boolean;
5
- onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
6
- onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
7
- onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
8
- onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
9
- readyState: number;
10
4
  private webTransport;
5
+ private stream;
11
6
  private writer;
7
+ private reader;
12
8
  private readonly url;
13
9
  private readonly options;
14
10
  private readonly compression;
11
+ private closeRequested;
12
+ private closeEventEmitted;
15
13
  private encoder;
16
14
  private decoder;
17
15
  private readonly _debug;
16
+ onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
17
+ onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
18
+ onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
19
+ onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
20
+ readyState: number;
18
21
  constructor(url: string, options?: WebTransportOptions, debug?: DebugLogger);
19
- send(data: string): Promise<void>;
20
- close(code?: number, reason?: string): void;
21
22
  private getCompressionTypeFromUrl;
22
23
  private connect;
23
- private observeClosed;
24
+ private readChunks;
24
25
  private readLoop;
25
- private fail;
26
- private handleStreamError;
27
- private requestNativeClose;
28
- private finishClose;
29
- private emitEvent;
26
+ send(data: string): Promise<void>;
30
27
  private createErrorEvent;
28
+ close(code?: number, reason?: string): void;
29
+ private closeConnectedTransport;
30
+ private emitClose;
31
+ static isBrowserSupported(): boolean;
31
32
  }
32
33
  export { WebTransportEventual as WebTransport };
@@ -1,11 +0,0 @@
1
- export type SemanticCallFinishReason = 'hangup' | 'canceled' | 'rejected' | 'busy' | 'missed' | 'timeout' | 'another_device' | 'removed' | 'banned' | 'initially_closed' | 'call_timeout' | 'socket_closed' | 'killed' | 'killed_without_delete' | 'obsolete_client' | 'unavailable';
2
- export type ClassifiedCallFinish = {
3
- reason: SemanticCallFinishReason;
4
- string_value?: string;
5
- } | {
6
- reason: 'error';
7
- string_value: string;
8
- } | {
9
- reason: 'failed';
10
- };
11
- export declare function classifyCallFinish(error: unknown): ClassifiedCallFinish;