@vkontakte/calls-sdk 2.8.12-dev.35600965.0 → 2.8.12-dev.49cc00f2.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.
Files changed (34) hide show
  1. package/CallsSDK.d.ts +24 -4
  2. package/abstract/BaseApi.d.ts +9 -10
  3. package/abstract/BaseSignaling.d.ts +5 -4
  4. package/calls-sdk.cjs.js +10 -10
  5. package/calls-sdk.esm.js +1427 -1306
  6. package/classes/CallRegistry.d.ts +1 -1
  7. package/classes/ExternalIdCache.d.ts +10 -12
  8. package/classes/MediaSource.d.ts +4 -0
  9. package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +43 -37
  10. package/classes/conversation/Conversation.testUtils.d.ts +150 -0
  11. package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
  12. package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +7 -5
  13. package/classes/conversation/index.d.ts +1 -0
  14. package/classes/stat/CallLifecycleStats.d.ts +0 -4
  15. package/classes/stat/StatAggregator.d.ts +4 -0
  16. package/classes/transport/DirectTransport.d.ts +1 -0
  17. package/classes/transport/ServerTransport.d.ts +1 -0
  18. package/classes/transport/Transport.d.ts +3 -0
  19. package/default/Api.d.ts +11 -10
  20. package/default/ApiExternal.d.ts +2 -1
  21. package/default/Signaling.d.ts +7 -12
  22. package/default/SignalingTransport.d.ts +6 -1
  23. package/enums/ClientHangupReason.d.ts +7 -0
  24. package/enums/Stat.d.ts +0 -1
  25. package/package.json +3 -3
  26. package/static/ApiTransport.d.ts +3 -0
  27. package/static/External.d.ts +10 -0
  28. package/static/Params.d.ts +20 -1
  29. package/static/Utils.d.ts +1 -1
  30. package/static/WebRTCUtils.d.ts +1 -6
  31. package/types/Api.d.ts +9 -0
  32. package/types/SignalingMessage.d.ts +1 -0
  33. package/utils/IceServers.d.ts +2 -0
  34. package/utils/NavigatorPermissions.d.ts +2 -2
@@ -0,0 +1,7 @@
1
+ import HangupType from './HangupType';
2
+ /**
3
+ * Причины завершения звонка, которые клиент может передать в {@link hangup}/{@link declineCall}
4
+ * и пробросить в сигналинг без маппинга.
5
+ */
6
+ export type ClientHangupReason = HangupType.HUNGUP | HangupType.CANCELED | HangupType.REJECTED | HangupType.BUSY | HangupType.MISSED | HangupType.CALL_TIMEOUT;
7
+ export default ClientHangupReason;
package/enums/Stat.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  declare const enum Stat {
2
2
  CALL_INIT = "call_init",
3
- CALL_WARMUP = "call_warmup",
4
3
  CALL_START = "call_start",
5
4
  CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing",
6
5
  CALL_ACCEPTED_INCOMING = "call_accepted_incoming",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.12-dev.35600965.0",
3
+ "version": "2.8.12-dev.49cc00f2.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",
@@ -14,7 +14,7 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-audio-effects": "1.2.8",
17
+ "@vkontakte/calls-audio-effects": "1.4.1",
18
18
  "@vkontakte/calls-video-effects": "2.2.3-beta.7",
19
19
  "@vkontakte/calls-vmoji": "1.0.10-beta.17",
20
20
  "@vkontakte/libvpx": "2.0.9",
@@ -22,6 +22,6 @@
22
22
  "fflate": "^0.8.2",
23
23
  "messagepack": "1.1.12",
24
24
  "simple-ebml-builder": "0.2.2",
25
- "webrtc-adapter": "7.7.0"
25
+ "webrtc-adapter": "9.0.5"
26
26
  }
27
27
  }
