@vkontakte/calls-sdk 2.4.4-dev.717e1c2.0 → 2.4.4-dev.c28b095.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/static/Utils.d.ts CHANGED
@@ -1,29 +1,21 @@
1
1
  import { BigInteger } from 'big-integer';
2
2
  import UserType from '../enums/UserType';
3
3
  import { ExternalParticipant } from '../types/ExternalId';
4
- import { CompositeUserId, OkUserId, Participant, ParticipantId, ParticipantStateMapped } from '../types/Participant';
4
+ import { CompositeUserId, OkUserId, Participant, ParticipantStateMapped } from '../types/Participant';
5
5
  import SignalingMessage from '../types/SignalingMessage';
6
6
  import VideoSettings from '../types/VideoSettings';
7
- export declare const PARAMETERS_SEPARATOR = ":";
8
- export declare const DEVICE_IDX_PARAMETER = "d";
9
7
  declare namespace Utils {
10
8
  function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
11
9
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
12
10
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
13
11
  function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<any>;
14
- function composeUserId(id: CompositeUserId | OkUserId, type: UserType): CompositeUserId;
15
- function composeParticipantId(id: CompositeUserId | OkUserId, type: UserType, deviceIdx: number): ParticipantId;
16
- function compose(compositeId: CompositeUserId, deviceIdx: number): ParticipantId;
17
- function composeId(participant: SignalingMessage.Participant): ParticipantId;
18
- function composeMessageId(message: SignalingMessage): ParticipantId;
12
+ function composeId(id: CompositeUserId | OkUserId, type: UserType): CompositeUserId;
13
+ function composeParticipantId(participant: SignalingMessage.Participant): CompositeUserId;
14
+ function composeMessageId(message: SignalingMessage): CompositeUserId;
19
15
  function decomposeId(compositeId: CompositeUserId | OkUserId): {
20
16
  id: OkUserId;
21
17
  type: UserType;
22
18
  };
23
- function decomposeParticipantId(participantId: ParticipantId): {
24
- compositeUserId: CompositeUserId;
25
- deviceIdx: number;
26
- };
27
19
  function uuid(): string;
28
20
  function throttle(func: Function, ms: number): (this: any) => void;
29
21
  function sdpFingerprint(sdp: string): BigInteger;
@@ -5,6 +5,5 @@ declare type ConversationParams = {
5
5
  turn_server?: IceServer;
6
6
  stun_server?: IceServer;
7
7
  client_type?: string;
8
- device_idx?: number;
9
8
  };
10
9
  export default ConversationParams;
@@ -23,9 +23,5 @@ declare type ConversationResponse = {
23
23
  status: HangupType;
24
24
  }[];
25
25
  peerId?: number;
26
- /**
27
- * Порядковый номер, присвоенный устройству при входе в звонок
28
- */
29
- device_idx?: number;
30
26
  };
31
27
  export default ConversationResponse;
@@ -22,13 +22,6 @@ export declare namespace ExternalIdUtils {
22
22
  function compare(id1: ExternalId, id2: ExternalId): boolean;
23
23
  }
24
24
  export declare type ExternalIdString = string;
25
- export declare namespace ExternalParticipantIdUtils {
26
- function fromId(id: string, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
27
- function toString(externalId: ExternalParticipantId): ExternalParticipantIdString;
28
- function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx: number): ExternalParticipantId;
29
- function getDeviceIdx(externalId: string | ExternalParticipantId | null): number;
30
- }
31
- export declare type ExternalParticipantIdString = string;
32
25
  /**
33
26
  * Идентификатор внешнего пользователя
34
27
  */
@@ -42,15 +35,6 @@ export interface ExternalId {
42
35
  */
43
36
  type: ExternalIdType;
44
37
  }
45
- /**
46
- * Идентификатор участника звонка
47
- */
48
- export interface ExternalParticipantId extends ExternalId {
49
- /**
50
- * Индекс устройства (позволяет отличать участников, которые присоединяются к звонку под одной учётной записью с разных устройств)
51
- */
52
- deviceIdx: number;
53
- }
54
38
  /**
55
39
  * Участник звонка
56
40
  */
