@vkontakte/calls-sdk 2.8.12-dev.26c45af4.0 → 2.8.12-dev.8c2bbcbf.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 +4 -0
- package/abstract/BaseApi.d.ts +2 -1
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +1563 -1278
- package/classes/CallRegistry.d.ts +4 -0
- package/classes/Conversation.d.ts +16 -18
- package/classes/DisplayLayoutRequester.d.ts +1 -1
- package/classes/StatsLogger.d.ts +17 -2
- package/classes/stat/CallLifecycleStats.d.ts +47 -0
- package/classes/stat/ConversationStats.d.ts +5 -4
- package/classes/stat/FirstMediaSentProbe.d.ts +13 -0
- package/classes/stat/StatPings.d.ts +1 -2
- package/classes/stat/StatSignalingCommands.d.ts +1 -2
- package/classes/transport/BaseTransport.d.ts +7 -1
- package/classes/transport/DirectTransport.d.ts +1 -1
- package/classes/transport/ServerTransport.d.ts +1 -1
- package/classes/transport/Transport.d.ts +6 -1
- package/default/Api.d.ts +1 -2
- package/default/SignalingTransport.d.ts +3 -1
- package/enums/Stat.d.ts +6 -1
- package/package.json +1 -1
- package/static/AuthData.d.ts +10 -0
- package/static/Debug.d.ts +1 -0
- package/static/Params.d.ts +0 -9
- package/types/Conversation.d.ts +12 -2
- package/types/WebTransport.d.ts +3 -1
|
@@ -6,8 +6,11 @@ export interface HoldableConversation extends Conversation {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class CallRegistry {
|
|
8
8
|
private _conversations;
|
|
9
|
+
private _reserved;
|
|
9
10
|
private _activeId;
|
|
10
11
|
private _mutex;
|
|
12
|
+
private _pendingRemovals;
|
|
13
|
+
reserve(id: string): void;
|
|
11
14
|
add(conversation: HoldableConversation): void;
|
|
12
15
|
remove(id: string | null): void;
|
|
13
16
|
get(id: string): HoldableConversation | undefined;
|
|
@@ -21,6 +24,7 @@ export declare class CallRegistry {
|
|
|
21
24
|
setHold(id: string): Promise<void>;
|
|
22
25
|
switchCall(id: string): Promise<void>;
|
|
23
26
|
clear(): void;
|
|
27
|
+
private _flushPendingRemovals;
|
|
24
28
|
}
|
|
25
29
|
declare const callRegistry: CallRegistry;
|
|
26
30
|
export { callRegistry };
|
|
@@ -9,17 +9,17 @@ import MediaOption from '../enums/MediaOption';
|
|
|
9
9
|
import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorReason';
|
|
10
10
|
import UserRole from '../enums/UserRole';
|
|
11
11
|
import UserType from '../enums/UserType';
|
|
12
|
+
import { DebugMessageType } from '../static/Debug';
|
|
12
13
|
import { JSONObject } from '../static/Json';
|
|
13
14
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
14
15
|
import { AudienceModeHandsResponse } from '../types/AudienceMode';
|
|
15
|
-
import { ConversationData, ConversationOnStartParams } from '../types/Conversation';
|
|
16
|
-
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk
|
|
17
|
-
import type { FastJoinHandler } from '../types/FastJoin';
|
|
16
|
+
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '../types/Conversation';
|
|
17
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '../types/ExternalId';
|
|
18
18
|
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, ParticipantId, ParticipantStateData } from '../types/Participant';
|
|
22
|
+
import { CompositeUserId, IGetParticipantsParameters, OkUserId, 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,6 +60,7 @@ export default class Conversation extends EventEmitter {
|
|
|
60
60
|
private _abortController;
|
|
61
61
|
private _registeredPeerReceived;
|
|
62
62
|
private _calleeUnavailableTimer;
|
|
63
|
+
private _reservedId;
|
|
63
64
|
private readonly _onUnload;
|
|
64
65
|
private readonly _audioOutput;
|
|
65
66
|
private readonly _stats;
|
|
@@ -82,22 +83,17 @@ export default class Conversation extends EventEmitter {
|
|
|
82
83
|
get mediaSettings(): MediaSettings | undefined;
|
|
83
84
|
get isCallHeld(): boolean;
|
|
84
85
|
static debugSessionId(): string | null;
|
|
86
|
+
static debugMessage(type: DebugMessageType, ...args: any[]): boolean;
|
|
87
|
+
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
85
88
|
static getSyncedTime(): number;
|
|
86
89
|
get debugSessionId(): string | null;
|
|
90
|
+
getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
|
|
87
91
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
88
|
-
onJoin(joinArgs:
|
|
89
|
-
conversationId?: string;
|
|
90
|
-
mediaOptions: MediaOption[];
|
|
91
|
-
chatId?: string;
|
|
92
|
-
joinLink?: string;
|
|
93
|
-
observedIds?: ExternalUserId[];
|
|
94
|
-
payload?: string;
|
|
95
|
-
onFastJoin?: FastJoinHandler;
|
|
96
|
-
}): Promise<ConversationData>;
|
|
92
|
+
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
97
93
|
private _onJoinPart2;
|
|
98
94
|
private _extractExternalRooms;
|
|
99
95
|
private _extractExternalRoomsData;
|
|
100
|
-
onPush(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string): Promise<void>;
|
|
96
|
+
onPush(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
|
|
101
97
|
private _isInWaitingHall;
|
|
102
98
|
private _isWaitForAdmin;
|
|
103
99
|
private _isRestricted;
|
|
@@ -106,7 +102,6 @@ export default class Conversation extends EventEmitter {
|
|
|
106
102
|
private _acceptConcurrent;
|
|
107
103
|
private _getMainRoomParticipants;
|
|
108
104
|
private _decodeExternalConversationParams;
|
|
109
|
-
private _logCallStartEvent;
|
|
110
105
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
111
106
|
decline(): Promise<void>;
|
|
112
107
|
hangup(): Promise<void>;
|
|
@@ -117,8 +112,9 @@ export default class Conversation extends EventEmitter {
|
|
|
117
112
|
updateStatisticsInterval(): void;
|
|
118
113
|
private _openTransport;
|
|
119
114
|
private _allocateParticipantTransport;
|
|
115
|
+
private _cleanupRegistry;
|
|
120
116
|
private _close;
|
|
121
|
-
destroy(): void
|
|
117
|
+
destroy(): Promise<void>;
|
|
122
118
|
private _getConversationParams;
|
|
123
119
|
private _setConversationParams;
|
|
124
120
|
private _buildSignalingEndpoint;
|
|
@@ -160,7 +156,6 @@ export default class Conversation extends EventEmitter {
|
|
|
160
156
|
private _getExistedParticipantByIdOrCreate;
|
|
161
157
|
private _getExternalIdByParticipantId;
|
|
162
158
|
private _getExternalIdsByOkIdsFromCache;
|
|
163
|
-
private _getOrCacheExternalIdByCompositeId;
|
|
164
159
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
165
160
|
private _warnParticipantNotInConversation;
|
|
166
161
|
private _denormalizeMarkers;
|
|
@@ -197,6 +192,9 @@ export default class Conversation extends EventEmitter {
|
|
|
197
192
|
private _cleanupParticipants;
|
|
198
193
|
private _cleanupParticipantAgnosticStreams;
|
|
199
194
|
private _cleanupTransport;
|
|
195
|
+
private _finishLifecycle;
|
|
196
|
+
private _getFirstMediaSentCallback;
|
|
197
|
+
private _stopFirstMediaSentProbe;
|
|
200
198
|
private _cleanupTransportForHold;
|
|
201
199
|
private _cleanupSpeakerDetector;
|
|
202
200
|
private _cleanupSpecListener;
|
|
@@ -362,7 +360,7 @@ export default class Conversation extends EventEmitter {
|
|
|
362
360
|
private _onRecordInfo;
|
|
363
361
|
private _onStopRecordInfo;
|
|
364
362
|
private _changePinnedParticipantForRoom;
|
|
365
|
-
_changeRecordInfoForRoom(): void
|
|
363
|
+
_changeRecordInfoForRoom(): Promise<void>;
|
|
366
364
|
private _changeAsrInfoForRoom;
|
|
367
365
|
private _changeUrlSharingInfoForRoom;
|
|
368
366
|
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: () => Record<ParticipantId, Participant
|
|
8
|
+
getParticipants: () => Promise<Record<ParticipantId, Participant>>;
|
|
9
9
|
isMe: (participantId: ParticipantId) => boolean;
|
|
10
10
|
updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
|
|
11
11
|
};
|
package/classes/StatsLogger.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import BaseApi from '../abstract/BaseApi';
|
|
2
2
|
import BaseLogger from '../abstract/BaseLogger';
|
|
3
3
|
import StatLog from '../enums/StatLog';
|
|
4
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
5
|
+
type ClientStatsPayload = Record<string, string | number | boolean | undefined | null>;
|
|
6
|
+
export type LogClientStatsOptions = {
|
|
7
|
+
immediately?: boolean;
|
|
8
|
+
occurredAt?: number;
|
|
9
|
+
conversationId?: string | null;
|
|
10
|
+
deferUntilServerTime?: boolean;
|
|
11
|
+
};
|
|
4
12
|
/**
|
|
5
13
|
* Класс отвечает за отправку различной информации в сервис статистики (события, статистика и подобное)
|
|
6
14
|
*/
|
|
@@ -8,19 +16,26 @@ export default class StatsLogger extends BaseLogger {
|
|
|
8
16
|
private readonly _externalLogger;
|
|
9
17
|
private readonly _api;
|
|
10
18
|
private readonly _conversationIdProvider;
|
|
19
|
+
private readonly _topologyProvider;
|
|
11
20
|
private readonly _batchInterval;
|
|
12
21
|
private _batchedClientStats;
|
|
13
22
|
private _batchTimeout;
|
|
14
23
|
private _serverTimeDelta;
|
|
15
|
-
|
|
24
|
+
private _waitingForServerTime;
|
|
25
|
+
private _deferredClientStats;
|
|
26
|
+
constructor(api: BaseApi, externalLogger: BaseLogger | null, conversationIdProvider: () => string | null, topologyProvider?: () => TransportTopology | undefined);
|
|
16
27
|
log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
17
|
-
logClientStats(data:
|
|
28
|
+
logClientStats(data: ClientStatsPayload, immediatelyOrOptions?: boolean | LogClientStatsOptions): void;
|
|
18
29
|
destroy(): void;
|
|
30
|
+
private _logClientStats;
|
|
19
31
|
private _getConversationId;
|
|
32
|
+
private _getCallTopology;
|
|
20
33
|
private _sendBatch;
|
|
21
34
|
private _startTimeout;
|
|
22
35
|
private _stopTimeout;
|
|
23
36
|
private _sendClientStats;
|
|
24
37
|
private _calculateServerTimeDelta;
|
|
38
|
+
private _flushDeferredClientStats;
|
|
25
39
|
private _now;
|
|
26
40
|
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import HangupReason from '../HangupReason';
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
3
|
+
export type CallLifecycleSource = 'outgoing' | 'incoming' | 'join' | 'anonym_join';
|
|
4
|
+
export interface CallLifecycleInitializationParams {
|
|
5
|
+
source: CallLifecycleSource;
|
|
6
|
+
conversationId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CallLifecycleClock {
|
|
9
|
+
wallNow(): number;
|
|
10
|
+
monotonicNow(): number;
|
|
11
|
+
}
|
|
12
|
+
export declare class CallLifecycleStats {
|
|
13
|
+
private readonly _logger;
|
|
14
|
+
private readonly _clock;
|
|
15
|
+
private _conversationId;
|
|
16
|
+
private _callStartLabel;
|
|
17
|
+
private _lifecycleStartedAtMonotonic;
|
|
18
|
+
private _warmupStartedAtMonotonic;
|
|
19
|
+
private _pendingEvents;
|
|
20
|
+
private _warmupCompleted;
|
|
21
|
+
private _callStarted;
|
|
22
|
+
private _accepted;
|
|
23
|
+
private _firstMediaSent;
|
|
24
|
+
private _finished;
|
|
25
|
+
private _destroyed;
|
|
26
|
+
constructor(logger: StatsLogger, clock?: CallLifecycleClock);
|
|
27
|
+
get firstMediaSentReported(): boolean;
|
|
28
|
+
get terminated(): boolean;
|
|
29
|
+
markInitializationStarted({ source, conversationId }: CallLifecycleInitializationParams): void;
|
|
30
|
+
bindConversationId(conversationId: string): void;
|
|
31
|
+
markWarmupStarted(): void;
|
|
32
|
+
markWarmupCompleted(): void;
|
|
33
|
+
markCallStarted(): void;
|
|
34
|
+
markOutgoingAccepted(): void;
|
|
35
|
+
markIncomingAccepted(concurrent: boolean): void;
|
|
36
|
+
markFirstMediaSent(): void;
|
|
37
|
+
markFinished(reason: HangupReason): void;
|
|
38
|
+
markTerminated(): void;
|
|
39
|
+
destroy(): void;
|
|
40
|
+
private _canRecord;
|
|
41
|
+
private _durationSince;
|
|
42
|
+
private _finish;
|
|
43
|
+
private _ensureConversationId;
|
|
44
|
+
private _record;
|
|
45
|
+
private _flushPendingEvents;
|
|
46
|
+
private _logEvent;
|
|
47
|
+
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import BaseApi from '../../abstract/BaseApi';
|
|
2
2
|
import BaseLogger from '../../abstract/BaseLogger';
|
|
3
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
3
4
|
import HangupReason from '../HangupReason';
|
|
4
5
|
import StatsLogger from '../StatsLogger';
|
|
5
|
-
import
|
|
6
|
+
import { CallLifecycleStats } from './CallLifecycleStats';
|
|
6
7
|
import { CodecStatsAggregator } from './CodecStatsAggregator';
|
|
7
8
|
import { StatAggregator } from './StatAggregator';
|
|
8
9
|
import { StatPings } from './StatPings';
|
|
9
10
|
import { StatSignalingCommands } from './StatSignalingCommands';
|
|
10
11
|
export declare class ConversationStats {
|
|
11
12
|
readonly logger: StatsLogger;
|
|
13
|
+
readonly lifecycle: CallLifecycleStats;
|
|
12
14
|
readonly statAggregator: StatAggregator;
|
|
13
15
|
readonly codecStatsAggregator: CodecStatsAggregator;
|
|
14
16
|
readonly pings: StatPings;
|
|
15
17
|
readonly signalingCommands: StatSignalingCommands;
|
|
16
18
|
constructor(api: BaseApi, externalLogger: BaseLogger | null, getConversationId: () => string | null, getTopology: () => TransportTopology | undefined);
|
|
17
|
-
logHangup(reason: HangupReason
|
|
18
|
-
flushCallMetrics(
|
|
19
|
+
logHangup(reason: HangupReason): void;
|
|
20
|
+
flushCallMetrics(): void;
|
|
19
21
|
destroy(): void;
|
|
20
|
-
private static correctHangupReason;
|
|
21
22
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class FirstMediaSentProbe {
|
|
2
|
+
private readonly _peerConnection;
|
|
3
|
+
private readonly _onFirstMediaSent;
|
|
4
|
+
private readonly _pollIntervalMs;
|
|
5
|
+
private _timer;
|
|
6
|
+
private _state;
|
|
7
|
+
constructor(peerConnection: RTCPeerConnection, onFirstMediaSent: () => void, pollIntervalMs?: number);
|
|
8
|
+
start(): void;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
private _getStatsReports;
|
|
11
|
+
private _poll;
|
|
12
|
+
private _scheduleNextPoll;
|
|
13
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SignalingTransportType } from '../../enums/SignalingTransportStat';
|
|
2
2
|
import StatsLogger from '../StatsLogger';
|
|
3
|
-
import TransportTopology from '../../enums/TransportTopology';
|
|
4
3
|
export declare class StatPings {
|
|
5
4
|
private readonly _logger;
|
|
6
5
|
private trackerByTransport;
|
|
@@ -12,6 +11,6 @@ export declare class StatPings {
|
|
|
12
11
|
*/
|
|
13
12
|
mark(transport: SignalingTransportType): void;
|
|
14
13
|
/** Отправляем данные в стату */
|
|
15
|
-
logMetrics(
|
|
14
|
+
logMetrics(): void;
|
|
16
15
|
destroy(): void;
|
|
17
16
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SignalingTransportType } from '../../enums/SignalingTransportStat';
|
|
2
2
|
import StatsLogger from '../StatsLogger';
|
|
3
|
-
import TransportTopology from '../../enums/TransportTopology';
|
|
4
3
|
export declare class StatSignalingCommands {
|
|
5
4
|
private readonly _logger;
|
|
6
5
|
private trackerByCommand;
|
|
7
6
|
constructor(logger: StatsLogger);
|
|
8
7
|
mark(command: string, time: number, transport: SignalingTransportType): void;
|
|
9
8
|
/** Отправляем данные в стату */
|
|
10
|
-
logMetrics(
|
|
9
|
+
logMetrics(): void;
|
|
11
10
|
destroy(): void;
|
|
12
11
|
}
|
|
@@ -7,7 +7,13 @@ export default abstract class BaseTransport extends EventEmitter {
|
|
|
7
7
|
protected readonly _mediaSource: MediaSource;
|
|
8
8
|
protected _state: TransportState;
|
|
9
9
|
protected _pc: RTCPeerConnection | null;
|
|
10
|
-
|
|
10
|
+
private readonly _onFirstMediaSent;
|
|
11
|
+
private _firstMediaSentProbe;
|
|
12
|
+
private _firstMediaSentProbeStopped;
|
|
13
|
+
protected constructor(signaling: BaseSignaling, mediaSource: MediaSource, onFirstMediaSent?: (() => void) | null);
|
|
11
14
|
getState(): TransportState;
|
|
15
|
+
stopFirstMediaSentProbe(): void;
|
|
12
16
|
abstract close(error?: Error): void;
|
|
17
|
+
protected _startFirstMediaSentProbe(): void;
|
|
18
|
+
protected _disposeFirstMediaSentProbe(): void;
|
|
13
19
|
}
|
|
@@ -43,7 +43,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
43
43
|
private readonly _logger;
|
|
44
44
|
private readonly _statAggregator;
|
|
45
45
|
private readonly _codecStatsAggregator;
|
|
46
|
-
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
46
|
+
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
47
47
|
get participantId(): ParticipantId;
|
|
48
48
|
updateStatisticsInterval(): void;
|
|
49
49
|
private _isDeadConnection;
|
|
@@ -47,7 +47,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
47
47
|
private readonly _logger;
|
|
48
48
|
private readonly _statAggregator;
|
|
49
49
|
private readonly _codecStatsAggregator;
|
|
50
|
-
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
50
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
51
51
|
updateStatisticsInterval(): void;
|
|
52
52
|
open(observer?: boolean): void;
|
|
53
53
|
close(error?: Error): void;
|
|
@@ -48,13 +48,16 @@ export declare class Transport extends EventEmitter {
|
|
|
48
48
|
private readonly _logger;
|
|
49
49
|
private readonly _statAggregator;
|
|
50
50
|
private readonly _codecStatsAggregator;
|
|
51
|
-
|
|
51
|
+
private readonly _onFirstMediaSent;
|
|
52
|
+
private _firstMediaSentProbeStopped;
|
|
53
|
+
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
52
54
|
updateSettings(settings: ServerSettings): void;
|
|
53
55
|
updateStatisticsInterval(): void;
|
|
54
56
|
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
|
55
57
|
open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
|
|
56
58
|
close(participantId: ParticipantId): void;
|
|
57
59
|
destroy(): void;
|
|
60
|
+
stopFirstMediaSentProbe(): void;
|
|
58
61
|
holdClose(): void;
|
|
59
62
|
setRemoteHold(hold: boolean): void;
|
|
60
63
|
getTopology(): TransportTopology;
|
|
@@ -69,6 +72,8 @@ export declare class Transport extends EventEmitter {
|
|
|
69
72
|
private _setStates;
|
|
70
73
|
private _setLocalState;
|
|
71
74
|
private _onSignalingNotification;
|
|
75
|
+
private _handleFirstMediaSent;
|
|
76
|
+
private _getFirstMediaSentCallback;
|
|
72
77
|
private _onTopologyChanged;
|
|
73
78
|
private _createDirectTransport;
|
|
74
79
|
private _createServerTransport;
|
package/default/Api.d.ts
CHANGED
|
@@ -7,12 +7,11 @@ 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;
|
|
11
10
|
private _uuid;
|
|
12
11
|
private _idCache;
|
|
13
12
|
private _callUnsafe;
|
|
14
13
|
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
15
|
-
userId(participantId: ParticipantId): ExternalParticipantId
|
|
14
|
+
userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
|
|
16
15
|
authorize(): Promise<void>;
|
|
17
16
|
private _getAnonymLoginCacheKey;
|
|
18
17
|
private _getCachedAnonymLogin;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
2
2
|
import { SignalingTransportType } from '../enums/SignalingTransportStat';
|
|
3
|
+
import { DebugLogger } from '../static/Debug';
|
|
3
4
|
export declare enum SignalingTransportFailure {
|
|
4
5
|
EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
|
|
5
6
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
@@ -38,7 +39,8 @@ export default class SignalingTransport {
|
|
|
38
39
|
private abortSignal;
|
|
39
40
|
private manualClose;
|
|
40
41
|
private currentType;
|
|
41
|
-
|
|
42
|
+
private readonly _debug;
|
|
43
|
+
constructor(debug: DebugLogger | undefined, handlers: SignalingTransportHandlers);
|
|
42
44
|
get readyState(): number | null;
|
|
43
45
|
get type(): SignalingTransportType;
|
|
44
46
|
setEndpoint(endpoint: string): void;
|
package/enums/Stat.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
declare const enum Stat {
|
|
2
|
+
CALL_INIT = "call_init",
|
|
3
|
+
CALL_WARMUP = "call_warmup",
|
|
4
|
+
CALL_START = "call_start",
|
|
5
|
+
CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing",
|
|
6
|
+
CALL_ACCEPTED_INCOMING = "call_accepted_incoming",
|
|
7
|
+
FIRST_MEDIA_SENT = "first_media_sent",
|
|
2
8
|
CALL_FINISH = "call_finish",// событие отправляемое в конце звонка
|
|
3
9
|
CODEC_USAGE = "codec_usage",// событие когда меняется кодек
|
|
4
10
|
SIGNALING_CONNECTED = "signaling_connected",// measure
|
|
@@ -7,7 +13,6 @@ declare const enum Stat {
|
|
|
7
13
|
FIRST_MEDIA_RECEIVED = "first_media_received",
|
|
8
14
|
CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally",
|
|
9
15
|
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
|
|
10
|
-
CALL_START = "call_start",
|
|
11
16
|
SIGNALING_PING_SUMMARY = "signaling_ping_summary",
|
|
12
17
|
SIGNALING_COMMAND_SUMMARY = "signaling_command_summary",
|
|
13
18
|
WEBSOCKET_CONNECTED = "websocket_connected",
|
package/package.json
CHANGED
package/static/AuthData.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import type { OkUserId } from '../types/Participant';
|
|
1
2
|
export default abstract class AuthData {
|
|
2
3
|
private static _sessionKey;
|
|
3
4
|
private static _sessionSecretKey;
|
|
4
5
|
private static _accessToken;
|
|
6
|
+
private static _userId;
|
|
7
|
+
private static _reauthorizePromise;
|
|
5
8
|
static get sessionKey(): string | undefined;
|
|
6
9
|
static set sessionKey(value: string | undefined);
|
|
7
10
|
static get sessionSecretKey(): string | undefined;
|
|
8
11
|
static set sessionSecretKey(value: string | undefined);
|
|
9
12
|
static get accessToken(): string | undefined;
|
|
10
13
|
static set accessToken(value: string | undefined);
|
|
14
|
+
static get userId(): OkUserId | null;
|
|
15
|
+
static set userId(value: OkUserId | null);
|
|
11
16
|
static isEmpty(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Дедуплицирует одновременные попытки реавторизации из разных инстансов Api.
|
|
19
|
+
* Первый вызов выполняет authorizeFn, остальные ждут того же промиса.
|
|
20
|
+
*/
|
|
21
|
+
static reauthorize(authorizeFn: () => Promise<void>): Promise<void>;
|
|
12
22
|
}
|
package/static/Debug.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type DebugSessionLogger = DebugLogger & {
|
|
|
21
21
|
readonly sessionId: string | null;
|
|
22
22
|
readonly conversationId: string | null;
|
|
23
23
|
setConversationId(conversationId: string | null): void;
|
|
24
|
+
send(type: DebugMessageType, ...args: any[]): void;
|
|
24
25
|
};
|
|
25
26
|
declare namespace Debug {
|
|
26
27
|
type ContextProvider = () => DebugMessageContext;
|
package/static/Params.d.ts
CHANGED
|
@@ -485,13 +485,6 @@ export type ParamsObject = {
|
|
|
485
485
|
* _По умолчанию: `false`_
|
|
486
486
|
*/
|
|
487
487
|
webtransport: boolean;
|
|
488
|
-
/**
|
|
489
|
-
* Включить поддержку webtransport для сигналинга в FireFox
|
|
490
|
-
* Отдельная ручка, так как есть проблемы сейчас с FF
|
|
491
|
-
*
|
|
492
|
-
* _По умолчанию: `false`_
|
|
493
|
-
*/
|
|
494
|
-
webtransportFF: boolean;
|
|
495
488
|
/**
|
|
496
489
|
* Ждать подтверждения от бэкенда для команд startStream/stopStream.
|
|
497
490
|
* При включении: reject без соединения, resolve/reject по ответу бэкенда,
|
|
@@ -1031,7 +1024,6 @@ export default abstract class Params {
|
|
|
1031
1024
|
static get enableVideoEffectsFpsDegradation(): boolean;
|
|
1032
1025
|
static get simulcast(): boolean;
|
|
1033
1026
|
static get webtransport(): boolean;
|
|
1034
|
-
static get webtransportFF(): boolean;
|
|
1035
1027
|
static get waitForRecordResponse(): boolean;
|
|
1036
1028
|
static get transparentAudio(): boolean;
|
|
1037
1029
|
static get enableSessionStateUpdates(): boolean;
|
|
@@ -1068,7 +1060,6 @@ export default abstract class Params {
|
|
|
1068
1060
|
switchVideoAtBadNetwork: boolean;
|
|
1069
1061
|
simulcast: boolean;
|
|
1070
1062
|
webtransport: boolean;
|
|
1071
|
-
webtransportFF: boolean;
|
|
1072
1063
|
waitForRecordResponse: boolean;
|
|
1073
1064
|
transparentAudio: boolean;
|
|
1074
1065
|
enableSessionStateUpdates: boolean;
|
package/types/Conversation.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import MediaOption from '../enums/MediaOption';
|
|
|
7
7
|
import UserRole from '../enums/UserRole';
|
|
8
8
|
import { AsrInfo } from './Asr';
|
|
9
9
|
import { IFeaturesPerRole } from './ConversationFeature';
|
|
10
|
-
import { ExternalId, ExternalParticipantId } from './ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipantId, ExternalUserId } from './ExternalId';
|
|
11
|
+
import { FastJoinHandler } from './FastJoin';
|
|
11
12
|
import { FastStartHandler } from './FastStart';
|
|
12
13
|
import MediaModifiers from './MediaModifiers';
|
|
13
14
|
import MuteStates from './MuteStates';
|
|
@@ -84,6 +85,16 @@ export type ConversationOnStartParams = {
|
|
|
84
85
|
onFastStart?: FastStartHandler;
|
|
85
86
|
conversationId?: string;
|
|
86
87
|
};
|
|
88
|
+
export type ConversationOnJoinParams = {
|
|
89
|
+
conversationId?: string;
|
|
90
|
+
mediaOptions: MediaOption[];
|
|
91
|
+
chatId?: string;
|
|
92
|
+
joinLink?: string;
|
|
93
|
+
observedIds?: ExternalUserId[];
|
|
94
|
+
payload?: string;
|
|
95
|
+
onFastJoin?: FastJoinHandler;
|
|
96
|
+
anonymous?: boolean;
|
|
97
|
+
};
|
|
87
98
|
export type StartConversationParams = {
|
|
88
99
|
opponentIds?: OkUserId[];
|
|
89
100
|
opponentType: CallType;
|
|
@@ -94,7 +105,6 @@ export type StartConversationParams = {
|
|
|
94
105
|
requireAuthToJoin?: boolean;
|
|
95
106
|
onlyAdminCanShareMovie?: boolean;
|
|
96
107
|
externalIds?: ExternalId[];
|
|
97
|
-
startedTime: number;
|
|
98
108
|
onFastStart?: FastStartHandler;
|
|
99
109
|
conversationId?: string;
|
|
100
110
|
};
|
package/types/WebTransport.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WebTransportOptions } from '@fails-components/webtransport';
|
|
2
|
+
import { DebugLogger } from '../static/Debug';
|
|
2
3
|
declare class WebTransportEventual {
|
|
3
4
|
private webTransport;
|
|
4
5
|
private stream;
|
|
@@ -11,12 +12,13 @@ declare class WebTransportEventual {
|
|
|
11
12
|
private closeEventEmitted;
|
|
12
13
|
private encoder;
|
|
13
14
|
private decoder;
|
|
15
|
+
private readonly _debug;
|
|
14
16
|
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
15
17
|
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
16
18
|
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
17
19
|
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
18
20
|
readyState: number;
|
|
19
|
-
constructor(url: string, options?: WebTransportOptions);
|
|
21
|
+
constructor(url: string, options?: WebTransportOptions, debug?: DebugLogger);
|
|
20
22
|
private getCompressionTypeFromUrl;
|
|
21
23
|
private connect;
|
|
22
24
|
private readChunks;
|