sip-connector 16.0.3 → 16.2.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/README.md +195 -24
- package/dist/@SipConnector-B5FFHZzJ.cjs +1 -0
- package/dist/{@SipConnector-CoBe6WQF.js → @SipConnector-D1YBDd7g.js} +510 -463
- package/dist/ApiManager/@ApiManager.d.ts +1 -0
- package/dist/ApiManager/constants.d.ts +11 -2
- package/dist/ApiManager/eventNames.d.ts +3 -2
- package/dist/ApiManager/types.d.ts +6 -0
- package/dist/CallManager/@CallManager.d.ts +1 -0
- package/dist/CallManager/AbstractCallStrategy.d.ts +10 -0
- package/dist/CallManager/MCUCallStrategy.d.ts +7 -0
- package/dist/CallManager/types.d.ts +7 -0
- package/dist/ConnectionQueueManager/@ConnectionQueueManager.d.ts +18 -0
- package/dist/ConnectionQueueManager/__test__/@ConnectionQueueManager.test.d.ts +1 -0
- package/dist/ConnectionQueueManager/index.d.ts +1 -0
- package/dist/PresentationManager/index.d.ts +1 -1
- package/dist/SipConnector/@SipConnector.d.ts +6 -3
- package/dist/SipConnector/eventNames.d.ts +1 -1
- package/dist/__fixtures__/RTCSessionMock.d.ts +7 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +4 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +16 -16
- package/dist/@SipConnector-BjWfal-x.cjs +0 -1
|
@@ -23,7 +23,10 @@ export declare enum EHeader {
|
|
|
23
23
|
STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION",
|
|
24
24
|
START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION",
|
|
25
25
|
ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM",
|
|
26
|
-
AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE"
|
|
26
|
+
AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE",
|
|
27
|
+
AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT",
|
|
28
|
+
VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT",
|
|
29
|
+
TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION"
|
|
27
30
|
}
|
|
28
31
|
export declare enum EShareState {
|
|
29
32
|
AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT",
|
|
@@ -42,7 +45,8 @@ export declare enum EContentTypeReceived {
|
|
|
42
45
|
PARTICIPANT_STATE = "application/vinteo.webrtc.partstate",
|
|
43
46
|
NOTIFY = "application/vinteo.webrtc.notify",
|
|
44
47
|
SHARE_STATE = "application/vinteo.webrtc.sharedesktop",
|
|
45
|
-
MAIN_CAM = "application/vinteo.webrtc.maincam"
|
|
48
|
+
MAIN_CAM = "application/vinteo.webrtc.maincam",
|
|
49
|
+
RESTART = "application/vinteo.webrtc.restart"
|
|
46
50
|
}
|
|
47
51
|
export declare enum EContentTypeSent {
|
|
48
52
|
CHANNELS = "application/vinteo.webrtc.channels",
|
|
@@ -72,3 +76,8 @@ export declare enum EUseLicense {
|
|
|
72
76
|
VIDEO = "VIDEO",
|
|
73
77
|
AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION"
|
|
74
78
|
}
|
|
79
|
+
export declare enum ETracksDirection {
|
|
80
|
+
SENDRECV = "SENDRECV",
|
|
81
|
+
SENDONLY = "SENDONLY",
|
|
82
|
+
RECVONLY = "RECVONLY"
|
|
83
|
+
}
|
|
@@ -27,8 +27,9 @@ export declare enum EEvent {
|
|
|
27
27
|
AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream",
|
|
28
28
|
NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream",
|
|
29
29
|
MUST_STOP_PRESENTATION = "mustStopPresentation",
|
|
30
|
-
NEW_DTMF = "newDTMF"
|
|
30
|
+
NEW_DTMF = "newDTMF",
|
|
31
|
+
RESTART = "restart"
|
|
31
32
|
}
|
|
32
|
-
export declare const EVENT_NAMES: readonly ["participation:accepting-word-request", "participation:cancelling-word-request", "participant:move-request-to-stream", "channels:notify", "conference:participant-token-issued", "account:changed", "account:deleted", "webcast:started", "webcast:stopped", "participant:added-to-list-moderators", "participant:removed-from-list-moderators", "participant:move-request-to-spectators", "participant:move-request-to-participants", "participant:move-request-to-spectators-over-sfu", "channels", "enterRoom", "shareState", "main-cam-control", "useLicense", "admin-start-main-cam", "admin-stop-main-cam", "admin-start-mic", "admin-stop-mic", "admin-force-sync-media-state", "availableSecondRemoteStream", "notAvailableSecondRemoteStream", "mustStopPresentation", "newDTMF"];
|
|
33
|
+
export declare const EVENT_NAMES: readonly ["participation:accepting-word-request", "participation:cancelling-word-request", "participant:move-request-to-stream", "channels:notify", "conference:participant-token-issued", "account:changed", "account:deleted", "webcast:started", "webcast:stopped", "participant:added-to-list-moderators", "participant:removed-from-list-moderators", "participant:move-request-to-spectators", "participant:move-request-to-participants", "participant:move-request-to-spectators-over-sfu", "channels", "enterRoom", "shareState", "main-cam-control", "useLicense", "admin-start-main-cam", "admin-stop-main-cam", "admin-start-mic", "admin-stop-mic", "admin-force-sync-media-state", "availableSecondRemoteStream", "notAvailableSecondRemoteStream", "mustStopPresentation", "newDTMF", "restart"];
|
|
33
34
|
export type TEvent = (typeof EVENT_NAMES)[number];
|
|
34
35
|
export type TEvents = Events<typeof EVENT_NAMES>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ETracksDirection } from './constants';
|
|
1
2
|
export declare enum ECMDNotify {
|
|
2
3
|
CHANNELS = "channels",
|
|
3
4
|
WEBCAST_STARTED = "WebcastStarted",
|
|
@@ -97,3 +98,8 @@ export type TOptionsInfoMediaState = {
|
|
|
97
98
|
export type TOptionsExtraHeaders = {
|
|
98
99
|
extraHeaders?: string[];
|
|
99
100
|
};
|
|
101
|
+
export type TRestartData = {
|
|
102
|
+
tracksDirection: ETracksDirection;
|
|
103
|
+
audioTrackCount: number;
|
|
104
|
+
videoTrackCount: number;
|
|
105
|
+
};
|
|
@@ -22,5 +22,6 @@ declare class CallManager {
|
|
|
22
22
|
getCallConfiguration: ICallStrategy['getCallConfiguration'];
|
|
23
23
|
getRemoteStreams: ICallStrategy['getRemoteStreams'];
|
|
24
24
|
replaceMediaStream: ICallStrategy['replaceMediaStream'];
|
|
25
|
+
restartIce: ICallStrategy['restartIce'];
|
|
25
26
|
}
|
|
26
27
|
export default CallManager;
|
|
@@ -38,6 +38,16 @@ export declare abstract class AbstractCallStrategy implements ICallStrategy {
|
|
|
38
38
|
* Получение удаленных медиа-потоков
|
|
39
39
|
*/
|
|
40
40
|
abstract getRemoteStreams(): MediaStream[] | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Перезапуск ICE-соединения
|
|
43
|
+
*/
|
|
44
|
+
abstract restartIce(options?: {
|
|
45
|
+
useUpdate?: boolean;
|
|
46
|
+
extraHeaders?: string[];
|
|
47
|
+
rtcOfferConstraints?: RTCOfferOptions;
|
|
48
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
49
|
+
degradationPreference?: RTCDegradationPreference;
|
|
50
|
+
}): Promise<boolean>;
|
|
41
51
|
/**
|
|
42
52
|
* Внутренняя обработка звонка (например, для ontrack)
|
|
43
53
|
*/
|
|
@@ -20,6 +20,13 @@ export declare class MCUCallStrategy extends AbstractCallStrategy {
|
|
|
20
20
|
};
|
|
21
21
|
getRemoteStreams(): MediaStream[] | undefined;
|
|
22
22
|
replaceMediaStream(mediaStream: Parameters<ICallStrategy['replaceMediaStream']>[0], options?: Parameters<ICallStrategy['replaceMediaStream']>[1]): Promise<void>;
|
|
23
|
+
restartIce(options?: {
|
|
24
|
+
useUpdate?: boolean;
|
|
25
|
+
extraHeaders?: string[];
|
|
26
|
+
rtcOfferConstraints?: RTCOfferOptions;
|
|
27
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
28
|
+
degradationPreference?: RTCDegradationPreference;
|
|
29
|
+
}): Promise<boolean>;
|
|
23
30
|
protected readonly handleCall: ({ ontrack, }: {
|
|
24
31
|
ontrack?: TOntrack;
|
|
25
32
|
}) => Promise<RTCPeerConnection>;
|
|
@@ -57,5 +57,12 @@ export interface ICallStrategy {
|
|
|
57
57
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
58
58
|
onAddedTransceiver?: TOnAddedTransceiver;
|
|
59
59
|
}) => Promise<void>;
|
|
60
|
+
restartIce: (options?: {
|
|
61
|
+
useUpdate?: boolean;
|
|
62
|
+
extraHeaders?: string[];
|
|
63
|
+
rtcOfferConstraints?: RTCOfferOptions;
|
|
64
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
65
|
+
degradationPreference?: RTCDegradationPreference;
|
|
66
|
+
}) => Promise<boolean>;
|
|
60
67
|
}
|
|
61
68
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConnectionManager } from '../ConnectionManager';
|
|
2
|
+
declare class ConnectionQueueManager {
|
|
3
|
+
private readonly connectionManager;
|
|
4
|
+
private readonly stackPromises;
|
|
5
|
+
constructor({ connectionManager }: {
|
|
6
|
+
connectionManager: ConnectionManager;
|
|
7
|
+
});
|
|
8
|
+
connect: ConnectionManager['connect'];
|
|
9
|
+
disconnect: ConnectionManager['disconnect'];
|
|
10
|
+
register: ConnectionManager['register'];
|
|
11
|
+
unregister: ConnectionManager['unregister'];
|
|
12
|
+
tryRegister: ConnectionManager['tryRegister'];
|
|
13
|
+
checkTelephony: ConnectionManager['checkTelephony'];
|
|
14
|
+
sendOptions: ConnectionManager['sendOptions'];
|
|
15
|
+
ping: ConnectionManager['ping'];
|
|
16
|
+
set: ConnectionManager['set'];
|
|
17
|
+
}
|
|
18
|
+
export default ConnectionQueueManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ConnectionQueueManager } from './@ConnectionQueueManager';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { hasCanceledStartPresentationError, default as PresentationManager, } from './@PresentationManager';
|
|
2
|
-
export type { TContentHint } from './types';
|
|
2
|
+
export type { TContentHint, TOnAddedTransceiver } from './types';
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { Events } from 'events-constructor';
|
|
2
2
|
import { ApiManager } from '../ApiManager';
|
|
3
|
-
import { CallManager
|
|
3
|
+
import { default as CallManager } from '../CallManager/@CallManager';
|
|
4
4
|
import { ConnectionManager } from '../ConnectionManager';
|
|
5
|
+
import { ConnectionQueueManager } from '../ConnectionQueueManager';
|
|
5
6
|
import { IncomingCallManager } from '../IncomingCallManager';
|
|
6
|
-
import { PresentationManager } from '../PresentationManager';
|
|
7
|
+
import { PresentationManager, TContentHint, TOnAddedTransceiver } from '../PresentationManager';
|
|
7
8
|
import { StatsManager } from '../StatsManager';
|
|
8
9
|
import { VideoSendingBalancerManager } from '../VideoSendingBalancerManager';
|
|
9
10
|
import { EVENT_NAMES, TEvent } from './eventNames';
|
|
10
|
-
import {
|
|
11
|
+
import { TGetServerUrl } from '../CallManager';
|
|
11
12
|
import { TJsSIP } from '../types';
|
|
12
13
|
import { IBalancerOptions } from '../VideoSendingBalancer';
|
|
13
14
|
declare class SipConnector {
|
|
14
15
|
readonly events: Events<typeof EVENT_NAMES>;
|
|
15
16
|
readonly connectionManager: ConnectionManager;
|
|
17
|
+
readonly connectionQueueManager: ConnectionQueueManager;
|
|
16
18
|
readonly callManager: CallManager;
|
|
17
19
|
readonly apiManager: ApiManager;
|
|
18
20
|
readonly incomingCallManager: IncomingCallManager;
|
|
@@ -104,5 +106,6 @@ declare class SipConnector {
|
|
|
104
106
|
askPermissionToEnableCam(...args: Parameters<ApiManager['askPermissionToEnableCam']>): Promise<void>;
|
|
105
107
|
private setCodecPreferences;
|
|
106
108
|
private subscribe;
|
|
109
|
+
private readonly handleRestart;
|
|
107
110
|
}
|
|
108
111
|
export default SipConnector;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Events } from 'events-constructor';
|
|
2
|
-
export declare const EVENT_NAMES: readonly ("connection:connecting" | "connection:connected" | "connection:disconnected" | "connection:newRTCSession" | "connection:registered" | "connection:unregistered" | "connection:registrationFailed" | "connection:newMessage" | "connection:sipEvent" | "call:peerconnection" | "call:connecting" | "call:sending" | "call:progress" | "call:accepted" | "call:confirmed" | "call:ended" | "call:failed" | "call:newDTMF" | "call:newInfo" | "call:reinvite" | "call:update" | "call:refer" | "call:replaces" | "call:sdp" | "call:icecandidate" | "call:getusermediafailed" | "call:peerconnection:createofferfailed" | "call:peerconnection:createanswerfailed" | "call:peerconnection:setlocaldescriptionfailed" | "call:peerconnection:setremotedescriptionfailed" | "call:presentation:start" | "call:presentation:started" | "call:presentation:end" | "call:presentation:ended" | "call:presentation:failed" | "call:peerconnection:confirmed" | "call:peerconnection:ontrack" | "call:ended:fromserver" | "api:newDTMF" | "api:channels:notify" | "api:participant:added-to-list-moderators" | "api:participant:removed-from-list-moderators" | "api:participant:move-request-to-stream" | "api:participant:move-request-to-spectators" | "api:participant:move-request-to-participants" | "api:participant:move-request-to-spectators-over-sfu" | "api:participation:accepting-word-request" | "api:participation:cancelling-word-request" | "api:webcast:started" | "api:webcast:stopped" | "api:account:changed" | "api:account:deleted" | "api:conference:participant-token-issued" | "api:channels" | "api:enterRoom" | "api:shareState" | "api:main-cam-control" | "api:useLicense" | "api:admin-start-main-cam" | "api:admin-stop-main-cam" | "api:admin-start-mic" | "api:admin-stop-mic" | "api:admin-force-sync-media-state" | "api:availableSecondRemoteStream" | "api:notAvailableSecondRemoteStream" | "api:mustStopPresentation" | "incoming-call:incomingCall" | "incoming-call:declinedIncomingCall" | "incoming-call:terminatedIncomingCall" | "incoming-call:failedIncomingCall" | "presentation:presentation:start" | "presentation:presentation:started" | "presentation:presentation:end" | "presentation:presentation:ended" | "presentation:presentation:failed" | "stats:collected" | "video-balancer:balancing-scheduled" | "video-balancer:balancing-started" | "video-balancer:balancing-stopped" | "video-balancer:parameters-updated")[];
|
|
2
|
+
export declare const EVENT_NAMES: readonly ("connection:connecting" | "connection:connected" | "connection:disconnected" | "connection:newRTCSession" | "connection:registered" | "connection:unregistered" | "connection:registrationFailed" | "connection:newMessage" | "connection:sipEvent" | "call:peerconnection" | "call:connecting" | "call:sending" | "call:progress" | "call:accepted" | "call:confirmed" | "call:ended" | "call:failed" | "call:newDTMF" | "call:newInfo" | "call:reinvite" | "call:update" | "call:refer" | "call:replaces" | "call:sdp" | "call:icecandidate" | "call:getusermediafailed" | "call:peerconnection:createofferfailed" | "call:peerconnection:createanswerfailed" | "call:peerconnection:setlocaldescriptionfailed" | "call:peerconnection:setremotedescriptionfailed" | "call:presentation:start" | "call:presentation:started" | "call:presentation:end" | "call:presentation:ended" | "call:presentation:failed" | "call:peerconnection:confirmed" | "call:peerconnection:ontrack" | "call:ended:fromserver" | "api:newDTMF" | "api:channels:notify" | "api:participant:added-to-list-moderators" | "api:participant:removed-from-list-moderators" | "api:participant:move-request-to-stream" | "api:participant:move-request-to-spectators" | "api:participant:move-request-to-participants" | "api:participant:move-request-to-spectators-over-sfu" | "api:participation:accepting-word-request" | "api:participation:cancelling-word-request" | "api:webcast:started" | "api:webcast:stopped" | "api:account:changed" | "api:account:deleted" | "api:conference:participant-token-issued" | "api:channels" | "api:enterRoom" | "api:shareState" | "api:main-cam-control" | "api:useLicense" | "api:admin-start-main-cam" | "api:admin-stop-main-cam" | "api:admin-start-mic" | "api:admin-stop-mic" | "api:admin-force-sync-media-state" | "api:availableSecondRemoteStream" | "api:notAvailableSecondRemoteStream" | "api:mustStopPresentation" | "api:restart" | "incoming-call:incomingCall" | "incoming-call:declinedIncomingCall" | "incoming-call:terminatedIncomingCall" | "incoming-call:failedIncomingCall" | "presentation:presentation:start" | "presentation:presentation:started" | "presentation:presentation:end" | "presentation:presentation:ended" | "presentation:presentation:failed" | "stats:collected" | "video-balancer:balancing-scheduled" | "video-balancer:balancing-started" | "video-balancer:balancing-stopped" | "video-balancer:parameters-updated")[];
|
|
3
3
|
export type TEvent = (typeof EVENT_NAMES)[number];
|
|
4
4
|
export type TEvents = Events<typeof EVENT_NAMES>;
|
|
@@ -22,6 +22,13 @@ declare class RTCSessionMock extends BaseSession {
|
|
|
22
22
|
mediaStream: MediaStream;
|
|
23
23
|
}], any>;
|
|
24
24
|
replaceMediaStream: jest.Mock<Promise<void>, [_mediaStream: MediaStream], any>;
|
|
25
|
+
restartIce: jest.Mock<Promise<boolean>, [_options?: {
|
|
26
|
+
useUpdate?: boolean;
|
|
27
|
+
extraHeaders?: string[];
|
|
28
|
+
rtcOfferConstraints?: RTCOfferOptions;
|
|
29
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
30
|
+
degradationPreference?: RTCDegradationPreference;
|
|
31
|
+
} | undefined], any>;
|
|
25
32
|
private isEndedInner;
|
|
26
33
|
private readonly delayStartPresentation;
|
|
27
34
|
private timeoutStartPresentation?;
|
package/dist/doMock.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("node:events"),V=require("@krivega/jssip/lib/NameAddrHeader"),k=require("@krivega/jssip/lib/URI"),U=require("@krivega/jssip/lib/SIPMessage"),a=require("@krivega/jssip"),f=require("webrtc-mock"),S=require("events-constructor"),P=require("./@SipConnector-BjWfal-x.cjs");class N extends U.IncomingRequest{headers;constructor(e){super(),this.headers=new Headers(e)}getHeader(e){return this.headers.get(e)??""}}const H="incomingCall",q="declinedIncomingCall",G="failedIncomingCall",x="terminatedIncomingCall",v="connecting",z="connected",j="disconnected",Y="newRTCSession",B="registered",K="unregistered",J="registrationFailed",$="newMessage",Q="sipEvent",X="availableSecondRemoteStream",Z="notAvailableSecondRemoteStream",ee="mustStopPresentation",te="shareState",re="enterRoom",ne="useLicense",oe="peerconnection:confirmed",ie="peerconnection:ontrack",se="channels",ae="channels:notify",ce="ended:fromserver",de="main-cam-control",Ee="admin-stop-main-cam",he="admin-start-main-cam",ue="admin-stop-mic",me="admin-start-mic",le="admin-force-sync-media-state",pe="participant:added-to-list-moderators",ge="participant:removed-from-list-moderators",_e="participant:move-request-to-stream",Te="participant:move-request-to-spectators",Ie="participant:move-request-to-participants",Se="participation:accepting-word-request",Ne="participation:cancelling-word-request",we="webcast:started",Ce="webcast:stopped",Re="account:changed",fe="account:deleted",Ae="conference:participant-token-issued",Me="ended",Oe="sending",Pe="reinvite",ve="replaces",De="refer",ye="progress",Le="accepted",Fe="confirmed",We="peerconnection",be="failed",Ve="muted",ke="unmuted",Ue="newDTMF",He="newInfo",qe="hold",Ge="unhold",xe="update",ze="sdp",je="icecandidate",Ye="getusermediafailed",Be="peerconnection:createofferfailed",Ke="peerconnection:createanswerfailed",Je="peerconnection:setlocaldescriptionfailed",$e="peerconnection:setremotedescriptionfailed",Qe="presentation:start",Xe="presentation:started",Ze="presentation:end",et="presentation:ended",tt="presentation:failed",rt=[H,q,x,G,Se,Ne,_e,ae,Ae,Re,fe,we,Ce,pe,ge],D=[v,z,j,Y,B,K,J,$,Q],nt=[X,Z,ee,te,re,ne,oe,ie,se,ce,de,he,Ee,ue,me,le,Te,Ie],_=[Me,v,Oe,Pe,ve,De,ye,Le,Fe,We,be,Ve,ke,Ue,He,qe,Ge,xe,ze,je,Ye,Be,Ke,Je,$e,Qe,Xe,Ze,et,tt];[...D,...rt];[..._,...nt];class ot{originator;connection;events;remote_identity;mutedOptions={audio:!1,video:!1};constructor({originator:e="local",eventHandlers:t,remoteIdentity:r}){this.originator=e,this.events=new S.Events(_),this.initEvents(t),this.remote_identity=r}get contact(){throw new Error("Method not implemented.")}get direction(){throw new Error("Method not implemented.")}get local_identity(){throw new Error("Method not implemented.")}get start_time(){throw new Error("Method not implemented.")}get end_time(){throw new Error("Method not implemented.")}get status(){throw new Error("Method not implemented.")}get C(){throw new Error("Method not implemented.")}get causes(){throw new Error("Method not implemented.")}get id(){throw new Error("Method not implemented.")}get data(){throw new Error("Method not implemented.")}set data(e){throw new Error("Method not implemented.")}isInProgress(){throw new Error("Method not implemented.")}isEnded(){throw new Error("Method not implemented.")}isReadyToReOffer(){throw new Error("Method not implemented.")}answer(e){throw new Error("Method not implemented.")}terminate(e){throw new Error("Method not implemented.")}async sendInfo(e,t,r){throw new Error("Method not implemented.")}hold(e,t){throw new Error("Method not implemented.")}unhold(e,t){throw new Error("Method not implemented.")}async renegotiate(e,t){throw new Error("Method not implemented.")}isOnHold(){throw new Error("Method not implemented.")}mute(e){throw new Error("Method not implemented.")}unmute(e){throw new Error("Method not implemented.")}isMuted(){throw new Error("Method not implemented.")}refer(e,t){throw new Error("Method not implemented.")}resetLocalMedia(){throw new Error("Method not implemented.")}async replaceMediaStream(e,t){throw new Error("Method not implemented.")}addListener(e,t){throw new Error("Method not implemented.")}once(e,t){throw new Error("Method not implemented.")}removeListener(e,t){throw new Error("Method not implemented.")}off(e,t){return this.events.off(e,t),this}removeAllListeners(e){return console.warn("Method not implemented. Event:",e),this}setMaxListeners(e){throw new Error("Method not implemented.")}getMaxListeners(){throw new Error("Method not implemented.")}listeners(e){throw new Error("Method not implemented.")}rawListeners(e){throw new Error("Method not implemented.")}emit(e,...t){throw new Error("Method not implemented.")}listenerCount(e){throw new Error("Method not implemented.")}prependListener(e,t){throw new Error("Method not implemented.")}prependOnceListener(e,t){throw new Error("Method not implemented.")}eventNames(){throw new Error("Method not implemented.")}initEvents(e){e&&Object.entries(e).forEach(([t,r])=>{this.on(t,r)})}on(e,t){return _.includes(e)&&this.events.on(e,t),this}trigger(e,t){this.events.trigger(e,t)}sendDTMF(){this.trigger("newDTMF",{originator:this.originator})}async startPresentation(e){return this.trigger("presentation:start",e),this.trigger("presentation:started",e),e}async stopPresentation(e){return this.trigger("presentation:end",e),this.trigger("presentation:ended",e),e}isEstablished(){return!0}}class it{stats=new Map().set("codec",{mimeType:"video/h264"});dtmf=null;track=null;transport=null;transform=null;parameters={encodings:[{}],transactionId:"0",codecs:[],headerExtensions:[],rtcp:{}};parametersGets;constructor({track:e}={}){this.track=e??null}async getStats(){return this.stats}async replaceTrack(e){this.track=e??null}async setParameters(e){if(e!==this.parametersGets)throw new Error("Failed to execute 'setParameters' on 'RTCRtpSender': Read-only field modified in setParameters().");const{transactionId:t}=this.parameters;this.parameters={...this.parameters,...e,transactionId:`${Number(t)+1}`}}getParameters(){return this.parametersGets={...this.parameters},this.parametersGets}setStreams(){throw new Error("Method not implemented.")}}const st=["track"];class at{senders=[];receivers=[];canTrickleIceCandidates;connectionState;currentLocalDescription;currentRemoteDescription;iceConnectionState;iceGatheringState;idpErrorInfo;idpLoginUrl;localDescription;onconnectionstatechange;ondatachannel;onicecandidate;onicecandidateerror=null;oniceconnectionstatechange;onicegatheringstatechange;onnegotiationneeded;onsignalingstatechange;ontrack;peerIdentity=void 0;pendingLocalDescription;pendingRemoteDescription;remoteDescription;sctp=null;signalingState;events;constructor(e,t){this.events=new S.Events(st),this.receivers=t.map(r=>({track:r}))}getRemoteStreams(){throw new Error("Method not implemented.")}async addIceCandidate(e){throw new Error("Method not implemented.")}addTransceiver(e,t){throw new Error("Method not implemented.")}close(){throw new Error("Method not implemented.")}restartIce(){throw new Error("Method not implemented.")}async createAnswer(e,t){throw new Error("Method not implemented.")}createDataChannel(e,t){throw new Error("Method not implemented.")}async createOffer(e,t,r){throw new Error("Method not implemented.")}getConfiguration(){throw new Error("Method not implemented.")}async getIdentityAssertion(){throw new Error("Method not implemented.")}async getStats(e){throw new Error("Method not implemented.")}getTransceivers(){throw new Error("Method not implemented.")}removeTrack(e){throw new Error("Method not implemented.")}setConfiguration(e){throw new Error("Method not implemented.")}async setLocalDescription(e){throw new Error("Method not implemented.")}async setRemoteDescription(e){throw new Error("Method not implemented.")}addEventListener(e,t,r){this.events.on(e,t)}removeEventListener(e,t,r){this.events.off(e,t)}dispatchEvent(e){throw new Error("Method not implemented.")}getReceivers=()=>this.receivers;getSenders=()=>this.senders;addTrack=e=>{const t=new it({track:e});return this.senders.push(t),this.events.trigger("track",{track:e}),t}}function ct(n){const e=n.match(/(purgatory)|[\d.]+/g);if(!e)throw new Error("wrong sip url");return e[0]}const A=400,y="777",dt=n=>n.getVideoTracks().length>0;class s extends ot{static presentationError;static startPresentationError;static countStartPresentationError=Number.POSITIVE_INFINITY;static countStartsPresentation=0;url;status_code;answer=jest.fn(({mediaStream:e})=>{if(this.originator!=="remote")throw new Error("answer available only for remote sessions");this.initPeerconnection(e),setTimeout(()=>{this.trigger("connecting"),setTimeout(()=>{this.trigger("accepted")},100),setTimeout(()=>{this.trigger("confirmed")},200)},A)});replaceMediaStream=jest.fn(async e=>{});isEndedInner=!1;delayStartPresentation=0;timeoutStartPresentation;timeoutConnect;timeoutNewInfo;timeoutAccepted;timeoutConfirmed;constructor({eventHandlers:e,originator:t,remoteIdentity:r=new a.NameAddrHeader(new a.URI("sip","caller1","test1.com",5060),"Test Caller 1"),delayStartPresentation:i=0}){super({originator:t,eventHandlers:e,remoteIdentity:r}),this.delayStartPresentation=i}static setPresentationError(e){this.presentationError=e}static resetPresentationError(){this.presentationError=void 0}static setStartPresentationError(e,{count:t=Number.POSITIVE_INFINITY}={}){this.startPresentationError=e,this.countStartPresentationError=t}static resetStartPresentationError(){this.startPresentationError=void 0,this.countStartPresentationError=Number.POSITIVE_INFINITY,this.countStartsPresentation=0}startPresentation=async e=>(s.countStartsPresentation+=1,new Promise((t,r)=>{this.timeoutStartPresentation=setTimeout(()=>{if(s.presentationError){this.trigger("presentation:start",e),this.trigger("presentation:failed",e),r(s.presentationError);return}if(s.startPresentationError&&s.countStartsPresentation<s.countStartPresentationError){this.trigger("presentation:start",e),this.trigger("presentation:failed",e),r(s.startPresentationError);return}t(super.startPresentation(e))},this.delayStartPresentation)}));stopPresentation=async e=>{if(s.presentationError)throw this.trigger("presentation:end",e),this.trigger("presentation:failed",e),s.presentationError;return super.stopPresentation(e)};initPeerconnection(e){return e?(this.createPeerconnection(e),!0):!1}createPeerconnection(e){const t=f.createAudioMediaStreamTrackMock();t.id="mainaudio1";const r=[t];if(dt(e)){const c=f.createVideoMediaStreamTrackMock();c.id="mainvideo1",r.push(c)}this.connection=new at(void 0,r),this.addStream(e),this.trigger("peerconnection",{peerconnection:this.connection})}connect(e,{mediaStream:t}={}){const r=ct(e);return this.initPeerconnection(t),this.timeoutConnect=setTimeout(()=>{e.includes(y)?this.trigger("failed",{originator:"remote",message:"IncomingResponse",cause:"Rejected"}):(this.trigger("connecting"),this.timeoutNewInfo=setTimeout(()=>{this.newInfo({originator:P.Originator.REMOTE,request:{getHeader:i=>i==="content-type"?"application/vinteo.webrtc.roomname":i==="x-webrtc-enter-room"?r:i==="x-webrtc-participant-name"?"Test Caller 1":""}})},100),this.timeoutAccepted=setTimeout(()=>{this.trigger("accepted")},200),this.timeoutConfirmed=setTimeout(()=>{this.trigger("confirmed")},300))},A),this.connection}terminate({status_code:e,cause:t}={}){return this.status_code=e,this.trigger("ended",{status_code:e,cause:t,originator:"local"}),this.isEndedInner=!1,this}async terminateAsync({status_code:e,cause:t}={}){this.terminate({status_code:e,cause:t})}terminateRemote({status_code:e}={}){return this.status_code=e,this.trigger("ended",{status_code:e,originator:"remote"}),this}addStream(e,t="getTracks"){e[t]().forEach(r=>this.connection.addTrack(r))}forEachSenders(e){const t=this.connection.getSenders();for(const r of t)e(r);return t}toggleMuteAudio(e){this.forEachSenders(({track:t})=>{t&&t.kind==="audio"&&(t.enabled=!e)})}toggleMuteVideo(e){this.forEachSenders(({track:t})=>{t&&t.kind==="video"&&(t.enabled=!e)})}mute(e){e.audio&&(this.mutedOptions.audio=!0,this.toggleMuteAudio(this.mutedOptions.audio)),e.video&&(this.mutedOptions.video=!0,this.toggleMuteVideo(this.mutedOptions.video)),this.onmute(e)}unmute(e){e.audio&&(this.mutedOptions.audio=!1),e.video&&(this.mutedOptions.video=!1),this.trigger("unmuted",e)}isMuted(){return this.mutedOptions}onmute({audio:e,video:t}){this.trigger("muted",{audio:e,video:t})}async sendInfo(){}isEnded(){return this.isEndedInner}newInfo(e){this.trigger("newInfo",e)}clear(){clearTimeout(this.timeoutStartPresentation),clearTimeout(this.timeoutConnect),clearTimeout(this.timeoutNewInfo),clearTimeout(this.timeoutAccepted),clearTimeout(this.timeoutConfirmed)}}class Et{extraHeaders=[];setExtraHeaders(e){this.extraHeaders=e}setExtraContactParams(){}}const d="PASSWORD_CORRECT",T="PASSWORD_CORRECT_2",L="NAME_INCORRECT",h=400,g={url:"wss://sipServerUrl/webrtc/wss/",sip_uri:"sip:sipServerUrl;transport=ws",via_transport:"WSS"},M={status_code:200,reason_phrase:"OK"},O={status_code:401,reason_phrase:"Unauthorized"};class o{static isAvailableTelephony=!0;static startError;static countStartError=Number.POSITIVE_INFINITY;static countStarts=0;events;registratorInner;call=jest.fn((e,t)=>{const{mediaStream:r,eventHandlers:i}=t;return this.session=new s({eventHandlers:i,originator:"local"}),this.session.connect(e,{mediaStream:r}),this.session});sendOptions=jest.fn((e,t,r)=>{console.log("sendOptions",e,t,r)});start=jest.fn(()=>{if(o.countStarts+=1,o.startError&&o.countStarts<o.countStartError){this.trigger("disconnected",o.startError);return}this.register()});stop=jest.fn(()=>{this.startedTimeout&&clearTimeout(this.startedTimeout),this.stopedTimeout&&clearTimeout(this.stopedTimeout),this.unregister(),this.isStarted()?this.stopedTimeout=setTimeout(()=>{this.trigger("disconnected",{error:!0,socket:g})},h):this.trigger("disconnected",{error:!0,socket:g})});removeAllListeners=jest.fn(()=>(this.events.removeEventHandlers(),this));once=jest.fn((e,t)=>(this.events.once(e,t),this));startedTimeout;stopedTimeout;session;isRegisteredInner;isConnectedInner;configuration;constructor(e){this.events=new S.Events(D);const[t,r]=e.uri.split(":"),[i,c]=r.split("@"),p={...e,uri:new a.URI(t,i,c)};this.configuration=p,this.registratorInner=new Et}static setStartError(e,{count:t=Number.POSITIVE_INFINITY}={}){o.startError=e,o.countStartError=t}static resetStartError(){o.startError=void 0,o.countStartError=Number.POSITIVE_INFINITY,o.countStarts=0}static setAvailableTelephony(){o.isAvailableTelephony=!0}static setNotAvailableTelephony(){o.isAvailableTelephony=!1}static reset(){o.resetStartError(),o.setAvailableTelephony()}on(e,t){return this.events.on(e,t),this}off(e,t){return this.events.off(e,t),this}trigger(e,t){this.events.trigger(e,t)}terminateSessions(){this.session?.terminate()}set(e,t){return this.configuration[e]=t,!0}register(){this.startedTimeout&&clearTimeout(this.startedTimeout);const{password:e,register:t,uri:r}=this.configuration;t===!0&&r.user.includes(L)?(this.isRegisteredInner=!1,this.isConnectedInner=!1,this.startedTimeout=setTimeout(()=>{this.trigger("registrationFailed",{response:O,cause:a.C.causes.REJECTED})},h)):!this.isRegistered()&&t===!0&&(e===d||e===T)?(this.isRegisteredInner=!0,this.startedTimeout=setTimeout(()=>{this.trigger("registered",{response:M})},h)):t===!0&&e!==d&&e!==T&&(this.isRegisteredInner=!1,this.isConnectedInner=!1,this.startedTimeout=setTimeout(()=>{this.trigger("registrationFailed",{response:O,cause:a.C.causes.REJECTED})},h)),o.isAvailableTelephony?(this.trigger("connected",{socket:g}),this.isConnectedInner=!0):this.stop()}unregister(){this.isRegisteredInner=!1,this.isConnectedInner=!1,this.trigger("unregistered",{response:M})}isRegistered(){return this.isRegisteredInner===!0}isConnected(){return this.isConnectedInner===!0}isStarted(){return this.configuration.register===!0&&this.isRegisteredInner===!0||this.configuration.register!==!0&&this.isConnectedInner===!0}newSipEvent(e){this.trigger("sipEvent",e)}registrator(){return this.registratorInner}}class ht{url;constructor(e){this.url=e}}class ut extends b.EventEmitter{contentType;body;constructor(e,t){super(),this.contentType=e,this.body=t}}const I="remote",mt=(n,e)=>{const t=new N(e),r={originator:I,request:t,info:new ut("","")};n.newInfo(r)},lt=(n,e)=>{const r={event:"sipEvent",request:new N(e)};n.newSipEvent(r)},pt=(n,{incomingNumber:e="1234",displayName:t,host:r})=>{const i=new s({originator:I,eventHandlers:{}}),c=new k("sip",e,r);i.remote_identity=new V(c,t);const p=new N([]);n.trigger("newRTCSession",{originator:I,session:i,request:p})},gt=(n,e)=>{e?n.trigger("failed",e):n.trigger("failed",n)},w={triggerNewInfo:mt,triggerNewSipEvent:lt,triggerIncomingSession:pt,triggerFailIncomingSession:gt,WebSocketInterface:ht,UA:o,C:{INVITE:"INVITE"}},u="user",E="displayName",m="SIP_SERVER_URL",C="SIP_WEB_SOCKET_SERVER_URL",_t=new w.WebSocketInterface(C),R={userAgent:"Chrome",sipServerUrl:m,sipWebSocketServerURL:C},Tt={...R},F={...R,user:u,password:d,register:!0},It={...F,displayName:E},St={...R,displayName:E,register:!1},l={session_timers:!1,sockets:[_t],user_agent:"Chrome",sdpSemantics:"unified-plan",register_expires:300,connection_recovery_max_interval:6,connection_recovery_min_interval:2},Nt={...l,password:d,uri:new a.URI("sip",u,m),display_name:"",register:!0},wt={...l,password:d,uri:new a.URI("sip",u,m),display_name:E,register:!0},Ct={...l,display_name:E,register:!1},Rt={...l,display_name:"",register:!1},W="10.10.10.10",ft=[`X-Vinteo-Remote: ${W}`],At=()=>new P.SipConnector({JsSIP:w});exports.FAILED_CONFERENCE_NUMBER=y;exports.JsSIP=w;exports.NAME_INCORRECT=L;exports.PASSWORD_CORRECT=d;exports.PASSWORD_CORRECT_2=T;exports.SIP_SERVER_URL=m;exports.SIP_WEB_SOCKET_SERVER_URL=C;exports.dataForConnectionWithAuthorization=F;exports.dataForConnectionWithAuthorizationWithDisplayName=It;exports.dataForConnectionWithoutAuthorization=St;exports.dataForConnectionWithoutAuthorizationWithoutDisplayName=Tt;exports.displayName=E;exports.doMockSipConnector=At;exports.extraHeadersRemoteAddress=ft;exports.remoteAddress=W;exports.uaConfigurationWithAuthorization=Nt;exports.uaConfigurationWithAuthorizationWithDisplayName=wt;exports.uaConfigurationWithoutAuthorization=Ct;exports.uaConfigurationWithoutAuthorizationWithoutDisplayName=Rt;exports.user=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("node:events"),V=require("@krivega/jssip/lib/NameAddrHeader"),k=require("@krivega/jssip/lib/URI"),U=require("@krivega/jssip/lib/SIPMessage"),a=require("@krivega/jssip"),f=require("webrtc-mock"),S=require("events-constructor"),P=require("./@SipConnector-B5FFHZzJ.cjs");class N extends U.IncomingRequest{headers;constructor(e){super(),this.headers=new Headers(e)}getHeader(e){return this.headers.get(e)??""}}const H="incomingCall",q="declinedIncomingCall",G="failedIncomingCall",x="terminatedIncomingCall",v="connecting",z="connected",j="disconnected",Y="newRTCSession",B="registered",K="unregistered",J="registrationFailed",$="newMessage",Q="sipEvent",X="availableSecondRemoteStream",Z="notAvailableSecondRemoteStream",ee="mustStopPresentation",te="shareState",re="enterRoom",ne="useLicense",oe="peerconnection:confirmed",ie="peerconnection:ontrack",se="channels",ae="channels:notify",ce="ended:fromserver",de="main-cam-control",Ee="admin-stop-main-cam",he="admin-start-main-cam",ue="admin-stop-mic",me="admin-start-mic",le="admin-force-sync-media-state",pe="participant:added-to-list-moderators",ge="participant:removed-from-list-moderators",_e="participant:move-request-to-stream",Te="participant:move-request-to-spectators",Ie="participant:move-request-to-participants",Se="participation:accepting-word-request",Ne="participation:cancelling-word-request",we="webcast:started",Ce="webcast:stopped",Re="account:changed",fe="account:deleted",Ae="conference:participant-token-issued",Me="ended",Oe="sending",Pe="reinvite",ve="replaces",De="refer",ye="progress",Le="accepted",Fe="confirmed",We="peerconnection",be="failed",Ve="muted",ke="unmuted",Ue="newDTMF",He="newInfo",qe="hold",Ge="unhold",xe="update",ze="sdp",je="icecandidate",Ye="getusermediafailed",Be="peerconnection:createofferfailed",Ke="peerconnection:createanswerfailed",Je="peerconnection:setlocaldescriptionfailed",$e="peerconnection:setremotedescriptionfailed",Qe="presentation:start",Xe="presentation:started",Ze="presentation:end",et="presentation:ended",tt="presentation:failed",rt=[H,q,x,G,Se,Ne,_e,ae,Ae,Re,fe,we,Ce,pe,ge],D=[v,z,j,Y,B,K,J,$,Q],nt=[X,Z,ee,te,re,ne,oe,ie,se,ce,de,he,Ee,ue,me,le,Te,Ie],_=[Me,v,Oe,Pe,ve,De,ye,Le,Fe,We,be,Ve,ke,Ue,He,qe,Ge,xe,ze,je,Ye,Be,Ke,Je,$e,Qe,Xe,Ze,et,tt];[...D,...rt];[..._,...nt];class ot{originator;connection;events;remote_identity;mutedOptions={audio:!1,video:!1};constructor({originator:e="local",eventHandlers:t,remoteIdentity:r}){this.originator=e,this.events=new S.Events(_),this.initEvents(t),this.remote_identity=r}get contact(){throw new Error("Method not implemented.")}get direction(){throw new Error("Method not implemented.")}get local_identity(){throw new Error("Method not implemented.")}get start_time(){throw new Error("Method not implemented.")}get end_time(){throw new Error("Method not implemented.")}get status(){throw new Error("Method not implemented.")}get C(){throw new Error("Method not implemented.")}get causes(){throw new Error("Method not implemented.")}get id(){throw new Error("Method not implemented.")}get data(){throw new Error("Method not implemented.")}set data(e){throw new Error("Method not implemented.")}isInProgress(){throw new Error("Method not implemented.")}isEnded(){throw new Error("Method not implemented.")}isReadyToReOffer(){throw new Error("Method not implemented.")}answer(e){throw new Error("Method not implemented.")}terminate(e){throw new Error("Method not implemented.")}async sendInfo(e,t,r){throw new Error("Method not implemented.")}hold(e,t){throw new Error("Method not implemented.")}unhold(e,t){throw new Error("Method not implemented.")}async renegotiate(e,t){throw new Error("Method not implemented.")}isOnHold(){throw new Error("Method not implemented.")}mute(e){throw new Error("Method not implemented.")}unmute(e){throw new Error("Method not implemented.")}isMuted(){throw new Error("Method not implemented.")}refer(e,t){throw new Error("Method not implemented.")}resetLocalMedia(){throw new Error("Method not implemented.")}async replaceMediaStream(e,t){throw new Error("Method not implemented.")}addListener(e,t){throw new Error("Method not implemented.")}once(e,t){throw new Error("Method not implemented.")}removeListener(e,t){throw new Error("Method not implemented.")}off(e,t){return this.events.off(e,t),this}removeAllListeners(e){return console.warn("Method not implemented. Event:",e),this}setMaxListeners(e){throw new Error("Method not implemented.")}getMaxListeners(){throw new Error("Method not implemented.")}listeners(e){throw new Error("Method not implemented.")}rawListeners(e){throw new Error("Method not implemented.")}emit(e,...t){throw new Error("Method not implemented.")}listenerCount(e){throw new Error("Method not implemented.")}prependListener(e,t){throw new Error("Method not implemented.")}prependOnceListener(e,t){throw new Error("Method not implemented.")}eventNames(){throw new Error("Method not implemented.")}initEvents(e){e&&Object.entries(e).forEach(([t,r])=>{this.on(t,r)})}on(e,t){return _.includes(e)&&this.events.on(e,t),this}trigger(e,t){this.events.trigger(e,t)}sendDTMF(){this.trigger("newDTMF",{originator:this.originator})}async startPresentation(e){return this.trigger("presentation:start",e),this.trigger("presentation:started",e),e}async stopPresentation(e){return this.trigger("presentation:end",e),this.trigger("presentation:ended",e),e}isEstablished(){return!0}}class it{stats=new Map().set("codec",{mimeType:"video/h264"});dtmf=null;track=null;transport=null;transform=null;parameters={encodings:[{}],transactionId:"0",codecs:[],headerExtensions:[],rtcp:{}};parametersGets;constructor({track:e}={}){this.track=e??null}async getStats(){return this.stats}async replaceTrack(e){this.track=e??null}async setParameters(e){if(e!==this.parametersGets)throw new Error("Failed to execute 'setParameters' on 'RTCRtpSender': Read-only field modified in setParameters().");const{transactionId:t}=this.parameters;this.parameters={...this.parameters,...e,transactionId:`${Number(t)+1}`}}getParameters(){return this.parametersGets={...this.parameters},this.parametersGets}setStreams(){throw new Error("Method not implemented.")}}const st=["track"];class at{senders=[];receivers=[];canTrickleIceCandidates;connectionState;currentLocalDescription;currentRemoteDescription;iceConnectionState;iceGatheringState;idpErrorInfo;idpLoginUrl;localDescription;onconnectionstatechange;ondatachannel;onicecandidate;onicecandidateerror=null;oniceconnectionstatechange;onicegatheringstatechange;onnegotiationneeded;onsignalingstatechange;ontrack;peerIdentity=void 0;pendingLocalDescription;pendingRemoteDescription;remoteDescription;sctp=null;signalingState;events;constructor(e,t){this.events=new S.Events(st),this.receivers=t.map(r=>({track:r}))}getRemoteStreams(){throw new Error("Method not implemented.")}async addIceCandidate(e){throw new Error("Method not implemented.")}addTransceiver(e,t){throw new Error("Method not implemented.")}close(){throw new Error("Method not implemented.")}restartIce(){throw new Error("Method not implemented.")}async createAnswer(e,t){throw new Error("Method not implemented.")}createDataChannel(e,t){throw new Error("Method not implemented.")}async createOffer(e,t,r){throw new Error("Method not implemented.")}getConfiguration(){throw new Error("Method not implemented.")}async getIdentityAssertion(){throw new Error("Method not implemented.")}async getStats(e){throw new Error("Method not implemented.")}getTransceivers(){throw new Error("Method not implemented.")}removeTrack(e){throw new Error("Method not implemented.")}setConfiguration(e){throw new Error("Method not implemented.")}async setLocalDescription(e){throw new Error("Method not implemented.")}async setRemoteDescription(e){throw new Error("Method not implemented.")}addEventListener(e,t,r){this.events.on(e,t)}removeEventListener(e,t,r){this.events.off(e,t)}dispatchEvent(e){throw new Error("Method not implemented.")}getReceivers=()=>this.receivers;getSenders=()=>this.senders;addTrack=e=>{const t=new it({track:e});return this.senders.push(t),this.events.trigger("track",{track:e}),t}}function ct(n){const e=n.match(/(purgatory)|[\d.]+/g);if(!e)throw new Error("wrong sip url");return e[0]}const A=400,y="777",dt=n=>n.getVideoTracks().length>0;class s extends ot{static presentationError;static startPresentationError;static countStartPresentationError=Number.POSITIVE_INFINITY;static countStartsPresentation=0;url;status_code;answer=jest.fn(({mediaStream:e})=>{if(this.originator!=="remote")throw new Error("answer available only for remote sessions");this.initPeerconnection(e),setTimeout(()=>{this.trigger("connecting"),setTimeout(()=>{this.trigger("accepted")},100),setTimeout(()=>{this.trigger("confirmed")},200)},A)});replaceMediaStream=jest.fn(async e=>{});restartIce=jest.fn(async e=>!0);isEndedInner=!1;delayStartPresentation=0;timeoutStartPresentation;timeoutConnect;timeoutNewInfo;timeoutAccepted;timeoutConfirmed;constructor({eventHandlers:e,originator:t,remoteIdentity:r=new a.NameAddrHeader(new a.URI("sip","caller1","test1.com",5060),"Test Caller 1"),delayStartPresentation:i=0}){super({originator:t,eventHandlers:e,remoteIdentity:r}),this.delayStartPresentation=i}static setPresentationError(e){this.presentationError=e}static resetPresentationError(){this.presentationError=void 0}static setStartPresentationError(e,{count:t=Number.POSITIVE_INFINITY}={}){this.startPresentationError=e,this.countStartPresentationError=t}static resetStartPresentationError(){this.startPresentationError=void 0,this.countStartPresentationError=Number.POSITIVE_INFINITY,this.countStartsPresentation=0}startPresentation=async e=>(s.countStartsPresentation+=1,new Promise((t,r)=>{this.timeoutStartPresentation=setTimeout(()=>{if(s.presentationError){this.trigger("presentation:start",e),this.trigger("presentation:failed",e),r(s.presentationError);return}if(s.startPresentationError&&s.countStartsPresentation<s.countStartPresentationError){this.trigger("presentation:start",e),this.trigger("presentation:failed",e),r(s.startPresentationError);return}t(super.startPresentation(e))},this.delayStartPresentation)}));stopPresentation=async e=>{if(s.presentationError)throw this.trigger("presentation:end",e),this.trigger("presentation:failed",e),s.presentationError;return super.stopPresentation(e)};initPeerconnection(e){return e?(this.createPeerconnection(e),!0):!1}createPeerconnection(e){const t=f.createAudioMediaStreamTrackMock();t.id="mainaudio1";const r=[t];if(dt(e)){const c=f.createVideoMediaStreamTrackMock();c.id="mainvideo1",r.push(c)}this.connection=new at(void 0,r),this.addStream(e),this.trigger("peerconnection",{peerconnection:this.connection})}connect(e,{mediaStream:t}={}){const r=ct(e);return this.initPeerconnection(t),this.timeoutConnect=setTimeout(()=>{e.includes(y)?this.trigger("failed",{originator:"remote",message:"IncomingResponse",cause:"Rejected"}):(this.trigger("connecting"),this.timeoutNewInfo=setTimeout(()=>{this.newInfo({originator:P.Originator.REMOTE,request:{getHeader:i=>i==="content-type"?"application/vinteo.webrtc.roomname":i==="x-webrtc-enter-room"?r:i==="x-webrtc-participant-name"?"Test Caller 1":""}})},100),this.timeoutAccepted=setTimeout(()=>{this.trigger("accepted")},200),this.timeoutConfirmed=setTimeout(()=>{this.trigger("confirmed")},300))},A),this.connection}terminate({status_code:e,cause:t}={}){return this.status_code=e,this.trigger("ended",{status_code:e,cause:t,originator:"local"}),this.isEndedInner=!1,this}async terminateAsync({status_code:e,cause:t}={}){this.terminate({status_code:e,cause:t})}terminateRemote({status_code:e}={}){return this.status_code=e,this.trigger("ended",{status_code:e,originator:"remote"}),this}addStream(e,t="getTracks"){e[t]().forEach(r=>this.connection.addTrack(r))}forEachSenders(e){const t=this.connection.getSenders();for(const r of t)e(r);return t}toggleMuteAudio(e){this.forEachSenders(({track:t})=>{t&&t.kind==="audio"&&(t.enabled=!e)})}toggleMuteVideo(e){this.forEachSenders(({track:t})=>{t&&t.kind==="video"&&(t.enabled=!e)})}mute(e){e.audio&&(this.mutedOptions.audio=!0,this.toggleMuteAudio(this.mutedOptions.audio)),e.video&&(this.mutedOptions.video=!0,this.toggleMuteVideo(this.mutedOptions.video)),this.onmute(e)}unmute(e){e.audio&&(this.mutedOptions.audio=!1),e.video&&(this.mutedOptions.video=!1),this.trigger("unmuted",e)}isMuted(){return this.mutedOptions}onmute({audio:e,video:t}){this.trigger("muted",{audio:e,video:t})}async sendInfo(){}isEnded(){return this.isEndedInner}newInfo(e){this.trigger("newInfo",e)}clear(){clearTimeout(this.timeoutStartPresentation),clearTimeout(this.timeoutConnect),clearTimeout(this.timeoutNewInfo),clearTimeout(this.timeoutAccepted),clearTimeout(this.timeoutConfirmed)}}class Et{extraHeaders=[];setExtraHeaders(e){this.extraHeaders=e}setExtraContactParams(){}}const d="PASSWORD_CORRECT",T="PASSWORD_CORRECT_2",L="NAME_INCORRECT",h=400,g={url:"wss://sipServerUrl/webrtc/wss/",sip_uri:"sip:sipServerUrl;transport=ws",via_transport:"WSS"},M={status_code:200,reason_phrase:"OK"},O={status_code:401,reason_phrase:"Unauthorized"};class o{static isAvailableTelephony=!0;static startError;static countStartError=Number.POSITIVE_INFINITY;static countStarts=0;events;registratorInner;call=jest.fn((e,t)=>{const{mediaStream:r,eventHandlers:i}=t;return this.session=new s({eventHandlers:i,originator:"local"}),this.session.connect(e,{mediaStream:r}),this.session});sendOptions=jest.fn((e,t,r)=>{console.log("sendOptions",e,t,r)});start=jest.fn(()=>{if(o.countStarts+=1,o.startError&&o.countStarts<o.countStartError){this.trigger("disconnected",o.startError);return}this.register()});stop=jest.fn(()=>{this.startedTimeout&&clearTimeout(this.startedTimeout),this.stopedTimeout&&clearTimeout(this.stopedTimeout),this.unregister(),this.isStarted()?this.stopedTimeout=setTimeout(()=>{this.trigger("disconnected",{error:!0,socket:g})},h):this.trigger("disconnected",{error:!0,socket:g})});removeAllListeners=jest.fn(()=>(this.events.removeEventHandlers(),this));once=jest.fn((e,t)=>(this.events.once(e,t),this));startedTimeout;stopedTimeout;session;isRegisteredInner;isConnectedInner;configuration;constructor(e){this.events=new S.Events(D);const[t,r]=e.uri.split(":"),[i,c]=r.split("@"),p={...e,uri:new a.URI(t,i,c)};this.configuration=p,this.registratorInner=new Et}static setStartError(e,{count:t=Number.POSITIVE_INFINITY}={}){o.startError=e,o.countStartError=t}static resetStartError(){o.startError=void 0,o.countStartError=Number.POSITIVE_INFINITY,o.countStarts=0}static setAvailableTelephony(){o.isAvailableTelephony=!0}static setNotAvailableTelephony(){o.isAvailableTelephony=!1}static reset(){o.resetStartError(),o.setAvailableTelephony()}on(e,t){return this.events.on(e,t),this}off(e,t){return this.events.off(e,t),this}trigger(e,t){this.events.trigger(e,t)}terminateSessions(){this.session?.terminate()}set(e,t){return this.configuration[e]=t,!0}register(){this.startedTimeout&&clearTimeout(this.startedTimeout);const{password:e,register:t,uri:r}=this.configuration;t===!0&&r.user.includes(L)?(this.isRegisteredInner=!1,this.isConnectedInner=!1,this.startedTimeout=setTimeout(()=>{this.trigger("registrationFailed",{response:O,cause:a.C.causes.REJECTED})},h)):!this.isRegistered()&&t===!0&&(e===d||e===T)?(this.isRegisteredInner=!0,this.startedTimeout=setTimeout(()=>{this.trigger("registered",{response:M})},h)):t===!0&&e!==d&&e!==T&&(this.isRegisteredInner=!1,this.isConnectedInner=!1,this.startedTimeout=setTimeout(()=>{this.trigger("registrationFailed",{response:O,cause:a.C.causes.REJECTED})},h)),o.isAvailableTelephony?(this.trigger("connected",{socket:g}),this.isConnectedInner=!0):this.stop()}unregister(){this.isRegisteredInner=!1,this.isConnectedInner=!1,this.trigger("unregistered",{response:M})}isRegistered(){return this.isRegisteredInner===!0}isConnected(){return this.isConnectedInner===!0}isStarted(){return this.configuration.register===!0&&this.isRegisteredInner===!0||this.configuration.register!==!0&&this.isConnectedInner===!0}newSipEvent(e){this.trigger("sipEvent",e)}registrator(){return this.registratorInner}}class ht{url;constructor(e){this.url=e}}class ut extends b.EventEmitter{contentType;body;constructor(e,t){super(),this.contentType=e,this.body=t}}const I="remote",mt=(n,e)=>{const t=new N(e),r={originator:I,request:t,info:new ut("","")};n.newInfo(r)},lt=(n,e)=>{const r={event:"sipEvent",request:new N(e)};n.newSipEvent(r)},pt=(n,{incomingNumber:e="1234",displayName:t,host:r})=>{const i=new s({originator:I,eventHandlers:{}}),c=new k("sip",e,r);i.remote_identity=new V(c,t);const p=new N([]);n.trigger("newRTCSession",{originator:I,session:i,request:p})},gt=(n,e)=>{e?n.trigger("failed",e):n.trigger("failed",n)},w={triggerNewInfo:mt,triggerNewSipEvent:lt,triggerIncomingSession:pt,triggerFailIncomingSession:gt,WebSocketInterface:ht,UA:o,C:{INVITE:"INVITE"}},u="user",E="displayName",m="SIP_SERVER_URL",C="SIP_WEB_SOCKET_SERVER_URL",_t=new w.WebSocketInterface(C),R={userAgent:"Chrome",sipServerUrl:m,sipWebSocketServerURL:C},Tt={...R},F={...R,user:u,password:d,register:!0},It={...F,displayName:E},St={...R,displayName:E,register:!1},l={session_timers:!1,sockets:[_t],user_agent:"Chrome",sdpSemantics:"unified-plan",register_expires:300,connection_recovery_max_interval:6,connection_recovery_min_interval:2},Nt={...l,password:d,uri:new a.URI("sip",u,m),display_name:"",register:!0},wt={...l,password:d,uri:new a.URI("sip",u,m),display_name:E,register:!0},Ct={...l,display_name:E,register:!1},Rt={...l,display_name:"",register:!1},W="10.10.10.10",ft=[`X-Vinteo-Remote: ${W}`],At=()=>new P.SipConnector({JsSIP:w});exports.FAILED_CONFERENCE_NUMBER=y;exports.JsSIP=w;exports.NAME_INCORRECT=L;exports.PASSWORD_CORRECT=d;exports.PASSWORD_CORRECT_2=T;exports.SIP_SERVER_URL=m;exports.SIP_WEB_SOCKET_SERVER_URL=C;exports.dataForConnectionWithAuthorization=F;exports.dataForConnectionWithAuthorizationWithDisplayName=It;exports.dataForConnectionWithoutAuthorization=St;exports.dataForConnectionWithoutAuthorizationWithoutDisplayName=Tt;exports.displayName=E;exports.doMockSipConnector=At;exports.extraHeadersRemoteAddress=ft;exports.remoteAddress=W;exports.uaConfigurationWithAuthorization=Nt;exports.uaConfigurationWithAuthorizationWithDisplayName=wt;exports.uaConfigurationWithoutAuthorization=Ct;exports.uaConfigurationWithoutAuthorizationWithoutDisplayName=Rt;exports.user=u;
|
package/dist/doMock.js
CHANGED
|
@@ -5,7 +5,7 @@ import { IncomingRequest as F } from "@krivega/jssip/lib/SIPMessage";
|
|
|
5
5
|
import { NameAddrHeader as b, URI as E, C as N } from "@krivega/jssip";
|
|
6
6
|
import { createAudioMediaStreamTrackMock as V, createVideoMediaStreamTrackMock as k } from "webrtc-mock";
|
|
7
7
|
import { Events as T } from "events-constructor";
|
|
8
|
-
import { O as W, S as U } from "./@SipConnector-
|
|
8
|
+
import { O as W, S as U } from "./@SipConnector-D1YBDd7g.js";
|
|
9
9
|
class _ extends F {
|
|
10
10
|
headers;
|
|
11
11
|
constructor(e) {
|
|
@@ -445,6 +445,9 @@ class i extends ot {
|
|
|
445
445
|
});
|
|
446
446
|
replaceMediaStream = jest.fn(async (e) => {
|
|
447
447
|
});
|
|
448
|
+
restartIce = jest.fn(
|
|
449
|
+
async (e) => !0
|
|
450
|
+
);
|
|
448
451
|
isEndedInner = !1;
|
|
449
452
|
delayStartPresentation = 0;
|
|
450
453
|
timeoutStartPresentation;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("events-constructor");const r=require("./@SipConnector-BjWfal-x.cjs"),x=require("@krivega/cancelable-promise"),j=require("repeated-calls"),K=require("ts-debounce"),X=require("ua-parser-js"),Y=require("sequent-promises"),G=n=>n instanceof Object&&("originator"in n||"cause"in n),J=n=>{if(x.isCanceledError(n))return!0;if(!G(n))return!1;const{originator:e,cause:t}=n;return typeof t=="string"?t===r.ECallCause.REQUEST_TIMEOUT||t===r.ECallCause.REJECTED||e===r.Originator.LOCAL&&(t===r.ECallCause.CANCELED||t===r.ECallCause.BYE):!1},z=()=>globalThis.process?.versions?.electron!==void 0,B=()=>{const n=new X.UAParser,{name:e}=n.getBrowser(),t=z();return{isChrome:e==="Chrome"||t}},A=n=>{const{url:e,cause:t}=n;let o=e;return(t===r.ECallCause.BAD_MEDIA_DESCRIPTION||t===r.ECallCause.NOT_FOUND)&&(o=`${n.message.to.uri.user}@${n.message.to.uri.host}`),o};var $=(n=>(n.CONNECT_SERVER_FAILED="CONNECT_SERVER_FAILED",n.WRONG_USER_OR_PASSWORD="WRONG_USER_OR_PASSWORD",n.BAD_MEDIA_ERROR="BAD_MEDIA_ERROR",n.NOT_FOUND_ERROR="NOT_FOUND_ERROR",n.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",n.CONNECT_SERVER_FAILED_BY_LINK="CONNECT_SERVER_FAILED_BY_LINK",n))($||{});const Q=new Error("Unknown error"),Z=(n=Q)=>{const{cause:e,socket:t}=n;let o="CONNECT_SERVER_FAILED";switch(e){case"Forbidden":{o="WRONG_USER_OR_PASSWORD";break}case r.ECallCause.BAD_MEDIA_DESCRIPTION:{o="BAD_MEDIA_ERROR";break}case r.ECallCause.NOT_FOUND:{o="NOT_FOUND_ERROR";break}default:t!==void 0&&t._ws?.readyState===3?o="WS_CONNECTION_FAILED":A(n)!==void 0&&A(n)!==""&&(o="CONNECT_SERVER_FAILED_BY_LINK")}return o},ee=n=>{let e="";try{e=JSON.stringify(n)}catch(t){r.logger("failed to stringify message",t)}return e},ne=new Error("Unknown error"),te=(n=ne)=>{const{code:e,cause:t,message:o}=n,a=A(n),s={code:"",cause:"",message:""};return typeof o=="object"&&o!==null?s.message=ee(o):o&&(s.message=String(o)),a!==void 0&&a!==""&&(s.link=a),e!==void 0&&e!==""&&(s.code=e),t!==void 0&&t!==""&&(s.cause=t),s},re=Object.freeze(Object.defineProperty({__proto__:null,EErrorTypes:$,getLinkError:A,getTypeFromError:Z,getValuesFromError:te},Symbol.toStringTag,{value:"Module"})),oe=({sessionId:n,remoteAddress:e,isMutedAudio:t,isMutedVideo:o,isRegistered:a,isPresentationCall:s})=>{const c=[],l=t?"0":"1",u=o?"0":"1";return c.push(`X-Vinteo-Mic-State: ${l}`,`X-Vinteo-MainCam-State: ${u}`),(a===!1||a===void 0)&&c.push("X-Vinteo-Purgatory-Call: yes"),n!==void 0&&n!==""&&c.push(`X-Vinteo-Session: ${n}`),s===!0&&c.push("X-Vinteo-Presentation-Call: yes"),e!==void 0&&e!==""&&c.push(`X-Vinteo-Remote: ${e}`),c},se="[@*!|]",ae="_",ce=n=>{let e=n;return e=e.replaceAll(new RegExp(se,"g"),ae),e},ie=({appName:n,appVersion:e,browserName:t,browserVersion:o})=>{const s=`${ce(n)} ${e}`;return`ChromeNew - ${t===void 0?s:`${t} ${o}, ${s}`}`},le=({isUnifiedSdpSemantic:n,appVersion:e,browserName:t,browserVersion:o,appName:a})=>n?ie({appVersion:e,browserName:t,browserVersion:o,appName:a}):"Chrome",H="purgatory",D=n=>n===H,ue=n=>e=>[...e].map(o=>async()=>n(o)),de=async({accumulatedKeys:n,sendKey:e,canRunTask:t})=>{const a=ue(e)(n);return Y.sequentPromises(a,t)},ge=n=>t=>(r.logger("onStartMainCam"),n.on("api:admin-start-main-cam",t)),Se=n=>t=>(r.logger("onStartMic"),n.on("api:admin-start-mic",t)),Ce=n=>t=>(r.logger("onStopMainCam"),n.on("api:admin-stop-main-cam",t)),me=n=>t=>(r.logger("onStopMic"),n.on("api:admin-stop-mic",t)),fe=({sipConnector:n})=>{const e=(g,C)=>({isSyncForced:S})=>{if(S===!0){g();return}C()},t=ge(n),o=Ce(n),a=Se(n),s=me(n);let c,l,u,f;const h=({onStartMainCamForced:g,onStartMainCamNotForced:C,onStopMainCamForced:S,onStopMainCamNotForced:p,onStartMicForced:E,onStartMicNotForced:b,onStopMicForced:O,onStopMicNotForced:v})=>{const T=e(g,C);c=t(T);const P=e(S,p);l=o(P);const _=e(E,b);u=a(_);const m=e(O,v);f=s(m)},d=()=>{c?.(),l?.(),u?.(),f?.()};return{start:g=>{h(g)},stop:()=>{d()}}},he=Object.freeze(Object.defineProperty({__proto__:null,PURGATORY_CONFERENCE_NUMBER:H,createSyncMediaState:fe,createUaParser:B,error:re,getExtraHeaders:oe,getUserAgent:le,hasPurgatory:D,prepareMediaStream:r.prepareMediaStream,sendDtmfAccumulated:de,setEncodingsToSender:r.setEncodingsToSender,setParametersToSender:r.setParametersToSender},Symbol.toStringTag,{value:"Module"})),pe=()=>B().isChrome,U=n=>{if(!x.isCanceledError(n)&&!j.hasCanceledError(n))throw n;return{isSuccessful:!1}},Re=({kind:n,readyState:e})=>n==="video"&&e==="live",k=(n,e,{onEnterPurgatory:t,onEnterConference:o})=>{D(n)?t&&t():o&&o({isSuccessProgressCall:e})},L=(n,e)=>{n(),e&&e()},V=(n,e,t)=>{throw n&&n(),e(),t},Ee=new Set(["on","once","onceRace","wait","off","sendDTMF","hangUp","declineToIncomingCall","sendChannels","checkTelephony","waitChannels","ping","connection","isConfigured","isRegistered"]);class be{on;once;onceRace;wait;off;sendDTMF;hangUp;declineToIncomingCall;sendChannels;checkTelephony;waitChannels;ping;connection;isConfigured;isRegistered;sipConnector;constructor(e){return this.sipConnector=e,new Proxy(this,{get:(t,o,a)=>{if(typeof o=="string"&&Ee.has(o)&&o in this.sipConnector){const c=Reflect.get(this.sipConnector,o,this.sipConnector);return typeof c=="function"?c.bind(this.sipConnector):c}const s=Reflect.get(t,o,a);return typeof s=="function"?s.bind(t):s}})}connectToServer=async e=>{const{userAgent:t,sipWebSocketServerURL:o,sipServerUrl:a,remoteAddress:s,displayName:c,name:l,password:u,isRegisteredUser:f,isDisconnectOnFail:h}=e;return r.logger("connectToServer",e),this.sipConnector.connect({userAgent:t,sipWebSocketServerURL:o,sipServerUrl:a,remoteAddress:s,displayName:c,password:u,user:l,register:f}).then(d=>(r.logger("connectToServer then"),{ua:d,isSuccessful:!0})).catch(async d=>(r.logger("connectToServer catch: error",d),h===!0?this.sipConnector.disconnect().then(()=>U(d)).catch(()=>U(d)):U(d)))};callToServer=async e=>{const{conference:t,mediaStream:o,extraHeaders:a,iceServers:s,contentHint:c,degradationPreference:l,sendEncodings:u,offerToReceiveAudio:f,offerToReceiveVideo:h,directionVideo:d,directionAudio:N,setRemoteStreams:y,onBeforeProgressCall:g,onSuccessProgressCall:C,onEnterPurgatory:S,onEnterConference:p,onFailProgressCall:E,onFinishProgressCall:b,onEndedCall:O,onAddedTransceiver:v}=e,T=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:y}),P=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:()=>{T().catch(r.logger)}});r.logger("callToServer",e);const _=async()=>(r.logger("startCall"),this.sipConnector.call({mediaStream:o,extraHeaders:a,iceServers:s,contentHint:c,offerToReceiveAudio:f,offerToReceiveVideo:h,directionVideo:d,directionAudio:N,degradationPreference:l,onAddedTransceiver:v,sendEncodings:u,number:t,ontrack:P}));let m=!1,R;const M=(r.logger("subscribeEnterConference: onEnterConference",p),this.sipConnector.on("api:enterRoom",({room:i})=>{r.logger("enterRoom",{_room:i,isSuccessProgressCall:m}),R=i,(S??p)&&k(R,m,{onEnterPurgatory:S,onEnterConference:p})})),F=i=>(r.logger("onSuccess"),m=!0,T().catch(r.logger),C&&C({isPurgatory:D(R)}),this.sipConnector.onceRace(["call:ended","call:failed"],()=>{L(M,O)}),i),w=i=>(r.logger("onFail"),V(E,M,i)),I=()=>{r.logger("onFinish"),b&&b()};return r.logger("onBeforeProgressCall"),g&&g(t),_().then(F).catch(i=>w(i)).finally(I)};disconnectFromServer=async()=>this.sipConnector.disconnect().then(()=>(r.logger("disconnectFromServer: then"),{isSuccessful:!0})).catch(e=>(r.logger("disconnectFromServer: catch",e),{isSuccessful:!1}));answerToIncomingCall=async e=>{const{mediaStream:t,extraHeaders:o,iceServers:a,contentHint:s,degradationPreference:c,sendEncodings:l,offerToReceiveAudio:u,offerToReceiveVideo:f,directionVideo:h,directionAudio:d,setRemoteStreams:N,onBeforeProgressCall:y,onSuccessProgressCall:g,onEnterPurgatory:C,onEnterConference:S,onFailProgressCall:p,onFinishProgressCall:E,onEndedCall:b,onAddedTransceiver:O}=e,v=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:N}),T=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:()=>{v().catch(r.logger)}});r.logger("answerToIncomingCall",e);const P=async()=>this.sipConnector.answerToIncomingCall({mediaStream:t,extraHeaders:o,iceServers:a,contentHint:s,offerToReceiveAudio:u,offerToReceiveVideo:f,directionVideo:h,directionAudio:d,degradationPreference:c,onAddedTransceiver:O,sendEncodings:l,ontrack:T}),_=()=>{const{remoteCallerData:i}=this.sipConnector;return i.incomingNumber};let m=!1,R;const M=(r.logger("subscribeEnterConference: onEnterConference",S),this.sipConnector.on("api:enterRoom",i=>{r.logger("enterRoom",{_room:i,isSuccessProgressCall:m}),R=i,(C??S)&&k(R,m,{onEnterPurgatory:C,onEnterConference:S})})),F=i=>(r.logger("onSuccess"),m=!0,v().catch(r.logger),g&&g({isPurgatory:D(R)}),this.sipConnector.onceRace(["call:ended","call:failed"],()=>{L(M,b)}),i),w=i=>(r.logger("onFail"),V(p,M,i)),I=()=>{r.logger("onFinish"),E&&E()};if(r.logger("onBeforeProgressCall"),y){const i=_();y(i)}return P().then(F).catch(i=>w(i)).finally(I)};updatePresentation=async({mediaStream:e,isP2P:t,contentHint:o,degradationPreference:a,sendEncodings:s,onAddedTransceiver:c})=>(r.logger("updatePresentation"),this.sipConnector.updatePresentation(e,{isP2P:t,contentHint:o,degradationPreference:a,onAddedTransceiver:c,sendEncodings:s}));startPresentation=async({mediaStream:e,isP2P:t,contentHint:o,degradationPreference:a,sendEncodings:s,callLimit:c,onAddedTransceiver:l})=>(r.logger("startPresentation"),this.sipConnector.startPresentation(e,{isP2P:t,contentHint:o,callLimit:c,degradationPreference:a,onAddedTransceiver:l,sendEncodings:s}));stopShareSipConnector=async({isP2P:e=!1}={})=>(r.logger("stopShareSipConnector"),this.sipConnector.stopPresentation({isP2P:e}).catch(t=>{r.logger(t)}));sendRefusalToTurnOnMic=async()=>{r.logger("sendRefusalToTurnOnMic"),await this.sipConnector.sendRefusalToTurnOnMic().catch(e=>{r.logger("sendRefusalToTurnOnMic: error",e)})};sendRefusalToTurnOnCam=async()=>{r.logger("sendRefusalToTurnOnCam"),await this.sipConnector.sendRefusalToTurnOnCam().catch(e=>{r.logger("sendRefusalToTurnOnCam: error",e)})};sendMediaState=async({isEnabledCam:e,isEnabledMic:t})=>{r.logger("sendMediaState"),await this.sipConnector.sendMediaState({cam:e,mic:t})};replaceMediaStream=async(e,{deleteExisting:t,addMissing:o,forceRenegotiation:a,contentHint:s,degradationPreference:c,sendEncodings:l,onAddedTransceiver:u})=>(r.logger("replaceMediaStream"),this.sipConnector.replaceMediaStream(e,{deleteExisting:t,addMissing:o,forceRenegotiation:a,contentHint:s,degradationPreference:c,onAddedTransceiver:u,sendEncodings:l}));askPermissionToEnableCam=async()=>{r.logger("askPermissionToEnableCam"),await this.sipConnector.askPermissionToEnableCam()};resolveHandleReadyRemoteStreamsDebounced=({onReadyRemoteStreams:e})=>K.debounce(()=>{const t=this.sipConnector.getRemoteStreams();r.logger("remoteStreams",t),t&&e(t)},200);resolveHandleReadyRemoteStreams=({onReadyRemoteStreams:e})=>({track:t})=>{Re(t)&&e()};getRemoteStreams=()=>(r.logger("getRemoteStreams"),this.sipConnector.getRemoteStreams());onUseLicense=e=>(r.logger("onUseLicense"),this.sipConnector.on("api:useLicense",e));onMustStopPresentation=e=>(r.logger("onMustStopPresentation"),this.sipConnector.on("api:mustStopPresentation",e));onMoveToSpectators=e=>(r.logger("onMoveToSpectators"),this.sipConnector.on("api:participant:move-request-to-spectators",e));onMoveToParticipants=e=>(r.logger("onMoveToParticipants"),this.sipConnector.on("api:participant:move-request-to-participants",e));onStats=e=>(r.logger("onStats"),this.sipConnector.on("stats:collected",e));offStats=e=>{r.logger("offStats"),this.sipConnector.off("stats:collected",e)}}var W=(n=>(n.VP8="video/VP8",n.VP9="video/VP9",n.H264="video/H264",n.AV1="video/AV1",n.rtx="video/rtx",n.red="video/red",n.flexfec03="video/flexfec-03",n))(W||{});exports.ECallCause=r.ECallCause;exports.EStatsTypes=r.EStatsTypes;exports.EUseLicense=r.EUseLicense;exports.SipConnector=r.SipConnector;exports.StatsPeerConnection=r.StatsPeerConnection;exports.disableDebug=r.disableDebug;exports.enableDebug=r.enableDebug;exports.getCodecFromSender=r.getCodecFromSender;exports.hasCanceledStartPresentationError=r.hasCanceledStartPresentationError;exports.EMimeTypesVideoCodecs=W;exports.SipConnectorFacade=be;exports.hasAvailableStats=pe;exports.hasCanceledCallError=J;exports.tools=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("events-constructor");const r=require("./@SipConnector-B5FFHZzJ.cjs"),x=require("@krivega/cancelable-promise"),j=require("repeated-calls"),K=require("ts-debounce"),X=require("ua-parser-js"),Y=require("sequent-promises"),G=n=>n instanceof Object&&("originator"in n||"cause"in n),J=n=>{if(x.isCanceledError(n))return!0;if(!G(n))return!1;const{originator:e,cause:t}=n;return typeof t=="string"?t===r.ECallCause.REQUEST_TIMEOUT||t===r.ECallCause.REJECTED||e===r.Originator.LOCAL&&(t===r.ECallCause.CANCELED||t===r.ECallCause.BYE):!1},z=()=>globalThis.process?.versions?.electron!==void 0,B=()=>{const n=new X.UAParser,{name:e}=n.getBrowser(),t=z();return{isChrome:e==="Chrome"||t}},A=n=>{const{url:e,cause:t}=n;let o=e;return(t===r.ECallCause.BAD_MEDIA_DESCRIPTION||t===r.ECallCause.NOT_FOUND)&&(o=`${n.message.to.uri.user}@${n.message.to.uri.host}`),o};var $=(n=>(n.CONNECT_SERVER_FAILED="CONNECT_SERVER_FAILED",n.WRONG_USER_OR_PASSWORD="WRONG_USER_OR_PASSWORD",n.BAD_MEDIA_ERROR="BAD_MEDIA_ERROR",n.NOT_FOUND_ERROR="NOT_FOUND_ERROR",n.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",n.CONNECT_SERVER_FAILED_BY_LINK="CONNECT_SERVER_FAILED_BY_LINK",n))($||{});const Q=new Error("Unknown error"),Z=(n=Q)=>{const{cause:e,socket:t}=n;let o="CONNECT_SERVER_FAILED";switch(e){case"Forbidden":{o="WRONG_USER_OR_PASSWORD";break}case r.ECallCause.BAD_MEDIA_DESCRIPTION:{o="BAD_MEDIA_ERROR";break}case r.ECallCause.NOT_FOUND:{o="NOT_FOUND_ERROR";break}default:t!==void 0&&t._ws?.readyState===3?o="WS_CONNECTION_FAILED":A(n)!==void 0&&A(n)!==""&&(o="CONNECT_SERVER_FAILED_BY_LINK")}return o},ee=n=>{let e="";try{e=JSON.stringify(n)}catch(t){r.logger("failed to stringify message",t)}return e},ne=new Error("Unknown error"),te=(n=ne)=>{const{code:e,cause:t,message:o}=n,a=A(n),s={code:"",cause:"",message:""};return typeof o=="object"&&o!==null?s.message=ee(o):o&&(s.message=String(o)),a!==void 0&&a!==""&&(s.link=a),e!==void 0&&e!==""&&(s.code=e),t!==void 0&&t!==""&&(s.cause=t),s},re=Object.freeze(Object.defineProperty({__proto__:null,EErrorTypes:$,getLinkError:A,getTypeFromError:Z,getValuesFromError:te},Symbol.toStringTag,{value:"Module"})),oe=({sessionId:n,remoteAddress:e,isMutedAudio:t,isMutedVideo:o,isRegistered:a,isPresentationCall:s})=>{const c=[],l=t?"0":"1",u=o?"0":"1";return c.push(`X-Vinteo-Mic-State: ${l}`,`X-Vinteo-MainCam-State: ${u}`),(a===!1||a===void 0)&&c.push("X-Vinteo-Purgatory-Call: yes"),n!==void 0&&n!==""&&c.push(`X-Vinteo-Session: ${n}`),s===!0&&c.push("X-Vinteo-Presentation-Call: yes"),e!==void 0&&e!==""&&c.push(`X-Vinteo-Remote: ${e}`),c},se="[@*!|]",ae="_",ce=n=>{let e=n;return e=e.replaceAll(new RegExp(se,"g"),ae),e},ie=({appName:n,appVersion:e,browserName:t,browserVersion:o})=>{const s=`${ce(n)} ${e}`;return`ChromeNew - ${t===void 0?s:`${t} ${o}, ${s}`}`},le=({isUnifiedSdpSemantic:n,appVersion:e,browserName:t,browserVersion:o,appName:a})=>n?ie({appVersion:e,browserName:t,browserVersion:o,appName:a}):"Chrome",H="purgatory",D=n=>n===H,ue=n=>e=>[...e].map(o=>async()=>n(o)),de=async({accumulatedKeys:n,sendKey:e,canRunTask:t})=>{const a=ue(e)(n);return Y.sequentPromises(a,t)},ge=n=>t=>(r.logger("onStartMainCam"),n.on("api:admin-start-main-cam",t)),Se=n=>t=>(r.logger("onStartMic"),n.on("api:admin-start-mic",t)),Ce=n=>t=>(r.logger("onStopMainCam"),n.on("api:admin-stop-main-cam",t)),me=n=>t=>(r.logger("onStopMic"),n.on("api:admin-stop-mic",t)),fe=({sipConnector:n})=>{const e=(g,C)=>({isSyncForced:S})=>{if(S===!0){g();return}C()},t=ge(n),o=Ce(n),a=Se(n),s=me(n);let c,l,u,f;const h=({onStartMainCamForced:g,onStartMainCamNotForced:C,onStopMainCamForced:S,onStopMainCamNotForced:p,onStartMicForced:E,onStartMicNotForced:b,onStopMicForced:O,onStopMicNotForced:v})=>{const T=e(g,C);c=t(T);const P=e(S,p);l=o(P);const _=e(E,b);u=a(_);const m=e(O,v);f=s(m)},d=()=>{c?.(),l?.(),u?.(),f?.()};return{start:g=>{h(g)},stop:()=>{d()}}},he=Object.freeze(Object.defineProperty({__proto__:null,PURGATORY_CONFERENCE_NUMBER:H,createSyncMediaState:fe,createUaParser:B,error:re,getExtraHeaders:oe,getUserAgent:le,hasPurgatory:D,prepareMediaStream:r.prepareMediaStream,sendDtmfAccumulated:de,setEncodingsToSender:r.setEncodingsToSender,setParametersToSender:r.setParametersToSender},Symbol.toStringTag,{value:"Module"})),pe=()=>B().isChrome,U=n=>{if(!x.isCanceledError(n)&&!j.hasCanceledError(n))throw n;return{isSuccessful:!1}},Re=({kind:n,readyState:e})=>n==="video"&&e==="live",k=(n,e,{onEnterPurgatory:t,onEnterConference:o})=>{D(n)?t&&t():o&&o({isSuccessProgressCall:e})},L=(n,e)=>{n(),e&&e()},V=(n,e,t)=>{throw n&&n(),e(),t},Ee=new Set(["on","once","onceRace","wait","off","sendDTMF","hangUp","declineToIncomingCall","sendChannels","checkTelephony","waitChannels","ping","connection","isConfigured","isRegistered"]);class be{on;once;onceRace;wait;off;sendDTMF;hangUp;declineToIncomingCall;sendChannels;checkTelephony;waitChannels;ping;connection;isConfigured;isRegistered;sipConnector;constructor(e){return this.sipConnector=e,new Proxy(this,{get:(t,o,a)=>{if(typeof o=="string"&&Ee.has(o)&&o in this.sipConnector){const c=Reflect.get(this.sipConnector,o,this.sipConnector);return typeof c=="function"?c.bind(this.sipConnector):c}const s=Reflect.get(t,o,a);return typeof s=="function"?s.bind(t):s}})}connectToServer=async e=>{const{userAgent:t,sipWebSocketServerURL:o,sipServerUrl:a,remoteAddress:s,displayName:c,name:l,password:u,isRegisteredUser:f,isDisconnectOnFail:h}=e;return r.logger("connectToServer",e),this.sipConnector.connect({userAgent:t,sipWebSocketServerURL:o,sipServerUrl:a,remoteAddress:s,displayName:c,password:u,user:l,register:f}).then(d=>(r.logger("connectToServer then"),{ua:d,isSuccessful:!0})).catch(async d=>(r.logger("connectToServer catch: error",d),h===!0?this.sipConnector.disconnect().then(()=>U(d)).catch(()=>U(d)):U(d)))};callToServer=async e=>{const{conference:t,mediaStream:o,extraHeaders:a,iceServers:s,contentHint:c,degradationPreference:l,sendEncodings:u,offerToReceiveAudio:f,offerToReceiveVideo:h,directionVideo:d,directionAudio:N,setRemoteStreams:y,onBeforeProgressCall:g,onSuccessProgressCall:C,onEnterPurgatory:S,onEnterConference:p,onFailProgressCall:E,onFinishProgressCall:b,onEndedCall:O,onAddedTransceiver:v}=e,T=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:y}),P=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:()=>{T().catch(r.logger)}});r.logger("callToServer",e);const _=async()=>(r.logger("startCall"),this.sipConnector.call({mediaStream:o,extraHeaders:a,iceServers:s,contentHint:c,offerToReceiveAudio:f,offerToReceiveVideo:h,directionVideo:d,directionAudio:N,degradationPreference:l,onAddedTransceiver:v,sendEncodings:u,number:t,ontrack:P}));let m=!1,R;const M=(r.logger("subscribeEnterConference: onEnterConference",p),this.sipConnector.on("api:enterRoom",({room:i})=>{r.logger("enterRoom",{_room:i,isSuccessProgressCall:m}),R=i,(S??p)&&k(R,m,{onEnterPurgatory:S,onEnterConference:p})})),F=i=>(r.logger("onSuccess"),m=!0,T().catch(r.logger),C&&C({isPurgatory:D(R)}),this.sipConnector.onceRace(["call:ended","call:failed"],()=>{L(M,O)}),i),w=i=>(r.logger("onFail"),V(E,M,i)),I=()=>{r.logger("onFinish"),b&&b()};return r.logger("onBeforeProgressCall"),g&&g(t),_().then(F).catch(i=>w(i)).finally(I)};disconnectFromServer=async()=>this.sipConnector.disconnect().then(()=>(r.logger("disconnectFromServer: then"),{isSuccessful:!0})).catch(e=>(r.logger("disconnectFromServer: catch",e),{isSuccessful:!1}));answerToIncomingCall=async e=>{const{mediaStream:t,extraHeaders:o,iceServers:a,contentHint:s,degradationPreference:c,sendEncodings:l,offerToReceiveAudio:u,offerToReceiveVideo:f,directionVideo:h,directionAudio:d,setRemoteStreams:N,onBeforeProgressCall:y,onSuccessProgressCall:g,onEnterPurgatory:C,onEnterConference:S,onFailProgressCall:p,onFinishProgressCall:E,onEndedCall:b,onAddedTransceiver:O}=e,v=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:N}),T=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:()=>{v().catch(r.logger)}});r.logger("answerToIncomingCall",e);const P=async()=>this.sipConnector.answerToIncomingCall({mediaStream:t,extraHeaders:o,iceServers:a,contentHint:s,offerToReceiveAudio:u,offerToReceiveVideo:f,directionVideo:h,directionAudio:d,degradationPreference:c,onAddedTransceiver:O,sendEncodings:l,ontrack:T}),_=()=>{const{remoteCallerData:i}=this.sipConnector;return i.incomingNumber};let m=!1,R;const M=(r.logger("subscribeEnterConference: onEnterConference",S),this.sipConnector.on("api:enterRoom",i=>{r.logger("enterRoom",{_room:i,isSuccessProgressCall:m}),R=i,(C??S)&&k(R,m,{onEnterPurgatory:C,onEnterConference:S})})),F=i=>(r.logger("onSuccess"),m=!0,v().catch(r.logger),g&&g({isPurgatory:D(R)}),this.sipConnector.onceRace(["call:ended","call:failed"],()=>{L(M,b)}),i),w=i=>(r.logger("onFail"),V(p,M,i)),I=()=>{r.logger("onFinish"),E&&E()};if(r.logger("onBeforeProgressCall"),y){const i=_();y(i)}return P().then(F).catch(i=>w(i)).finally(I)};updatePresentation=async({mediaStream:e,isP2P:t,contentHint:o,degradationPreference:a,sendEncodings:s,onAddedTransceiver:c})=>(r.logger("updatePresentation"),this.sipConnector.updatePresentation(e,{isP2P:t,contentHint:o,degradationPreference:a,onAddedTransceiver:c,sendEncodings:s}));startPresentation=async({mediaStream:e,isP2P:t,contentHint:o,degradationPreference:a,sendEncodings:s,callLimit:c,onAddedTransceiver:l})=>(r.logger("startPresentation"),this.sipConnector.startPresentation(e,{isP2P:t,contentHint:o,callLimit:c,degradationPreference:a,onAddedTransceiver:l,sendEncodings:s}));stopShareSipConnector=async({isP2P:e=!1}={})=>(r.logger("stopShareSipConnector"),this.sipConnector.stopPresentation({isP2P:e}).catch(t=>{r.logger(t)}));sendRefusalToTurnOnMic=async()=>{r.logger("sendRefusalToTurnOnMic"),await this.sipConnector.sendRefusalToTurnOnMic().catch(e=>{r.logger("sendRefusalToTurnOnMic: error",e)})};sendRefusalToTurnOnCam=async()=>{r.logger("sendRefusalToTurnOnCam"),await this.sipConnector.sendRefusalToTurnOnCam().catch(e=>{r.logger("sendRefusalToTurnOnCam: error",e)})};sendMediaState=async({isEnabledCam:e,isEnabledMic:t})=>{r.logger("sendMediaState"),await this.sipConnector.sendMediaState({cam:e,mic:t})};replaceMediaStream=async(e,{deleteExisting:t,addMissing:o,forceRenegotiation:a,contentHint:s,degradationPreference:c,sendEncodings:l,onAddedTransceiver:u})=>(r.logger("replaceMediaStream"),this.sipConnector.replaceMediaStream(e,{deleteExisting:t,addMissing:o,forceRenegotiation:a,contentHint:s,degradationPreference:c,onAddedTransceiver:u,sendEncodings:l}));askPermissionToEnableCam=async()=>{r.logger("askPermissionToEnableCam"),await this.sipConnector.askPermissionToEnableCam()};resolveHandleReadyRemoteStreamsDebounced=({onReadyRemoteStreams:e})=>K.debounce(()=>{const t=this.sipConnector.getRemoteStreams();r.logger("remoteStreams",t),t&&e(t)},200);resolveHandleReadyRemoteStreams=({onReadyRemoteStreams:e})=>({track:t})=>{Re(t)&&e()};getRemoteStreams=()=>(r.logger("getRemoteStreams"),this.sipConnector.getRemoteStreams());onUseLicense=e=>(r.logger("onUseLicense"),this.sipConnector.on("api:useLicense",e));onMustStopPresentation=e=>(r.logger("onMustStopPresentation"),this.sipConnector.on("api:mustStopPresentation",e));onMoveToSpectators=e=>(r.logger("onMoveToSpectators"),this.sipConnector.on("api:participant:move-request-to-spectators",e));onMoveToParticipants=e=>(r.logger("onMoveToParticipants"),this.sipConnector.on("api:participant:move-request-to-participants",e));onStats=e=>(r.logger("onStats"),this.sipConnector.on("stats:collected",e));offStats=e=>{r.logger("offStats"),this.sipConnector.off("stats:collected",e)}}var W=(n=>(n.VP8="video/VP8",n.VP9="video/VP9",n.H264="video/H264",n.AV1="video/AV1",n.rtx="video/rtx",n.red="video/red",n.flexfec03="video/flexfec-03",n))(W||{});exports.ECallCause=r.ECallCause;exports.EStatsTypes=r.EStatsTypes;exports.EUseLicense=r.EUseLicense;exports.SipConnector=r.SipConnector;exports.StatsPeerConnection=r.StatsPeerConnection;exports.disableDebug=r.disableDebug;exports.enableDebug=r.enableDebug;exports.getCodecFromSender=r.getCodecFromSender;exports.hasCanceledStartPresentationError=r.hasCanceledStartPresentationError;exports.EMimeTypesVideoCodecs=W;exports.SipConnectorFacade=be;exports.hasAvailableStats=pe;exports.hasCanceledCallError=J;exports.tools=he;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "events-constructor";
|
|
2
|
-
import { E as h, O as K, l as o, p as X, s as Y, a as G } from "./@SipConnector-
|
|
3
|
-
import { c as ke, b as Le, S as xe, f as Ve, d as Be, e as $e, g as He, h as We } from "./@SipConnector-
|
|
2
|
+
import { E as h, O as K, l as o, p as X, s as Y, a as G } from "./@SipConnector-D1YBDd7g.js";
|
|
3
|
+
import { c as ke, b as Le, S as xe, f as Ve, d as Be, e as $e, g as He, h as We } from "./@SipConnector-D1YBDd7g.js";
|
|
4
4
|
import { isCanceledError as B } from "@krivega/cancelable-promise";
|
|
5
5
|
import { hasCanceledError as q } from "repeated-calls";
|
|
6
6
|
import { debounce as z } from "ts-debounce";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-connector",
|
|
3
|
-
"version": "16.0
|
|
3
|
+
"version": "16.2.0",
|
|
4
4
|
"description": "Module for connect to Vinteo server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"prepare": "husky",
|
|
46
46
|
"prepublishOnly": "yarn build",
|
|
47
47
|
"preview": "vite preview",
|
|
48
|
-
"release": "standard-version && npm run release:publish && npm publish --access=public",
|
|
49
|
-
"release:alpha": "standard-version --prerelease alpha && npm run release:publish && npm publish --tag alpha",
|
|
50
|
-
"release:major": "standard-version --release-as major && npm run release:publish && npm publish --access=public",
|
|
51
|
-
"release:pre": "standard-version --prerelease && npm run release:publish && npm publish --tag prerelease",
|
|
48
|
+
"release": "standard-version && npm run release:publish && npm publish --access=public --registry=https://registry.npmjs.org/",
|
|
49
|
+
"release:alpha": "standard-version --prerelease alpha && npm run release:publish && npm publish --tag alpha --registry=https://registry.npmjs.org/",
|
|
50
|
+
"release:major": "standard-version --release-as major && npm run release:publish && npm publish --access=public --registry=https://registry.npmjs.org/",
|
|
51
|
+
"release:pre": "standard-version --prerelease && npm run release:publish && npm publish --tag prerelease --registry=https://registry.npmjs.org/",
|
|
52
52
|
"release:publish": "git push --follow-tags",
|
|
53
53
|
"test": "jest",
|
|
54
54
|
"test:ci": "cross-env CI=true jest",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@krivega/cancelable-promise": "^1.1.4",
|
|
60
|
-
"@krivega/jssip": "^5.
|
|
60
|
+
"@krivega/jssip": "^5.3.0",
|
|
61
61
|
"@krivega/timeout-requester": "^1.0.0",
|
|
62
62
|
"debug": "^4.4.1",
|
|
63
63
|
"events-constructor": "^2.0.0",
|
|
@@ -65,39 +65,39 @@
|
|
|
65
65
|
"sequent-promises": "^2.0.1",
|
|
66
66
|
"stack-promises": "^2.0.3",
|
|
67
67
|
"ts-debounce": "^4.0.0",
|
|
68
|
-
"ua-parser-js": "^2.0.
|
|
68
|
+
"ua-parser-js": "^2.0.5",
|
|
69
69
|
"webrtc-mock": "^1.2.1",
|
|
70
|
-
"xstate": "^5.
|
|
70
|
+
"xstate": "^5.21.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@babel/preset-typescript": "^7.27.1",
|
|
74
74
|
"@commitlint/cli": "^19.8.1",
|
|
75
75
|
"@commitlint/config-conventional": "^19.8.1",
|
|
76
76
|
"@eslint/compat": "^1.3.2",
|
|
77
|
-
"@krivega/eslint-config": "^1.0.
|
|
77
|
+
"@krivega/eslint-config": "^1.0.3",
|
|
78
78
|
"@types/debug": "^4.1.12",
|
|
79
79
|
"@types/dom-mediacapture-transform": "^0.1.11",
|
|
80
80
|
"@types/jest": "^30.0.0",
|
|
81
81
|
"cross-env": "^10.0.0",
|
|
82
82
|
"husky": "^9.1.7",
|
|
83
|
-
"jest": "^30.1.
|
|
84
|
-
"jest-environment-jsdom": "^30.1.
|
|
83
|
+
"jest": "^30.1.3",
|
|
84
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
85
85
|
"jest-extended": "^6.0.0",
|
|
86
86
|
"jest-junit": "^16.0.0",
|
|
87
|
-
"lint-staged": "^16.1.
|
|
87
|
+
"lint-staged": "^16.1.6",
|
|
88
88
|
"prettier": "^3.6.2",
|
|
89
89
|
"standard-version": "^9.5.0",
|
|
90
90
|
"ts-jest": "^29.4.1",
|
|
91
91
|
"ts-node": "^10.9.2",
|
|
92
92
|
"tsc-files": "^1.1.4",
|
|
93
93
|
"typescript": "^5.9.2",
|
|
94
|
-
"vite": "^7.1.
|
|
94
|
+
"vite": "^7.1.5",
|
|
95
95
|
"vite-plugin-dts": "^4.5.4",
|
|
96
96
|
"vite-tsconfig-paths": "^5.1.4"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@krivega/cancelable-promise": "^1.1.4",
|
|
100
|
-
"@krivega/jssip": "^5.
|
|
100
|
+
"@krivega/jssip": "^5.3.0",
|
|
101
101
|
"@krivega/timeout-requester": "^1.0.0",
|
|
102
102
|
"debug": "^4.4.1",
|
|
103
103
|
"events-constructor": "^2.0.0",
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"sequent-promises": "^2.0.1",
|
|
106
106
|
"stack-promises": "^2.0.3",
|
|
107
107
|
"ts-debounce": "^4.0.0",
|
|
108
|
-
"ua-parser-js": "^2.0.
|
|
108
|
+
"ua-parser-js": "^2.0.5",
|
|
109
109
|
"webrtc-mock": "^1.2.1",
|
|
110
|
-
"xstate": "^5.
|
|
110
|
+
"xstate": "^5.21.0"
|
|
111
111
|
},
|
|
112
112
|
"packageManager": "yarn@1.22.22"
|
|
113
113
|
}
|