@@ -58,7 +42,7 @@ export interface ExternalParticipant {
58
42
  /**
59
43
  * Идентификатор пользователя
60
44
  */
61
- uid: ExternalParticipantId;
45
+ uid: ExternalId;
62
46
  /**
63
47
  * Данные стрима
64
48
  */
@@ -3,18 +3,10 @@ import ParticipantState from '../enums/ParticipantState';
3
3
  import UserRole from '../enums/UserRole';
4
4
  import { ParticipantStatus } from '../static/External';
5
5
  import MediaSettings from '../types/MediaSettings';
6
- import { ExternalParticipantId } from './ExternalId';
6
+ import { ExternalId } from './ExternalId';
7
7
  import MuteStates from './MuteStates';
8
8
  import ParticipantLayout from './ParticipantLayout';
9
- /**
10
- * Уникально идентифицирует пользователя или группу
11
- */
12
9
  export declare type CompositeUserId = string;
13
- /**
14
- * Уникально идентифицирует участника звонка
15
- * (одному пользователю могут соответствовать несколько участников, в случае если пользователь зашёл в звонок с нескольких устройств)
16
- */
17
- export declare type ParticipantId = string;
18
10
  export declare type OkUserId = number;
19
11
  /**
20
12
  * Стейт участника звонка
@@ -26,8 +18,8 @@ export interface ParticipantStateMapped {
26
18
  };
27
19
  }
28
20
  export interface Participant {
29
- id: ParticipantId;
30
- externalId: ExternalParticipantId;
21
+ id: CompositeUserId;
22
+ externalId: ExternalId;
31
23
  mediaSettings: MediaSettings;
32
24
  state: ParticipantState;
33
25
  status: ParticipantStatus | null;
@@ -1,4 +1,4 @@
1
- import { ExternalParticipantId } from './ExternalId';
1
+ import { ExternalId } from './ExternalId';
2
2
  import { MediaType } from './ParticipantStreamDescription';
3
3
  /**
4
4
  * Лейаут собеседника в звонке
@@ -42,7 +42,7 @@ export declare type ParticipantLayout = (Layout | StopStream) & {
42
42
  /**
43
43
  * Внешний ID пользователя
44
44
  */
45
- uid: ExternalParticipantId | string;
45
+ uid: ExternalId | string;
46
46
  /**
47
47
  * Тип медиа (видео с камеры, картинка с экрана, лайв или мувик)
48
48
  */
@@ -1,12 +1,12 @@
1
- import { ExternalParticipantId } from './ExternalId';
1
+ import { ExternalId } from './ExternalId';
2
2
  /**
3
3
  * Приоритет собеседника в звонке
4
4
  */
5
5
  declare type ParticipantPriority = {
6
6
  /**
7
- * Внешний ID участника звонка
7
+ * Внешний ID пользователя
8
8
  */
9
- uid: ExternalParticipantId | string;
9
+ uid: ExternalId | string;
10
10
  /**
11
11
  * Приоритет [-1..MAX_INT]
12
12
  */
@@ -1,4 +1,4 @@
1
- import { ParticipantId } from './Participant';
1
+ import { CompositeUserId } from './Participant';
2
2
  /**
3
3
  * Тип пользовательского медиа
4
4
  */
@@ -11,7 +11,7 @@ export declare enum MediaType {
11
11
  export declare function serializeParticipantStreamDescription(description: ParticipantStreamDescription): string;
12
12
  export declare function parseParticipantStreamDescription(descriptionString: string): ParticipantStreamDescription;
13
13
  export declare type ParticipantStreamDescription = {
14
- participantId: ParticipantId;
14
+ participantId: CompositeUserId;
15
15
  mediaType: MediaType | null;
16
16
  streamName?: string;
17
17
  };
@@ -10,12 +10,12 @@ import UserType from '../enums/UserType';
10
10
  import MediaModifiers from './MediaModifiers';
11
11
  import MediaSettings from './MediaSettings';
12
12
  import MuteStates from './MuteStates';
13
- import { OkUserId, ParticipantId } from './Participant';
13
+ import { CompositeUserId, OkUserId } from './Participant';
14
14
  import VideoSettings from './VideoSettings';
15
15
  import { WaitingParticipant } from './WaitingHall';
16
16
  declare type SignalingMessage = Record<string, any>;
17
17
  export declare type RecordInfo = {
18
- initiator: ParticipantId;
18
+ initiator: CompositeUserId;
19
19
  recordMovieId: number;
20
20
  recordStartTime: number;
21
21
  recordType: 'STREAM' | 'RECORD';
@@ -34,7 +34,6 @@ declare namespace SignalingMessage {
34
34
  export interface Participant {
35
35
  id: OkUserId;
36
36
  idType?: UserType;
37
- deviceIdx?: number;
38
37
  externalId?: ExternalId;
39
38
  state: ParticipantState;
40
39
  responders?: OkUserId[];
@@ -62,7 +61,7 @@ declare namespace SignalingMessage {
62
61
  multichatId: string | null;
63
62
  tamtamMultichatId: string | null;
64
63
  recordInfo: RecordInfo | null;
65
- pinnedParticipantId: ParticipantId | null;
64
+ pinnedParticipantId: CompositeUserId | null;
66
65
  options: ConversationOption[];
67
66
  muteStates?: MuteStates;
68
67
  }
@@ -74,14 +73,12 @@ declare namespace SignalingMessage {
74
73
  export interface TransmittedData extends Notification {
75
74
  participantId: OkUserId;
76
75
  participantType: UserType;
77
- deviceIdx?: number;
78
76
  peerId: PeerId;
79
77
  data: any;
80
78
  }
81
79
  export interface RegisteredPeer extends Notification {
82
80
  participantId: OkUserId;
83
81
  participantType: UserType;
84
- deviceIdx?: number;
85
82
  peerId: PeerId;
86
83
  platform: string;
87
84
  clientType: string;
@@ -89,14 +86,12 @@ declare namespace SignalingMessage {
89
86
  export interface AcceptedCall extends Notification {
90
87
  participantId: OkUserId;
91
88
  participantType: UserType;
92
- deviceIdx?: number;
93
89
  peerId: PeerId;
94
90
  mediaSettings: Partial<MediaSettings>;
95
91
  }
96
92
  export interface Hungup extends Notification {
97
93
  participantId: OkUserId;
98
94
  participantType: UserType;
99
- deviceIdx?: number;
100
95
  peerId: PeerId;
101
96
  reason: HangupType;
102
97
  }
@@ -106,14 +101,12 @@ declare namespace SignalingMessage {
106
101
  export interface MediaSettingsChanged extends Notification {
107
102
  participantId: OkUserId;
108
103
  participantType: UserType;
109
- deviceIdx?: number;
110
104
  peerId: PeerId;
111
105
  mediaSettings: Partial<MediaSettings>;
112
106
  }
113
107
  export interface ParticipantStateChanged extends Notification {
114
108
  participantId: OkUserId;
115
109
  participantType: UserType;
116
- deviceIdx?: number;
117
110
  peerId: PeerId;
118
111
  mediaSettings: Partial<MediaSettings>;
119
112
  participantState: {
@@ -122,13 +115,13 @@ declare namespace SignalingMessage {
122
115
  };
123
116
  }
124
117
  export interface RolesChanged extends Notification {
125
- adminId: ParticipantId;
126
- participantId: ParticipantId;
118
+ adminId: CompositeUserId;
119
+ participantId: CompositeUserId;
127
120
  roles?: UserRole[];
128
121
  }
129
122
  export interface MuteParticipant extends Notification {
130
- adminId?: ParticipantId;
131
- participantId?: ParticipantId;
123
+ adminId?: CompositeUserId;
124
+ participantId?: CompositeUserId;
132
125
  muteStates: MuteStates;
133
126
  unmuteOptions?: MediaOption[];
134
127
  mediaOptions: MediaOption[];
@@ -136,7 +129,7 @@ declare namespace SignalingMessage {
136
129
  muteAll?: boolean;
137
130
  }
138
131
  export interface PinParticipant extends Notification {
139
- participantId: ParticipantId;
132
+ participantId: CompositeUserId;
140
133
  unpin?: boolean;
141
134
  }
142
135
  export interface ParticipantAdded extends Notification {
@@ -160,7 +153,6 @@ declare namespace SignalingMessage {
160
153
  topology: TransportTopology;
161
154
  offerTo: OkUserId[];
162
155
  offerToTypes: UserType[];
163
- offerToDeviceIdxs: number[];
164
156
  }
165
157
  export interface RateCallData extends Notification {
166
158
  maxRateForQuestion: number;
@@ -177,10 +169,12 @@ declare namespace SignalingMessage {
177
169
  reason: string;
178
170
  }
179
171
  export interface RecordStarted extends Notification {
172
+ idType: UserType;
173
+ id: OkUserId;
180
174
  recordInfo: RecordInfo;
181
175
  }
182
176
  export interface RecordStopped extends Notification {
183
- participant: ParticipantId;
177
+ participant: CompositeUserId;
184
178
  recordMovieId: number;
185
179
  }
186
180
  export interface ReallocCon extends Notification {
@@ -190,7 +184,6 @@ declare namespace SignalingMessage {
190
184
  export interface ChatMessage extends Notification {
191
185
  participantId: OkUserId;
192
186
  participantType: UserType;
193
- deviceIdx?: number;
194
187
  direct: boolean;
195
188
  message: string;
196
189
  }
@@ -203,13 +196,13 @@ declare namespace SignalingMessage {
203
196
  settings: Record<string, any>;
204
197
  }
205
198
  export interface StalledActivity extends Notification {
206
- stalledParticipants: ParticipantId[];
199
+ stalledParticipants: CompositeUserId[];
207
200
  }
208
201
  export interface AudioActivity extends Notification {
209
- activeParticipants: ParticipantId[];
202
+ activeParticipants: CompositeUserId[];
210
203
  }
211
204
  export interface SpeakerChanged extends Notification {
212
- speaker: ParticipantId;
205
+ speaker: CompositeUserId;
213
206
  }
214
207
  export interface OptionsChanged extends Notification {
215
208
  options: ConversationOption[];
@@ -218,7 +211,7 @@ declare namespace SignalingMessage {
218
211
  statuses: Record<string, number>;
219
212
  }
220
213
  export interface PromotionApproved extends Notification {
221
- adminId: ParticipantId;
214
+ adminId: CompositeUserId;
222
215
  }
223
216
  export interface PromoteParticipant extends Notification {
224
217
  demote: boolean;
@@ -229,8 +222,8 @@ declare namespace SignalingMessage {
229
222
  eventType: ChatRoomEventType;
230
223
  totalCount: number;
231
224
  firstParticipants: WaitingParticipant[];
232
- addedParticipantIds: ParticipantId[];
233
- removedParticipantIds: ParticipantId[];
225
+ addedParticipantIds: CompositeUserId[];
226
+ removedParticipantIds: CompositeUserId[];
234
227
  feedback: Record<string, any>[];
235
228
  }
236
229
  export interface VideoQualityUpdate extends Notification {
@@ -242,7 +235,6 @@ declare namespace SignalingMessage {
242
235
  export interface CustomData extends Notification {
243
236
  participantId: OkUserId;
244
237
  participantType: UserType;
245
- deviceIdx?: number;
246
238
  data: Record<string, any>;
247
239
  }
248
240
  export interface SwitchMicro extends Notification {