@vkontakte/calls-sdk 2.6.2-dev.03b3a46.0 → 2.6.2-dev.07a666d.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.
@@ -15,7 +15,7 @@ import { JSONObject } from '../static/Json';
15
15
  import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
16
16
  import MediaModifiers from '../types/MediaModifiers';
17
17
  import { IVideoDimentions } from '../types/MediaSettings';
18
- import { IAddMovieParams } from '../types/MovieShare';
18
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
19
19
  import MuteStates from '../types/MuteStates';
20
20
  import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
21
21
  import { ParticipantLayout } from '../types/ParticipantLayout';
@@ -38,6 +38,7 @@ export declare type ConversationData = {
38
38
  */
39
39
  acceptTime: number | null;
40
40
  features: ConversationFeature[];
41
+ featuresPerRole?: Partial<Record<ConversationFeature, UserRole[]>> | null;
41
42
  /**
42
43
  * ID звонка
43
44
  */
@@ -77,6 +78,7 @@ export default class Conversation extends EventEmitter {
77
78
  private readonly _signaling;
78
79
  private _mediaSource;
79
80
  private _conversation;
81
+ private _myLastRequestedLayouts;
80
82
  private _state;
81
83
  private _participantState;
82
84
  private _participants;
@@ -107,7 +109,7 @@ export default class Conversation extends EventEmitter {
107
109
  static current(): Conversation | null;
108
110
  static hangupAfterInit(): void;
109
111
  static id(): string | null;
110
- onStart(opponentIds: OkUserId[], opponentType: CallType, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean): Promise<ConversationData>;
112
+ onStart(opponentIds: OkUserId[], opponentType: CallType, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean): Promise<ConversationData>;
111
113
  onJoin(joinArgs: {
112
114
  conversationId?: string;
113
115
  mediaOptions: MediaOption[];
@@ -158,7 +160,6 @@ export default class Conversation extends EventEmitter {
158
160
  private _registerParticipants;
159
161
  /** Установим состояние локальных мьютов */
160
162
  private _registerParticipantLocalMuteState;
161
- private _getClientType;
162
163
  private _getStatusByTransportState;
163
164
  private _registerParticipantInCache;
164
165
  private _getExistedParticipantByIdOrCreate;
@@ -204,8 +205,6 @@ export default class Conversation extends EventEmitter {
204
205
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
205
206
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
206
207
  updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
207
- /** @async */
208
- feedback(key: string): Promise<SignalingMessage>;
209
208
  private _stopStreaming;
210
209
  private _sendUpdateDisplayLayout;
211
210
  private _cleanupCooldownQueue;
@@ -222,6 +221,7 @@ export default class Conversation extends EventEmitter {
222
221
  private _checkAdminRole;
223
222
  grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
224
223
  muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
224
+ enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
225
225
  pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
226
226
  updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
227
227
  changeOptions(changes: {
@@ -242,7 +242,7 @@ export default class Conversation extends EventEmitter {
242
242
  movieId: string;
243
243
  streamType: string;
244
244
  }>;
245
- updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
245
+ updateMovie(params: IUpdateMovieData): Promise<void>;
246
246
  removeMovie(movieId: string): Promise<void>;
247
247
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
248
248
  stopStream(): Promise<SignalingMessage>;
@@ -314,8 +314,7 @@ export default class Conversation extends EventEmitter {
314
314
  private _updateDisplayLayoutFromCache;
315
315
  private _setParticipantsStatus;
316
316
  private _onJoinLinkChanged;
317
- /** получили из сингналинга сообщение о реакции пользователей */
318
- private _onFeedback;
317
+ private _isMe;
319
318
  }
320
319
  export declare class UpdateDisplayLayoutError extends Error {
321
320
  readonly participantErrors: {
package/default/Api.d.ts CHANGED
@@ -16,8 +16,12 @@ export default class Api extends BaseApi {
16
16
  log(items: LogItem[]): void;
17
17
  init(): void;
18
18
  joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
19
- createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean): Promise<ConversationResponse>;
20
- startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean): Promise<ConversationResponse>;
19
+ createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
20
+ onlyAdminCanShareMovie?: boolean;
21
+ }): Promise<ConversationResponse>;
22
+ startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
23
+ onlyAdminCanShareMovie?: boolean;
24
+ }): Promise<ConversationResponse>;
21
25
  private _preareStartConversationData;
22
26
  private _startConversation;
23
27
  createJoinLink(conversationId: string): Promise<{
@@ -2,6 +2,7 @@ import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
2
2
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
3
3
  import { PerfStatReport } from '../classes/transport/PerfStatReporter';
4
4
  import { TransportTopology } from '../classes/transport/Transport';
5
+ import ConversationFeature from '../enums/ConversationFeature';
5
6
  import ConversationOption from '../enums/ConversationOption';
6
7
  import MediaOption from '../enums/MediaOption';
7
8
  import RecordRole from '../enums/RecordRole';
@@ -11,7 +12,7 @@ import UserRole from '../enums/UserRole';
11
12
  import { JSONObject } from '../static/Json';
12
13
  import MediaModifiers from '../types/MediaModifiers';
13
14
  import MediaSettings from '../types/MediaSettings';
14
- import { IAddMovieParams, ISharedMovieState } from '../types/MovieShare';
15
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
15
16
  import MuteStates from '../types/MuteStates';
16
17
  import { CompositeUserId, ParticipantId } from '../types/Participant';
17
18
  import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
@@ -98,7 +99,7 @@ export default class Signaling extends BaseSignaling {
98
99
  [streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
99
100
  }): Promise<SignalingMessage>;
100
101
  addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
101
- updateMovie(data: ISharedMovieState): Promise<SignalingMessage>;
102
+ updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
102
103
  removeMovie(data: any): Promise<SignalingMessage>;
103
104
  startStream(data: any): Promise<SignalingMessage>;
104
105
  stopStream(): Promise<SignalingMessage>;
@@ -112,6 +113,7 @@ export default class Signaling extends BaseSignaling {
112
113
  customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
113
114
  grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
114
115
  muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
116
+ enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
115
117
  pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
116
118
  updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
117
119
  changeOptions(changes: {
@@ -119,7 +121,6 @@ export default class Signaling extends BaseSignaling {
119
121
  }): Promise<SignalingMessage>;
120
122
  getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
121
123
  promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
122
- feedback(key: string): Promise<SignalingMessage>;
123
124
  /**
124
125
  * Close a connection with a signaling server
125
126
  */
@@ -1,5 +1,6 @@
1
1
  declare const enum ConversationFeature {
2
2
  ADD_PARTICIPANT = "ADD_PARTICIPANT",
3
- RECORD = "RECORD"
3
+ RECORD = "RECORD",
4
+ MOVIE_SHARE = "MOVIE_SHARE"
4
5
  }
5
6
  export default ConversationFeature;
@@ -5,8 +5,7 @@ declare enum ConversationOption {
5
5
  REQUIRE_AUTH_TO_JOIN = "REQUIRE_AUTH_TO_JOIN",
6
6
  AUDIENCE_MODE = "AUDIENCE_MODE",
7
7
  WAITING_HALL = "WAITING_HALL",
8
- ASR = "ASR",
9
- FEEDBACK = "FEEDBACK"
8
+ ASR = "ASR"
10
9
  }
11
10
  export default ConversationOption;
12
11
  export declare function compareOptions(oldOptions: ConversationOption[], newOptions: ConversationOption[]): boolean;
@@ -4,6 +4,7 @@
4
4
  declare enum MediaOption {
5
5
  AUDIO = "AUDIO",
6
6
  VIDEO = "VIDEO",
7
- SCREEN_SHARING = "SCREEN_SHARING"
7
+ SCREEN_SHARING = "SCREEN_SHARING",
8
+ MOVIE_SHARING = "MOVIE_SHARING"
8
9
  }
9
10
  export default MediaOption;
@@ -24,6 +24,7 @@ declare enum SignalingCommandType {
24
24
  CUSTOM_DATA = "custom-data",
25
25
  GRANT_ROLES = "grant-roles",
26
26
  MUTE_PARTICIPANT = "mute-participant",
27
+ ENABLE_FEATURE_FOR_ROLES = "enable-feature-for-roles",
27
28
  PIN_PARTICIPANT = "pin-participant",
28
29
  UPDATE_MEDIA_MODIFIERS = "update-media-modifiers",
29
30
  CHANGE_OPTIONS = "change-options",
@@ -34,7 +35,6 @@ declare enum SignalingCommandType {
34
35
  REQUEST_TEST_MODE = "request-test-mode",
35
36
  ADD_MOVIE = "add-movie",
36
37
  UPDATE_MOVIE = "update-movie",
37
- REMOVE_MOVIE = "remove-movie",
38
- FEEDBACK = "feedback"
38
+ REMOVE_MOVIE = "remove-movie"
39
39
  }
40
40
  export default SignalingCommandType;
@@ -36,7 +36,6 @@ declare enum SignalingNotification {
36
36
  CHAT_ROOM_UPDATED = "chat-room-updated",
37
37
  PROMOTION_APPROVED = "promotion-approved",
38
38
  JOIN_LINK_CHANGED = "join-link-changed",
39
- FEEDBACK = "feedback",
40
39
  MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
41
40
  MOVIE_SHARE_INFO = "movie-share-info",
42
41
  MOVIE_SHARE_STARTED = "movie-share-started",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.6.2-dev.03b3a46.0",
3
+ "version": "2.6.2-dev.07a666d.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",
@@ -8,7 +8,6 @@ import FatalError from '../enums/FatalError';
8
8
  import MediaOption from '../enums/MediaOption';
9
9
  import UserRole from '../enums/UserRole';
10
10
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
- import { IFeedbackExternal } from '../types/Feedback';
12
11
  import MediaModifiers from '../types/MediaModifiers';
13
12
  import MediaSettings from '../types/MediaSettings';
14
13
  import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
@@ -413,9 +412,5 @@ declare namespace External {
413
412
  * @param joinLink токен присоединения к звонку
414
413
  */
415
414
  function onJoinLinkChanged(joinLink: string): void;
416
- /**
417
- * Получена новая реакция
418
- */
419
- function onFeedback(feedback: IFeedbackExternal[]): void;
420
415
  }
421
416
  export default External;
@@ -8,7 +8,6 @@ import FatalError from '../enums/FatalError';
8
8
  import MediaOption from '../enums/MediaOption';
9
9
  import UserRole from '../enums/UserRole';
10
10
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
- import { IFeedbackExternal } from '../types/Feedback';
12
11
  import IceServer from '../types/IceServer';
13
12
  import MediaModifiers from '../types/MediaModifiers';
14
13
  import MediaSettings from '../types/MediaSettings';
@@ -26,6 +25,7 @@ import { FacingMode } from './WebRTCUtils';
26
25
  export declare type ParamsObject = {
27
26
  platform: string;
28
27
  clientType: string;
28
+ externalUserType: string;
29
29
  device: string;
30
30
  /**
31
31
  * API ключ приложения
@@ -523,11 +523,6 @@ export declare type ParamsObject = {
523
523
  * @param joinLink токен присоединения к звонку
524
524
  */
525
525
  onJoinLinkChanged?: (joinLink: string) => void;
526
- /**
527
- * Получены новые реакции в звонке
528
- * @param feedback массив с реакциями
529
- */
530
- onFeedback?: (feedback: IFeedbackExternal[]) => void;
531
526
  };
532
527
  export default abstract class Params {
533
528
  private static _params;
@@ -544,6 +539,8 @@ export default abstract class Params {
544
539
  static set platform(value: string);
545
540
  static get clientType(): string;
546
541
  static set clientType(value: string);
542
+ static get externalUserType(): string;
543
+ static set externalUserType(value: string);
547
544
  static get device(): string;
548
545
  static get apiKey(): string;
549
546
  static get apiEnv(): string;
@@ -10,5 +10,6 @@ declare type ConversationParams = {
10
10
  isp_as_org?: string;
11
11
  loc_cc?: string;
12
12
  loc_reg?: string;
13
+ external_user_type: string;
13
14
  };
14
15
  export default ConversationParams;
@@ -13,13 +13,26 @@ export interface IAddMovieParams {
13
13
  thumbnails?: IMoviePreview[];
14
14
  };
15
15
  }
16
- export declare type ISharedMovieStateResponse = [number, number, boolean, number, number];
16
+ export declare type ISharedMovieStateResponse = [
17
+ number,
18
+ number,
19
+ boolean,
20
+ number,
21
+ boolean
22
+ ];
17
23
  export interface ISharedMovieState {
18
24
  participantId: CompositeUserId;
19
25
  gain?: number;
20
26
  pause?: boolean;
21
27
  offset?: number;
22
- duration?: number;
28
+ mute?: boolean;
29
+ }
30
+ export interface IUpdateMovieData {
31
+ movieId: string;
32
+ gain?: number;
33
+ pause?: boolean;
34
+ offset?: number;
35
+ mute?: boolean;
23
36
  }
24
37
  export interface ISharedMovieInfo {
25
38
  movieId: OkUserId;
@@ -7,7 +7,6 @@ import MediaOption from '../enums/MediaOption';
7
7
  import ParticipantState from '../enums/ParticipantState';
8
8
  import UserRole from '../enums/UserRole';
9
9
  import UserType from '../enums/UserType';
10
- import { IFeedback } from './Feedback';
11
10
  import MediaModifiers from './MediaModifiers';
12
11
  import MediaSettings from './MediaSettings';
13
12
  import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
@@ -75,6 +74,7 @@ declare namespace SignalingMessage {
75
74
  multichatId: string | null;
76
75
  tamtamMultichatId: string | null;
77
76
  recordInfo: RecordInfo | null;
77
+ featuresPerRole?: Partial<Record<ConversationFeature, UserRole[]>> | null;
78
78
  pinnedParticipantId: ParticipantId | null;
79
79
  options: ConversationOption[];
80
80
  muteStates?: MuteStates;
@@ -189,6 +189,7 @@ declare namespace SignalingMessage {
189
189
  }
190
190
  export interface FeatureSetChanged extends Notification {
191
191
  features: ConversationFeature[];
192
+ featuresPerRole?: Partial<Record<ConversationFeature, UserRole[]>> | null;
192
193
  }
193
194
  export interface MultipartyChatCreated extends Notification {
194
195
  chatId: string;
@@ -282,9 +283,6 @@ declare namespace SignalingMessage {
282
283
  export interface JoinLinkChanged extends Notification {
283
284
  joinLink: string;
284
285
  }
285
- export interface Feedback extends Notification {
286
- feedback: IFeedback[];
287
- }
288
286
  export interface SharedMovieState extends Notification {
289
287
  data: ISharedMovieState[];
290
288
  }
@@ -1,7 +1,6 @@
1
1
  import { ExternalId } from './ExternalId';
2
2
  import { CompositeUserId } from './Participant';
3
3
  import SignalingMessage from './SignalingMessage';
4
- import { IFeedback } from './Feedback';
5
4
  export declare type WaitingParticipantId = {
6
5
  addedTs: number;
7
6
  id: CompositeUserId;
@@ -10,11 +9,18 @@ export declare type WaitingParticipant = {
10
9
  id: WaitingParticipantId;
11
10
  externalId?: SignalingMessage.ExternalId;
12
11
  };
12
+ export declare type Feedback = {
13
+ key: string;
14
+ totalCount: number;
15
+ currentCount: number;
16
+ timeout: number;
17
+ participantIds: CompositeUserId[];
18
+ };
13
19
  export declare type ChatRoom = {
14
20
  totalCount: number;
15
21
  firstParticipants?: WaitingParticipant[];
16
22
  handCount?: number;
17
- feedback?: IFeedback[];
23
+ feedback?: Feedback[];
18
24
  };
19
25
  /**
20
26
  * Ответ на запрос `getWaitingHall`
@@ -1,22 +0,0 @@
1
- import { CompositeUserId } from './Participant';
2
- import { ExternalParticipantId } from './ExternalId';
3
- interface IFeedbackItem {
4
- participantId: CompositeUserId;
5
- /** event timestamps for this participant, chronologically */
6
- times: number[];
7
- }
8
- export interface IFeedbackItemExternal extends Omit<IFeedbackItem, 'participantId'> {
9
- participantId: ExternalParticipantId;
10
- }
11
- export interface IFeedback {
12
- /** feedback ID; key values should be negotiated by clients themselves, like in ParticipantState, and have just the same restrictions; on backend the values of these keys are not bound in any way to those in ParticipantState */
13
- key: string;
14
- /** total amount of reactions of this type from the start of this call */
15
- totalCount: number;
16
- /** list of items containing initiator & all related data, if any */
17
- items: IFeedbackItem[];
18
- }
19
- export interface IFeedbackExternal extends Omit<IFeedback, 'items'> {
20
- items: IFeedbackItemExternal[];
21
- }
22
- export {};