uneeq-js 2.56.0 → 3.0.16-preview.11
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 +41 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +636 -2
- package/dist/lib/api/api.d.ts +6 -0
- package/dist/lib/logger.d.ts +12 -0
- package/dist/session.d.ts +18 -0
- package/dist/session.spec.d.ts +1 -0
- package/dist/signaling.d.ts +16 -0
- package/dist/{src/service/speech-handler.d.ts → speech-recognition.d.ts} +8 -19
- package/dist/types/CreateSessionResponse.d.ts +4 -0
- package/dist/types/LogLevel.d.ts +8 -0
- package/dist/types/SignalingEvents.d.ts +16 -0
- package/dist/{src/types → types}/SpeechHandlerOptions.d.ts +0 -7
- package/dist/{src/types → types}/SpeechRecognitionStartMessage.d.ts +0 -1
- package/dist/types/UneeqConfig.d.ts +15 -0
- package/dist/{src/types/MessageTypes.d.ts → types/UneeqMessages.d.ts} +11 -59
- package/dist/uneeq.d.ts +18 -0
- package/dist/webrtc-data-channel/ChatPrompt.d.ts +7 -0
- package/dist/webrtc-data-channel/DataChannelAction.d.ts +5 -0
- package/dist/webrtc-data-channel/DataChannelActionType.d.ts +5 -0
- package/dist/webrtc-data-channel/DataChannelMessage.d.ts +4 -0
- package/dist/webrtc-data-channel/SpeakRequest.d.ts +7 -0
- package/dist/webrtc-data-channel/messages/CameraAnchor.d.ts +17 -0
- package/dist/webrtc-data-channel/messages/ChatPrompt.d.ts +7 -0
- package/dist/webrtc-data-channel/messages/SpeakRequest.d.ts +7 -0
- package/package.json +30 -51
- 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 -108
- 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 -52648
- package/readme.md +0 -285
- /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}/SpeechRecognitionStopMessage.d.ts +0 -0
- /package/dist/{src/types → types}/SpeechTranscriptionResult.d.ts +0 -0
|
@@ -1,108 +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
|
-
* This option specifies whether VAD should be used when voiceInputMode is set to SPEECH_RECOGNITION.
|
|
58
|
-
* If set to false, then pauseSpeechRecognition and resumeSpeechRecognition must be called to capture the users audio.
|
|
59
|
-
* If set to true, or omitted, then the users audio will be captured automatically.
|
|
60
|
-
*/
|
|
61
|
-
enableVad?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Resume user session if available.
|
|
64
|
-
*/
|
|
65
|
-
resumeSession?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* This option specifies the URL of the background image to be used when the digital human is rendered.
|
|
68
|
-
*/
|
|
69
|
-
backgroundImageUrl?: string;
|
|
70
|
-
/**
|
|
71
|
-
* This option specifies the URL of the name tag image to be used when the digital human is rendered.
|
|
72
|
-
*/
|
|
73
|
-
nameTagImageUrl?: string;
|
|
74
|
-
/**
|
|
75
|
-
* This option specifies up to four locales that the Digital Human should understand a person speaking (speech recognition)
|
|
76
|
-
* The locales are specified in the BCP-47 format e.g "en-US".
|
|
77
|
-
* The first locale is considered the primary locale.
|
|
78
|
-
* Locales should be separated with a colon e.g "en-US:en-GB:en-AU".
|
|
79
|
-
*/
|
|
80
|
-
speechToTextLocales?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Override the asset base path.
|
|
83
|
-
*/
|
|
84
|
-
assetBasePath?: string;
|
|
85
|
-
/**
|
|
86
|
-
* Speech Recognition Hint Phrases
|
|
87
|
-
* A comma separated list of phrases the speech recognition system should expect.
|
|
88
|
-
*/
|
|
89
|
-
speechRecognitionHintPhrases?: string;
|
|
90
|
-
/**
|
|
91
|
-
* Speech Recognition Hint Phrases Boost
|
|
92
|
-
* An integer number between 0 and 20 that can be used to boost the hint phrases likely hood to match.
|
|
93
|
-
*/
|
|
94
|
-
speechRecognitionHintPhrasesBoost?: number;
|
|
95
|
-
/**
|
|
96
|
-
* Custom Metadata
|
|
97
|
-
* A stringified value that will be sent to BYO NLPs with all chat calls like playWelcomeMessage and sendTranscript requests.
|
|
98
|
-
* This can be set to any stringified value.
|
|
99
|
-
*/
|
|
100
|
-
customMetadata?: string;
|
|
101
|
-
/**
|
|
102
|
-
* Enable Interrupt By Speech
|
|
103
|
-
* When using SPEECH_RECOGNITION mode, this option will allow the user to interrupt the Digital Human by speaking over them.
|
|
104
|
-
* If this value is false, the Digital Human will not be interrupted by the user. The default value is false - users cannot
|
|
105
|
-
* interrupt the Digital Human. Note: Sending a text message will interrupt the digital human irrespective of this setting.
|
|
106
|
-
*/
|
|
107
|
-
enableInterruptBySpeech?: boolean;
|
|
108
|
-
}
|
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
|
-
}
|