@@ -7,4 +7,7 @@ export declare function sendBeakon(method: string, params?: {
7
7
  export declare function request(method: string, params?: {
8
8
  [key: string]: any;
9
9
  }, noSession?: boolean, customEndpoint?: string): Promise<any>;
10
+ export declare function requestKeepalive(method: string, params?: {
11
+ [key: string]: any;
12
+ }, noSession?: boolean): Promise<any>;
10
13
  export declare function sendFormData(url: string, data: FormData): Promise<void>;
@@ -638,5 +638,15 @@ declare namespace External {
638
638
  * Собеседник подключился к сигналлингу
639
639
  */
640
640
  function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
641
+ /**
642
+ * SDK обнаружил ошибку, после которой звонок может продолжаться.
643
+ *
644
+ * Callback предназначен для отправки ошибки в клиентский мониторинг.
645
+ * Его вызов не означает завершение звонка.
646
+ *
647
+ * @param error
648
+ * @param conversationId ID звонка
649
+ */
650
+ function onNonFatalError(error: Error, conversationId: string | null): void;
641
651
  }
642
652
  export default External;
@@ -1,5 +1,5 @@
1
1
  import type { VideoEffects } from '@vkontakte/calls-video-effects';
2
- import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
2
+ import type { EffectVoiceChange, VadControllerOptions, VadLib } from '@vkontakte/calls-audio-effects';
3
3
  import type * as Vmoji from '@vkontakte/calls-vmoji';
4
4
  import { IAsrData } from '../types/Asr';
5
5
  import { ConversationData } from '../types/Conversation';
@@ -193,6 +193,14 @@ export type ParamsObject = {
193
193
  * Можно установить позднее методом `setAudioEffects`
194
194
  */
195
195
  audioEffects: EffectVoiceChange | null;
196
+ /**
197
+ * Namespace библиотеки VAD из `@vkontakte/calls-audio-effects`.
198
+ *
199
+ * Можно установить методом `setVad`
200
+ */
201
+ vad: VadLib | null;
202
+ /** Настройки VAD (threshold, hangoverMs, enabled) */
203
+ vadOptions: VadControllerOptions;
196
204
  /**
197
205
  * Максимальная ширина видео в пикселях для видео эффекта
198
206
  *
@@ -903,6 +911,13 @@ export type ParamsObject = {
903
911
  * Собеседник подключился к сигналлингу
904
912
  */
905
913
  onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
914
+ /**
915
+ * SDK обнаружил ошибку, после которой звонок может продолжаться.
916
+ *
917
+ * Callback предназначен для отправки ошибки в клиентский мониторинг.
918
+ * Его вызов не означает завершение звонка.
919
+ */
920
+ onNonFatalError?: (error: Error, conversationId: string | null) => void;
906
921
  };
907
922
  export default abstract class Params {
908
923
  private static _params;
@@ -970,6 +985,10 @@ export default abstract class Params {
970
985
  static get displaySurface(): DisplayCaptureSurfaceType;
971
986
  static get audioEffects(): EffectVoiceChange | null;
972
987
  static set audioEffects(value: EffectVoiceChange | null);
988
+ static get vad(): VadLib | null;
989
+ static set vad(value: VadLib | null);
990
+ static get vadOptions(): VadControllerOptions;
991
+ static set vadOptions(value: VadControllerOptions);
973
992
  static get videoEffects(): VideoEffects | null;
974
993
  static set videoEffects(value: VideoEffects | null);
975
994
  static get videoEffectMaxWidth(): number;
package/static/Utils.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const DEVICE_IDX_PARAMETER = "d";
9
9
  /** @hidden */
10
10
  declare namespace Utils {
11
11
  function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264Decoder: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
12
- function patchRemoteSDP(sdp: string, oldDataChannelDescription: boolean, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
12
+ function patchRemoteSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
13
13
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
14
14
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
15
15
  function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<{
@@ -20,7 +20,7 @@ export declare enum FacingMode {
20
20
  /**
21
21
  * Известные браузеры
22
22
  */
23
- export type BrowserName = 'IE' | 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
23
+ export type BrowserName = 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
24
24
  declare namespace WebRTCUtils {
25
25
  /**
26
26
  * До вызова этого метода бесполезно опрашивать другие публичные методы.
@@ -143,11 +143,6 @@ declare namespace WebRTCUtils {
143
143
  * В некоторых браузерах VP9 decoder сломан
144
144
  */
145
145
  function isBrokenVP9Decoder(): boolean;
146
- /**
147
- * Изменился формат описания датаканала в SDP
148
- * @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
149
- */
150
- function isOldDataChannelDescription(): boolean;
151
146
  /**
152
147
  * Может ли браузер делать H264 приоритетным
153
148
  */
package/types/Api.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import HangupType from '../enums/HangupType';
2
+ export interface IHangupParams {
3
+ conversationId: string;
4
+ reason: HangupType;
5
+ anonymToken?: string;
6
+ peerId?: string;
7
+ application_key?: string;
8
+ session_key?: string;
9
+ }
@@ -188,6 +188,7 @@ declare namespace SignalingMessage {
188
188
  peerId: PeerId;
189
189
  mediaSettings: Partial<MediaSettings>;
190
190
  capabilities?: string;
191
+ externalId?: ExternalId;
191
192
  }
192
193
  export interface Hungup extends Notification {
193
194
  participantId: OkUserId;
@@ -0,0 +1,2 @@
1
+ import IceServer from '../types/IceServer';
2
+ export declare function createIceServers(stunServer?: IceServer, turnServer?: IceServer): IceServer[];
@@ -2,8 +2,8 @@ type Device = 'camera' | 'microphone';
2
2
  type PermissionStatusState = typeof PermissionStatus.prototype.state;
3
3
  type EventListener = (name: Device, state: PermissionStatusState) => void;
4
4
  export declare class NavigatorPermissions {
5
- private _cameraPermissionStatus;
6
- private _microphonePermissionStatus;
5
+ private _cameraPermissionStatus?;
6
+ private _microphonePermissionStatus?;
7
7
  private _listener;
8
8
  static isSupported(): boolean;
9
9
  init(listener: EventListener): Promise<void>;