@vkontakte/calls-sdk 2.8.12-dev.c0dd153e.0 → 2.8.12-dev.dd6d67c5.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 +7 -7
- package/calls-sdk.esm.js +2547 -2361
- package/classes/Conversation.d.ts +12 -15
- 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 -1
- package/default/Signaling.d.ts +2 -2
- package/enums/Stat.d.ts +6 -1
- package/package.json +1 -1
- package/static/Debug.d.ts +1 -0
- package/types/Conversation.d.ts +12 -2
- package/types/ExternalId.d.ts +2 -1
- package/types/WebTransport.d.ts +15 -14
|
@@ -9,12 +9,12 @@ 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';
|
|
@@ -82,18 +82,12 @@ export default class Conversation extends EventEmitter {
|
|
|
82
82
|
get mediaSettings(): MediaSettings | undefined;
|
|
83
83
|
get isCallHeld(): boolean;
|
|
84
84
|
static debugSessionId(): string | null;
|
|
85
|
+
static debugMessage(type: DebugMessageType, ...args: any[]): boolean;
|
|
86
|
+
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
85
87
|
static getSyncedTime(): number;
|
|
86
88
|
get debugSessionId(): string | null;
|
|
87
89
|
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>;
|
|
90
|
+
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
97
91
|
private _onJoinPart2;
|
|
98
92
|
private _extractExternalRooms;
|
|
99
93
|
private _extractExternalRoomsData;
|
|
@@ -106,7 +100,6 @@ export default class Conversation extends EventEmitter {
|
|
|
106
100
|
private _acceptConcurrent;
|
|
107
101
|
private _getMainRoomParticipants;
|
|
108
102
|
private _decodeExternalConversationParams;
|
|
109
|
-
private _logCallStartEvent;
|
|
110
103
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
111
104
|
decline(): Promise<void>;
|
|
112
105
|
hangup(): Promise<void>;
|
|
@@ -118,7 +111,7 @@ export default class Conversation extends EventEmitter {
|
|
|
118
111
|
private _openTransport;
|
|
119
112
|
private _allocateParticipantTransport;
|
|
120
113
|
private _close;
|
|
121
|
-
destroy():
|
|
114
|
+
destroy(): void;
|
|
122
115
|
private _getConversationParams;
|
|
123
116
|
private _setConversationParams;
|
|
124
117
|
private _buildSignalingEndpoint;
|
|
@@ -160,6 +153,7 @@ export default class Conversation extends EventEmitter {
|
|
|
160
153
|
private _getExistedParticipantByIdOrCreate;
|
|
161
154
|
private _getExternalIdByParticipantId;
|
|
162
155
|
private _getExternalIdsByOkIdsFromCache;
|
|
156
|
+
private _getOrCacheExternalIdByCompositeId;
|
|
163
157
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
164
158
|
private _warnParticipantNotInConversation;
|
|
165
159
|
private _denormalizeMarkers;
|
|
@@ -196,6 +190,9 @@ export default class Conversation extends EventEmitter {
|
|
|
196
190
|
private _cleanupParticipants;
|
|
197
191
|
private _cleanupParticipantAgnosticStreams;
|
|
198
192
|
private _cleanupTransport;
|
|
193
|
+
private _finishLifecycle;
|
|
194
|
+
private _getFirstMediaSentCallback;
|
|
195
|
+
private _stopFirstMediaSentProbe;
|
|
199
196
|
private _cleanupTransportForHold;
|
|
200
197
|
private _cleanupSpeakerDetector;
|
|
201
198
|
private _cleanupSpecListener;
|
|
@@ -361,7 +358,7 @@ export default class Conversation extends EventEmitter {
|
|
|
361
358
|
private _onRecordInfo;
|
|
362
359
|
private _onStopRecordInfo;
|
|
363
360
|
private _changePinnedParticipantForRoom;
|
|
364
|
-
_changeRecordInfoForRoom():
|
|
361
|
+
_changeRecordInfoForRoom(): void;
|
|
365
362
|
private _changeAsrInfoForRoom;
|
|
366
363
|
private _changeUrlSharingInfoForRoom;
|
|
367
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: () =>
|
|
8
|
+
getParticipants: () => 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
|
@@ -12,7 +12,7 @@ export default class Api extends BaseApi {
|
|
|
12
12
|
private _idCache;
|
|
13
13
|
private _callUnsafe;
|
|
14
14
|
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
15
|
-
userId(participantId: ParticipantId):
|
|
15
|
+
userId(participantId: ParticipantId): ExternalParticipantId;
|
|
16
16
|
authorize(): Promise<void>;
|
|
17
17
|
private _getAnonymLoginCacheKey;
|
|
18
18
|
private _getCachedAnonymLogin;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -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
|
|
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';
|
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/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/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/ExternalId.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import MediaOption from '../enums/MediaOption';
|
|
2
|
+
import UserType from '../enums/UserType';
|
|
2
3
|
import UserRole from '../enums/UserRole';
|
|
3
4
|
import { ParticipantStatus } from '../static/External';
|
|
4
5
|
import MediaSettings from './MediaSettings';
|
|
@@ -19,7 +20,7 @@ export declare namespace ExternalIdUtils {
|
|
|
19
20
|
function fromIds(ids: ExternalUserId[] | ExternalId[]): ExternalId[];
|
|
20
21
|
function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
21
22
|
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean, fallbackToNonDecorative?: boolean): ExternalParticipantId | undefined;
|
|
22
|
-
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
|
|
23
|
+
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number, idType?: UserType): ExternalParticipantId;
|
|
23
24
|
function toSignaling(externalId: ExternalId): string;
|
|
24
25
|
function toString(externalId: ExternalId): ExternalIdString;
|
|
25
26
|
function fromIdToString(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalIdString;
|
package/types/WebTransport.d.ts
CHANGED
|
@@ -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
|
|
24
|
+
private readChunks;
|
|
24
25
|
private readLoop;
|
|
25
|
-
|
|
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 };
|