@vkontakte/calls-sdk 2.8.11-beta.0 → 2.8.11-dev.185dd9e4.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 +1 -11
- package/abstract/BaseApi.d.ts +2 -4
- package/abstract/BaseSignaling.d.ts +1 -2
- package/calls-sdk.cjs.js +10 -10
- package/calls-sdk.esm.js +10 -10
- package/classes/Conversation.d.ts +0 -1
- package/classes/ExternalIdCache.d.ts +19 -0
- package/classes/Logger.d.ts +0 -5
- package/default/Api.d.ts +4 -14
- package/default/Signaling.d.ts +3 -3
- package/package.json +1 -1
- package/types/WebTransport.d.ts +1 -0
|
@@ -279,7 +279,6 @@ export default class Conversation extends EventEmitter {
|
|
|
279
279
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
280
280
|
stopStream(roomId?: number | null, remove?: boolean): Promise<undefined>;
|
|
281
281
|
publishStream(roomId?: number | null): Promise<undefined>;
|
|
282
|
-
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
283
282
|
getStreamInfo(): Promise<{
|
|
284
283
|
movieId: any;
|
|
285
284
|
preview: any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
+
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
3
|
+
export declare class ExternalIdCache {
|
|
4
|
+
private _okIdToExternalId;
|
|
5
|
+
private _externalIdToOkId;
|
|
6
|
+
private _decorativeIdToInitialId;
|
|
7
|
+
private _initialIdToDecorativeId;
|
|
8
|
+
getOkId(externalId: ExternalId): OkUserId | null;
|
|
9
|
+
getExternalId(okId: OkUserId): ExternalParticipantId | null;
|
|
10
|
+
hasByExternalId(externalId: ExternalId): boolean;
|
|
11
|
+
hasByOkId(okId: OkUserId): boolean;
|
|
12
|
+
cache(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
|
|
13
|
+
mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
14
|
+
unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
15
|
+
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
16
|
+
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
17
|
+
getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
18
|
+
clear(): void;
|
|
19
|
+
}
|
package/classes/Logger.d.ts
CHANGED
|
@@ -10,30 +10,25 @@ export default class Logger extends BaseLogger {
|
|
|
10
10
|
static setConversationIdProvider(provider: () => string | null): void;
|
|
11
11
|
static create(api: BaseApi, externalLogger: BaseLogger | null): void;
|
|
12
12
|
static log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
13
|
-
static logCustom(name: StatLog, params: Record<string, string | number>, immediately?: boolean): void;
|
|
14
13
|
static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
15
14
|
static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
16
15
|
static destroy(): void;
|
|
17
16
|
private readonly _externalLogger;
|
|
18
17
|
private readonly _api;
|
|
19
18
|
private readonly _batchInterval;
|
|
20
|
-
private _batchedLogItems;
|
|
21
19
|
private _batchedClientStats;
|
|
22
20
|
private _batchedClientEvents;
|
|
23
21
|
private _batchTimeout;
|
|
24
22
|
private _serverTimeDelta;
|
|
25
23
|
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
26
24
|
log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
27
|
-
logCustom(name: string, params: Record<string, string | number>, immediately?: boolean): void;
|
|
28
25
|
logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
29
26
|
logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
30
27
|
destroy(): void;
|
|
31
|
-
private _logInternal;
|
|
32
28
|
private _getConversationId;
|
|
33
29
|
private _sendBatch;
|
|
34
30
|
private _startTimeout;
|
|
35
31
|
private _stopTimeout;
|
|
36
|
-
private _sendLogItems;
|
|
37
32
|
private _sendClientStats;
|
|
38
33
|
private _sendClientEvents;
|
|
39
34
|
private _calculateServerTimeDelta;
|
package/default/Api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseApi, { ClientEvent, ClientStats
|
|
1
|
+
import BaseApi, { ClientEvent, ClientStats } from '../abstract/BaseApi';
|
|
2
2
|
import CallType from '../enums/CallType';
|
|
3
3
|
import HangupType from '../enums/HangupType';
|
|
4
4
|
import ConversationParams from '../types/ConversationParams';
|
|
@@ -8,14 +8,11 @@ import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
|
8
8
|
export default class Api extends BaseApi {
|
|
9
9
|
private _userId;
|
|
10
10
|
private _uuid;
|
|
11
|
-
private
|
|
12
|
-
private _decorativeIdToInitialId;
|
|
13
|
-
private _initialIdToDecorativeId;
|
|
11
|
+
private _idCache;
|
|
14
12
|
private _callUnsafe;
|
|
15
13
|
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
16
14
|
userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
|
|
17
15
|
authorize(): Promise<void>;
|
|
18
|
-
log(items: LogItem[]): void;
|
|
19
16
|
logClientStats(items: ClientStats[]): void;
|
|
20
17
|
logClientEvents(items: ClientEvent[]): void;
|
|
21
18
|
uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
@@ -26,7 +23,7 @@ export default class Api extends BaseApi {
|
|
|
26
23
|
audioOnly?: boolean;
|
|
27
24
|
waitForAdmin?: boolean;
|
|
28
25
|
closedConversation?: boolean;
|
|
29
|
-
},
|
|
26
|
+
}, externalIds?: ExternalId[]): Promise<ConversationResponse>;
|
|
30
27
|
startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie, waitForAdmin }?: {
|
|
31
28
|
onlyAdminCanShareMovie?: boolean;
|
|
32
29
|
waitForAdmin?: boolean;
|
|
@@ -43,19 +40,13 @@ export default class Api extends BaseApi {
|
|
|
43
40
|
}>;
|
|
44
41
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
45
42
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
46
|
-
/**
|
|
47
|
-
* NB: Не сохраняет порядок возвращаемых ID
|
|
48
|
-
* Этот метод принимает именно ExternalId, т.к. для OkUserId не принципиально наличие deviceIdx
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
|
|
52
|
-
getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
|
|
53
43
|
/**
|
|
54
44
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
55
45
|
* @hidden
|
|
56
46
|
*/
|
|
57
47
|
getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
|
|
58
48
|
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
49
|
+
getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
|
|
59
50
|
cacheExternalId(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
|
|
60
51
|
mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
61
52
|
unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
@@ -65,7 +56,6 @@ export default class Api extends BaseApi {
|
|
|
65
56
|
getUserId(): OkUserId | null;
|
|
66
57
|
setUserId(userId: OkUserId): void;
|
|
67
58
|
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
68
|
-
sendUserFeedbackStats(conversationId: string, userResponse: number, reason?: string, groupCallUsersCount?: number): void;
|
|
69
59
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
70
60
|
cleanup(): void;
|
|
71
61
|
private _getExternalIdsByOkIds;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
|
22
22
|
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
23
23
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
24
24
|
import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse, SignalingSuccessResponse } from '../types/SignalingMessage';
|
|
25
|
-
import { IPublishStreamData,
|
|
25
|
+
import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
26
26
|
export default class Signaling extends BaseSignaling {
|
|
27
27
|
private socket;
|
|
28
28
|
protected sequence: number;
|
|
@@ -39,7 +39,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
39
39
|
protected conversationReject: Function | null;
|
|
40
40
|
private connected;
|
|
41
41
|
private listenersReady;
|
|
42
|
-
private postfix;
|
|
43
42
|
protected peerId: number | null;
|
|
44
43
|
protected conversationId: string | null;
|
|
45
44
|
private reconnectTimer;
|
|
@@ -120,7 +119,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
120
119
|
startStream(data: IStartStreamData): Promise<SignalingMessage>;
|
|
121
120
|
stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
|
|
122
121
|
publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
|
|
123
|
-
recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
|
|
124
122
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
125
123
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
126
124
|
requestRealloc(): Promise<SignalingMessage>;
|
|
@@ -164,6 +162,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
164
162
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
165
163
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
166
164
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
165
|
+
private _buildUrl;
|
|
167
166
|
protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
|
|
168
167
|
protected _disconnect(code?: number): void;
|
|
169
168
|
private _onOpen;
|
|
@@ -173,6 +172,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
173
172
|
protected _handleCachedMessages(): void;
|
|
174
173
|
private _throwError;
|
|
175
174
|
private _onError;
|
|
175
|
+
private _serializeErrorEvent;
|
|
176
176
|
protected _onClose(event: CloseEvent): void;
|
|
177
177
|
protected _closeSocket(error?: Error | null): void;
|
|
178
178
|
protected _reconnect(): void;
|
package/package.json
CHANGED
package/types/WebTransport.d.ts
CHANGED