uneeq-js 2.49.2 → 3.0.16-preview.6
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 +21 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +559 -2
- package/dist/session.d.ts +18 -0
- package/dist/signaling.d.ts +15 -0
- package/dist/{src/service/speech-handler.d.ts → speech-recognition.d.ts} +7 -8
- package/dist/types/DataChannelMessage.d.ts +5 -0
- package/dist/types/LogLevel.d.ts +6 -0
- package/dist/types/SignalingEvents.d.ts +16 -0
- package/dist/{src/types → types}/SpeechHandlerOptions.d.ts +0 -4
- package/dist/types/UneeqConfig.d.ts +15 -0
- package/dist/{src/types/MessageTypes.d.ts → types/UneeqMessages.d.ts} +9 -37
- package/dist/uneeq.d.ts +15 -0
- package/package.json +26 -50
- package/dist/index.js.LICENSE.txt +0 -29
- package/dist/src/index.d.ts +0 -5
- package/dist/src/lib/media-utils.d.ts +0 -4
- package/dist/src/lib/soundmeter.d.ts +0 -13
- package/dist/src/lib/videoeditor.d.ts +0 -4
- package/dist/src/service/api.d.ts +0 -39
- package/dist/src/service/canvas-service.d.ts +0 -11
- package/dist/src/service/device-manager.d.ts +0 -46
- package/dist/src/service/digital-human-video-play-manager.d.ts +0 -13
- package/dist/src/service/locale-detector.d.ts +0 -14
- package/dist/src/service/logger.d.ts +0 -23
- package/dist/src/service/media-handler.d.ts +0 -26
- package/dist/src/service/message-handler.d.ts +0 -14
- package/dist/src/service/messaging/index.d.ts +0 -6
- package/dist/src/service/messaging/message.d.ts +0 -3
- package/dist/src/service/messaging/messaging-client.d.ts +0 -4
- package/dist/src/service/messaging/messaging-options.d.ts +0 -22
- package/dist/src/service/messaging/messaging-service.d.ts +0 -21
- package/dist/src/service/messaging/messaging-state.d.ts +0 -5
- package/dist/src/service/metrics-service.d.ts +0 -13
- package/dist/src/service/online-status-service.d.ts +0 -12
- package/dist/src/service/prom.d.ts +0 -38
- package/dist/src/service/resume-session-check.d.ts +0 -6
- package/dist/src/service/stream-manager.d.ts +0 -13
- package/dist/src/service/uneeq-local-storage.d.ts +0 -9
- package/dist/src/service/uneeq-webrtc.d.ts +0 -66
- package/dist/src/service/voice-input-manager.d.ts +0 -35
- package/dist/src/types/AvatarAvailableCountResponse.d.ts +0 -3
- package/dist/src/types/ChatMetadata.d.ts +0 -9
- package/dist/src/types/ClientPerformanceStats.d.ts +0 -16
- package/dist/src/types/Devices.d.ts +0 -5
- package/dist/src/types/FaceMeMessage.d.ts +0 -3
- package/dist/src/types/LogoDimensions.d.ts +0 -6
- package/dist/src/types/LogoMargin.d.ts +0 -5
- package/dist/src/types/MediaUnavailableRequest.d.ts +0 -5
- package/dist/src/types/NewSessionRequest.d.ts +0 -19
- package/dist/src/types/NewSessionResponse.d.ts +0 -15
- package/dist/src/types/PersonaStartRequest.d.ts +0 -7
- package/dist/src/types/PublishSubscribeState.d.ts +0 -6
- package/dist/src/types/ResumeSessionCheckResponse.d.ts +0 -4
- package/dist/src/types/SourceApp.d.ts +0 -7
- package/dist/src/types/UneeqOptions.d.ts +0 -90
- package/dist/src/types/VoiceInputMode.d.ts +0 -5
- package/dist/src/types/types.d.ts +0 -2
- package/dist/src/typings.d.ts +0 -4
- package/dist/src/uneeq.d.ts +0 -180
- package/dist/umd/index.js +0 -52495
- package/readme.md +0 -252
- /package/dist/{src/lib → lib}/vad/frame-processor.d.ts +0 -0
- /package/dist/{src/lib → lib}/vad/messages.d.ts +0 -0
- /package/dist/{src/lib → lib}/vad/models.d.ts +0 -0
- /package/dist/{src/lib → lib}/vad/real-time-vad.d.ts +0 -0
- /package/dist/{src/types → types}/SpeechRecognitionMessageAction.d.ts +0 -0
- /package/dist/{src/types → types}/SpeechRecognitionStartMessage.d.ts +0 -0
- /package/dist/{src/types → types}/SpeechRecognitionStopMessage.d.ts +0 -0
- /package/dist/{src/types → types}/SpeechTranscriptionResult.d.ts +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Subject } from 'rxjs';
|
|
2
|
-
import { UneeqOptions } from '..';
|
|
3
|
-
export declare class MetricsService {
|
|
4
|
-
private uneeqOptions;
|
|
5
|
-
private internalMessages;
|
|
6
|
-
private messages;
|
|
7
|
-
private clientPerformanceStats;
|
|
8
|
-
private options;
|
|
9
|
-
private internalMessages$;
|
|
10
|
-
private messages$;
|
|
11
|
-
constructor(uneeqOptions: UneeqOptions, internalMessages: Subject<any>, messages: Subject<any>);
|
|
12
|
-
parseAndLogWebRtcStats(stats: any): void;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Subject } from 'rxjs';
|
|
2
|
-
export declare class OnlineStatusService {
|
|
3
|
-
private messages;
|
|
4
|
-
private offlineTimeoutLimitHandler;
|
|
5
|
-
online: boolean;
|
|
6
|
-
private offlineDisconnectTimeLimitMS;
|
|
7
|
-
private disconnectTimer;
|
|
8
|
-
constructor(messages: Subject<any>, offlineTimeoutLimitHandler: () => void);
|
|
9
|
-
private handleOffline;
|
|
10
|
-
private handleOnline;
|
|
11
|
-
private sendStatusUpdate;
|
|
12
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Counter } from 'promjs/counter';
|
|
2
|
-
import { Histogram } from 'promjs/histogram';
|
|
3
|
-
import { Registry } from 'promjs/registry';
|
|
4
|
-
export declare enum PromMessageType {
|
|
5
|
-
SessionStart = 0,
|
|
6
|
-
WebRtcPerformance = 1,
|
|
7
|
-
AvailabilityCheck = 2,
|
|
8
|
-
QuestionMessageReceived = 3,
|
|
9
|
-
AnswerMessageReceived = 4,
|
|
10
|
-
SessionEnded = 5
|
|
11
|
-
}
|
|
12
|
-
export interface PromMessage {
|
|
13
|
-
type: PromMessageType;
|
|
14
|
-
labels?: any;
|
|
15
|
-
value?: any;
|
|
16
|
-
}
|
|
17
|
-
export declare class Prom {
|
|
18
|
-
private apiUrl;
|
|
19
|
-
prom_prefix: string;
|
|
20
|
-
registry: Registry;
|
|
21
|
-
messageTimings: any;
|
|
22
|
-
metricsPushedCounter: Counter;
|
|
23
|
-
sessionStartTime: Histogram;
|
|
24
|
-
availabilityCheckTime: Histogram;
|
|
25
|
-
webRtcInboundRTT: Histogram;
|
|
26
|
-
webRtcInboundFramesPerSec: Histogram;
|
|
27
|
-
webRtcInboundPacketsLost: Histogram;
|
|
28
|
-
webRtcFramesDropped: Histogram;
|
|
29
|
-
webRtcFrameHeight: Histogram;
|
|
30
|
-
webRtcFrameWidth: Histogram;
|
|
31
|
-
conversationRoundTripTime: Histogram;
|
|
32
|
-
private metricsIntervalId;
|
|
33
|
-
constructor(apiUrl: string);
|
|
34
|
-
handleMessage(msg: PromMessage): void;
|
|
35
|
-
calculateConversationRtt(msg: PromMessage): number;
|
|
36
|
-
sendMetrics(): void;
|
|
37
|
-
private stopSendingMetrics;
|
|
38
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ResumeSessionCheckResponse } from '../types/ResumeSessionCheckResponse';
|
|
2
|
-
import { UneeqOptions } from '../types/UneeqOptions';
|
|
3
|
-
export declare class ResumeSessionCheck {
|
|
4
|
-
static validate(options: UneeqOptions): ResumeSessionCheckResponse;
|
|
5
|
-
static browserTabIsActive(): boolean;
|
|
6
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare class StreamManager {
|
|
2
|
-
private readonly silentAudioTrack;
|
|
3
|
-
private readonly canvasVideoTrack;
|
|
4
|
-
private audioContextInstance?;
|
|
5
|
-
private audioSourceNode?;
|
|
6
|
-
private audioSourceDestination?;
|
|
7
|
-
constructor();
|
|
8
|
-
addCanvasVideoTrackToStream(stream: MediaStream): MediaStream;
|
|
9
|
-
addSilentAudioTrackToStream(stream: MediaStream): MediaStream;
|
|
10
|
-
resumeAudioContext(): void;
|
|
11
|
-
private generateCanvasVideoTrack;
|
|
12
|
-
private generateSilentAudioTrack;
|
|
13
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class UneeqLocalStorage {
|
|
2
|
-
private localStorageAvailable?;
|
|
3
|
-
constructor();
|
|
4
|
-
get available(): boolean;
|
|
5
|
-
setItemSafely(key: string, value: string): void;
|
|
6
|
-
getItemSafely(key: string): any;
|
|
7
|
-
removeItemSafely(key: string): void;
|
|
8
|
-
private checkIfLocalStorageAvailable;
|
|
9
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Subject } from 'rxjs';
|
|
2
|
-
import { UneeqMessage } from '..';
|
|
3
|
-
import { MessagingService } from './messaging';
|
|
4
|
-
/**
|
|
5
|
-
* Uneeq WebRTC implementation which hides the complexity of making a WebRTC call.
|
|
6
|
-
*/
|
|
7
|
-
export declare class UneeqWebRTC {
|
|
8
|
-
private client;
|
|
9
|
-
private readonly uniqueId;
|
|
10
|
-
private readonly options;
|
|
11
|
-
private readonly fakeDataChannel;
|
|
12
|
-
private statTimer?;
|
|
13
|
-
private readonly MESSAGING_ENDPOINT;
|
|
14
|
-
constructor(options: UneeqWebRTCOptions);
|
|
15
|
-
/**
|
|
16
|
-
* Start a connection with the given streams.
|
|
17
|
-
*/
|
|
18
|
-
connect(stream: MediaStream): void;
|
|
19
|
-
/**
|
|
20
|
-
* Close the connection.
|
|
21
|
-
*/
|
|
22
|
-
close(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Handle the WebRTC answer message
|
|
25
|
-
* @return boolean true if we handled this
|
|
26
|
-
*/
|
|
27
|
-
handleAnswerMessage(msg: any): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Handle the ice candidate message.
|
|
30
|
-
* @return boolean true if we handled this
|
|
31
|
-
*/
|
|
32
|
-
handleIceCandidate(msg: any): boolean;
|
|
33
|
-
sendDataMessage(message: string): void;
|
|
34
|
-
getStats(callback: any): any;
|
|
35
|
-
updateStreamTracks(stream: MediaStream): void;
|
|
36
|
-
private onStats;
|
|
37
|
-
private enableDiagnostics;
|
|
38
|
-
private isMessageForUs;
|
|
39
|
-
/**
|
|
40
|
-
* Log a message to the console. This will prepend our UneeqWebRTC prefix.
|
|
41
|
-
*/
|
|
42
|
-
private log;
|
|
43
|
-
/**
|
|
44
|
-
* Log a message to the console as a warning. This will prepend our UneeqWebRTC prefix.
|
|
45
|
-
*/
|
|
46
|
-
private warn;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The options for the WebRTC class.
|
|
50
|
-
* Note: this isn't an interface so that we can have default values.
|
|
51
|
-
*/
|
|
52
|
-
export interface UneeqWebRTCOptions {
|
|
53
|
-
messaging: MessagingService;
|
|
54
|
-
userMessages: Subject<UneeqMessage>;
|
|
55
|
-
edgeNodeId: string;
|
|
56
|
-
publishStreamName: string;
|
|
57
|
-
subscribeStreamName: string;
|
|
58
|
-
iceServers?: RTCIceServer[];
|
|
59
|
-
forceTurnServerUse?: boolean;
|
|
60
|
-
diagnostics?: boolean;
|
|
61
|
-
onAddStream?: (stream: any) => void;
|
|
62
|
-
onConnect?: () => void;
|
|
63
|
-
onData?: (data: any) => void;
|
|
64
|
-
onClose?: () => void;
|
|
65
|
-
onError?: (error: any) => void;
|
|
66
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Subject } from 'rxjs';
|
|
2
|
-
import { UneeqOptions } from '../types/UneeqOptions';
|
|
3
|
-
import { VoiceInputMode } from '../types/VoiceInputMode';
|
|
4
|
-
import { API } from './api';
|
|
5
|
-
export declare class VoiceInputManager {
|
|
6
|
-
private options;
|
|
7
|
-
private api;
|
|
8
|
-
private messages;
|
|
9
|
-
private enableMicrophone;
|
|
10
|
-
private readonly microphoneEngageVolume;
|
|
11
|
-
private readonly microphoneDisengageVolume;
|
|
12
|
-
private readonly voiceActivityNotSpeakingTimeoutMS;
|
|
13
|
-
private readonly voiceActivityAllowInterruptions;
|
|
14
|
-
private soundMeter;
|
|
15
|
-
private audioContext;
|
|
16
|
-
private digitalHumanSpeaking;
|
|
17
|
-
private recording;
|
|
18
|
-
private silenceTimeout?;
|
|
19
|
-
private stream?;
|
|
20
|
-
constructor(options: UneeqOptions, api: API, messages: Subject<any>, enableMicrophone: (enabled: boolean) => void);
|
|
21
|
-
setVoiceInputMode(mode: VoiceInputMode | string): void;
|
|
22
|
-
startRecording(): void;
|
|
23
|
-
stopRecording(): void;
|
|
24
|
-
handleSessionEnd(): void;
|
|
25
|
-
resumeAudioContext(): void;
|
|
26
|
-
initMicActivity(stream: MediaStream): void;
|
|
27
|
-
private audioContextNotSupported;
|
|
28
|
-
private handleAppMessages;
|
|
29
|
-
private requestNotSupportedInVoiceActivityMode;
|
|
30
|
-
private apiStartRecording;
|
|
31
|
-
private apiStopRecording;
|
|
32
|
-
private micActivityConnected;
|
|
33
|
-
private handleVoiceActivity;
|
|
34
|
-
private clearSilenceTimeout;
|
|
35
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface ClientPerformanceStats {
|
|
2
|
-
inboundRoundTripTime?: ClientPerformanceStat;
|
|
3
|
-
inboundNewPacketsLost?: ClientPerformanceStat;
|
|
4
|
-
inboundTotalPacketsLost?: ClientPerformanceStat;
|
|
5
|
-
outboundQualityLimitationReason?: ClientPerformanceStat;
|
|
6
|
-
newFramesDropped?: ClientPerformanceStat;
|
|
7
|
-
totalFramesDropped?: ClientPerformanceStat;
|
|
8
|
-
framesPerSec?: ClientPerformanceStat;
|
|
9
|
-
frameHeight?: ClientPerformanceStat;
|
|
10
|
-
frameWidth?: ClientPerformanceStat;
|
|
11
|
-
}
|
|
12
|
-
export declare class ClientPerformanceStat {
|
|
13
|
-
readonly label: string;
|
|
14
|
-
readonly value: any;
|
|
15
|
-
constructor(label?: string, value?: any);
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface NewSessionRequest {
|
|
2
|
-
sessionType: SessionType;
|
|
3
|
-
workspaceName: string;
|
|
4
|
-
customData?: NewSessionCustomData;
|
|
5
|
-
sdkVersion: string;
|
|
6
|
-
tokenId?: string;
|
|
7
|
-
clientWidth?: number;
|
|
8
|
-
clientHeight?: number;
|
|
9
|
-
resumeSessionId?: string;
|
|
10
|
-
}
|
|
11
|
-
interface NewSessionCustomData {
|
|
12
|
-
additionalProp1: string;
|
|
13
|
-
additionalProp2: string;
|
|
14
|
-
additionalProp3: string;
|
|
15
|
-
}
|
|
16
|
-
export declare enum SessionType {
|
|
17
|
-
WEB = 0
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface NewSessionResponse {
|
|
2
|
-
avatarStreamId: string;
|
|
3
|
-
enableWebRTC: true;
|
|
4
|
-
forceTurnServerUse: true;
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
sensitiveData: true;
|
|
8
|
-
streamId: string;
|
|
9
|
-
turnServerAddresses: string[];
|
|
10
|
-
turnUsername: string;
|
|
11
|
-
turnPassword: string;
|
|
12
|
-
edgeNodeId?: string;
|
|
13
|
-
sourceApp?: string;
|
|
14
|
-
showUneeqLogo: boolean;
|
|
15
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { VoiceInputMode } from './VoiceInputMode';
|
|
2
|
-
export interface UneeqOptions {
|
|
3
|
-
/** Server URL to connect to. */
|
|
4
|
-
url: string;
|
|
5
|
-
/** The API Key to access the Uneeq service. */
|
|
6
|
-
apiKey?: string;
|
|
7
|
-
/** The div element that the avatars video should be placed inside. */
|
|
8
|
-
avatarVideoContainerElement: HTMLDivElement;
|
|
9
|
-
/** The div element that the local video should be placed inside. */
|
|
10
|
-
localVideoContainerElement: HTMLDivElement;
|
|
11
|
-
/** Uneeq conversation ID to use for the session. */
|
|
12
|
-
conversationId: string;
|
|
13
|
-
/**
|
|
14
|
-
* @ignore
|
|
15
|
-
*/
|
|
16
|
-
customData?: any;
|
|
17
|
-
/** Provide a function to be used for message handler call backs. */
|
|
18
|
-
messageHandler?: (msg: any) => void;
|
|
19
|
-
/** Whether you want to receive mic activity messages or not. Default value is false. */
|
|
20
|
-
micActivityMessages?: boolean;
|
|
21
|
-
/** Device ID of the preferred microphone to start the session with. */
|
|
22
|
-
preferredMicrophoneId?: string;
|
|
23
|
-
/** Device ID of the preferred camera to start the session with. */
|
|
24
|
-
preferredCameraId?: string;
|
|
25
|
-
/** Device ID of the preferred speaker to start the session with. */
|
|
26
|
-
preferredSpeakerId?: string;
|
|
27
|
-
/** Enable Logging. Default value is false. */
|
|
28
|
-
logging?: boolean;
|
|
29
|
-
/** Play Welcome Message. Default value is false. */
|
|
30
|
-
playWelcome?: boolean;
|
|
31
|
-
/** Enable diagnostic callbacks. Default value is false. */
|
|
32
|
-
diagnostics?: boolean;
|
|
33
|
-
/** Whether the users local video stream (camera) should be sent on session start. Default value is true. */
|
|
34
|
-
sendLocalVideo?: boolean;
|
|
35
|
-
/** Whether the users local audio stream (microphone) should be sent on session start. Default value is true. */
|
|
36
|
-
sendLocalAudio?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* This option controls the visibility of client-side network performance messages in the developer console.
|
|
39
|
-
* These WebRTC statistics (eg packetsLost, framesDropped, framesPerSec) help identify if session quality is being
|
|
40
|
-
* impacted by client-side conditions.
|
|
41
|
-
* Irrespective of this visibility setting, UneeQ's servers receive these messages to help measure platform
|
|
42
|
-
* performance and stability for end users.
|
|
43
|
-
*/
|
|
44
|
-
enableClientPerformanceMessage?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* This option controls whether the Digital Human is rendered with a transparent background,
|
|
47
|
-
* allowing them to be overlaid on top of your experience.
|
|
48
|
-
* If true, the digital human's configured background image will be replaced with a transparent background.
|
|
49
|
-
* If false, your configured background image will be displayed. Defaults to false.
|
|
50
|
-
*/
|
|
51
|
-
enableTransparentBackground?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* This option specifies what the default voice input mode will be.
|
|
54
|
-
*/
|
|
55
|
-
voiceInputMode: VoiceInputMode | string;
|
|
56
|
-
/**
|
|
57
|
-
* Resume user session if available.
|
|
58
|
-
*/
|
|
59
|
-
resumeSession?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* This option specifies the URL of the background image to be used when the digital human is rendered.
|
|
62
|
-
*/
|
|
63
|
-
backgroundImageUrl?: string;
|
|
64
|
-
/**
|
|
65
|
-
* This option specifies the URL of the name tag image to be used when the digital human is rendered.
|
|
66
|
-
*/
|
|
67
|
-
nameTagImageUrl?: string;
|
|
68
|
-
/**
|
|
69
|
-
* This option specifies up to four locales that the Digital Human should understand a person speaking (speech recognition)
|
|
70
|
-
* The locales are specified in the BCP-47 format e.g "en-US".
|
|
71
|
-
* The first locale is considered the primary locale.
|
|
72
|
-
* Locales should be separated with a colon e.g "en-US:en-GB:en-AU".
|
|
73
|
-
*/
|
|
74
|
-
speechToTextLocales?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Override the asset base path.
|
|
77
|
-
*/
|
|
78
|
-
assetBasePath?: string;
|
|
79
|
-
/**
|
|
80
|
-
* Speech Recognition Hint Phrases
|
|
81
|
-
* A space separated list of phrases the speech recognition system should expect.
|
|
82
|
-
*/
|
|
83
|
-
speechRecognitionHintPhrases?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Custom Metadata
|
|
86
|
-
* A stringified value that will be sent to BYO NLPs with all chat calls like playWelcomeMessage and sendTranscript requests.
|
|
87
|
-
* This can be set to any stringified value.
|
|
88
|
-
*/
|
|
89
|
-
customMetadata?: string;
|
|
90
|
-
}
|
package/dist/src/typings.d.ts
DELETED
package/dist/src/uneeq.d.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { UneeqOptions } from './types/types';
|
|
3
|
-
import { VoiceInputMode } from './types/VoiceInputMode';
|
|
4
|
-
export declare class Uneeq {
|
|
5
|
-
/**
|
|
6
|
-
* The active session id as a string. If the session has not started yet value will be null
|
|
7
|
-
*/
|
|
8
|
-
get sessionId(): string | null;
|
|
9
|
-
static onDataMessage: (msg: any) => void;
|
|
10
|
-
static onStatMessage: (stats: any) => void;
|
|
11
|
-
ready: BehaviorSubject<boolean>;
|
|
12
|
-
version: string;
|
|
13
|
-
private messages;
|
|
14
|
-
private internalMessages$;
|
|
15
|
-
private session;
|
|
16
|
-
private dhVideoPlayManager;
|
|
17
|
-
private api;
|
|
18
|
-
private messaging;
|
|
19
|
-
private sessionPaused;
|
|
20
|
-
private sessionStarted;
|
|
21
|
-
private deviceManager;
|
|
22
|
-
private messageHandler;
|
|
23
|
-
private voiceInputManager;
|
|
24
|
-
private unavailableAvatarMsgSent;
|
|
25
|
-
private speechHandler;
|
|
26
|
-
private readonly options;
|
|
27
|
-
private readonly messageCallback;
|
|
28
|
-
private readonly startSessionData;
|
|
29
|
-
private metricsService;
|
|
30
|
-
private sessionJwt;
|
|
31
|
-
private startSessionTime;
|
|
32
|
-
private availableResponseTime;
|
|
33
|
-
private streamManager;
|
|
34
|
-
private digitalHumanVideoElement;
|
|
35
|
-
private sessionWasResumed;
|
|
36
|
-
private uneeqLocalStorage;
|
|
37
|
-
private chatMetadata;
|
|
38
|
-
constructor(options: UneeqOptions);
|
|
39
|
-
setLoggerEnabled(enabled: boolean): void;
|
|
40
|
-
/**
|
|
41
|
-
* Initialise the session. ReadyMessage will be sent when init is ready.
|
|
42
|
-
*/
|
|
43
|
-
init(): void;
|
|
44
|
-
/**
|
|
45
|
-
* Initialise the session. ReadyMessage will be sent when init is ready. initWithToken
|
|
46
|
-
* should be used instead of init() when a third party conversation service is used.
|
|
47
|
-
*/
|
|
48
|
-
initWithToken(tokenId: string): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Set a preferred camera to use in a live session. On success, SetCameraSuccessMessage
|
|
51
|
-
* will be sent. DeviceNotFoundErrorMessage will be sent when the requested device is not found.
|
|
52
|
-
* @param deviceId
|
|
53
|
-
*/
|
|
54
|
-
setCamera(deviceId: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Set a preferred microphone to use in a live session. On success, SetMicSuccessMessage
|
|
57
|
-
* will be sent. DeviceNotFoundErrorMessage will be sent when the requested device is not found.
|
|
58
|
-
* @param deviceId
|
|
59
|
-
*/
|
|
60
|
-
setMic(deviceId: string): void;
|
|
61
|
-
/**
|
|
62
|
-
* Set a preferred speaker to use in a live session. On success, SetSpeakerSuccessMessage
|
|
63
|
-
* will be sent. DeviceNotFoundErrorMessage will be sent when the requested device is not found.
|
|
64
|
-
* @param deviceId
|
|
65
|
-
*/
|
|
66
|
-
setSpeaker(deviceId: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* Set the microphone input mode to be used.
|
|
69
|
-
* @param mode PUSH_TO_TALK or VOICE_ACTIVITY
|
|
70
|
-
*/
|
|
71
|
-
setVoiceInputMode(mode: VoiceInputMode): void;
|
|
72
|
-
/**
|
|
73
|
-
* Enable or disable the users microphone
|
|
74
|
-
* @param enable Defaults to true
|
|
75
|
-
*/
|
|
76
|
-
enableMicrophone(enable?: boolean): void;
|
|
77
|
-
/**
|
|
78
|
-
* Enable or disable the users camera
|
|
79
|
-
* @param enable Defaults to true
|
|
80
|
-
*/
|
|
81
|
-
enableCamera(enable?: boolean): void;
|
|
82
|
-
/**
|
|
83
|
-
* Enable or disable the users microphone and camera
|
|
84
|
-
* @param enable Defaults to true
|
|
85
|
-
*/
|
|
86
|
-
enableMicrophoneAndCamera(enable?: boolean): void;
|
|
87
|
-
/**
|
|
88
|
-
* Set the custom field in chat metadata to a string value that will be sent
|
|
89
|
-
* to BYO NLPs with all chat calls like playWelcomeMessage and sendTranscript requests.
|
|
90
|
-
*
|
|
91
|
-
* @param customMetadata
|
|
92
|
-
*/
|
|
93
|
-
setCustomChatMetadata(customMetadata: string): void;
|
|
94
|
-
/**
|
|
95
|
-
* Send a text based message to the avatar.
|
|
96
|
-
* @param text
|
|
97
|
-
*/
|
|
98
|
-
sendTranscript(text: string): void;
|
|
99
|
-
getServerStats(): void;
|
|
100
|
-
/**
|
|
101
|
-
* Start Recording voice audio through microphone. Call this method before using voice to speak to avatar.
|
|
102
|
-
* stopRecording should be called when finished speaking.
|
|
103
|
-
*/
|
|
104
|
-
startRecording(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Stop Recording voice audio through microphone. Call this method after startRecording has been called.
|
|
107
|
-
*/
|
|
108
|
-
stopRecording(): void;
|
|
109
|
-
/**
|
|
110
|
-
* Stop the avatar from speaking. This will stop avatar speaking even if interrupts are turned off.
|
|
111
|
-
* When successful a corresponding AvatarRequestCompleted should be received.
|
|
112
|
-
*/
|
|
113
|
-
stopSpeaking(): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Pause speech recognition. The users speech will not be processed, or sent off their device.
|
|
116
|
-
* This is the equivilent of muting the users microphone.
|
|
117
|
-
*/
|
|
118
|
-
pauseSpeechRecognition(): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Resume speech recognition. The users speech will being being processed again.
|
|
121
|
-
* This is the equivilent of unmuting the users microphone.
|
|
122
|
-
*/
|
|
123
|
-
resumeSpeechRecognition(): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Pauses a live session. Local video and audio will stop being sent and remote avatar video audio will be stopped.
|
|
126
|
-
* On success, SessionPausedMessage will be sent.
|
|
127
|
-
*/
|
|
128
|
-
pauseSession(): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Resumes a live session. Local video and audio will start being sent again and remote avatar video audio will be
|
|
131
|
-
* restarted. On success, SessionResumedMessage will be sent.
|
|
132
|
-
*/
|
|
133
|
-
resumeSession(): boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Ends the session, releases the microphone and camera and ends the avatar process. On success,
|
|
136
|
-
* SessionEndedMessage will be sent. On error, ErrorEndingSessionMessage will be sent.
|
|
137
|
-
*/
|
|
138
|
-
endSession(): void;
|
|
139
|
-
/**
|
|
140
|
-
* Show Avatar Debugging
|
|
141
|
-
* @param enabled
|
|
142
|
-
*/
|
|
143
|
-
setAvatarDebug(enabled: boolean): Promise<any>;
|
|
144
|
-
/**
|
|
145
|
-
* Trigger this conversation's welcome message
|
|
146
|
-
*/
|
|
147
|
-
playWelcomeMessage(): Promise<void>;
|
|
148
|
-
unmuteDigitalHuman(): void;
|
|
149
|
-
private initDigitalHumanVideoElement;
|
|
150
|
-
private gatherWebRtcMetrics;
|
|
151
|
-
/**
|
|
152
|
-
* Initializes the real time messaging service. On ready, ReadyMessage will be sent.
|
|
153
|
-
*/
|
|
154
|
-
private initMessaging;
|
|
155
|
-
private initDeviceManager;
|
|
156
|
-
private sessionLiveHandler;
|
|
157
|
-
private initAvatar;
|
|
158
|
-
private startAvatarWhenAvailable;
|
|
159
|
-
/**
|
|
160
|
-
* Initialize the session. Starts avatar process on server and initializes messaging.
|
|
161
|
-
*/
|
|
162
|
-
private initialize;
|
|
163
|
-
/**
|
|
164
|
-
* Sends a service unavailable message to the client. On success, ServiceUnavailableMessage will be sent.
|
|
165
|
-
*/
|
|
166
|
-
private sendServiceUnavailableMessage;
|
|
167
|
-
private serviceReadyCheck;
|
|
168
|
-
private checkWebRTCSupport;
|
|
169
|
-
/**
|
|
170
|
-
* Initialise online status update messages
|
|
171
|
-
*/
|
|
172
|
-
private initOnlineStatusUpdateMessages;
|
|
173
|
-
private initPromMetricsListener;
|
|
174
|
-
/**
|
|
175
|
-
* Check if resume session functionality is available (localStorage is available)
|
|
176
|
-
* Warn implementer if unavailable
|
|
177
|
-
*/
|
|
178
|
-
private checkIfResumeSessionIsAvailable;
|
|
179
|
-
private initChatMetadata;
|
|
180
|
-
}
|