@vogent/vogent-web-client 0.0.3 → 0.0.4
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/VogentCall.ts +6 -8
- package/devices/VogentDevice.ts +2 -2
- package/devices/VonageDevice.ts +2 -2
- package/package.json +1 -1
package/VogentCall.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
REFRESH_TRANSCRIPT,
|
|
18
18
|
} from './queries';
|
|
19
19
|
import { createClient } from 'graphql-ws';
|
|
20
|
-
import { VogentDevice } from './devices/VogentDevice';
|
|
20
|
+
import { VogentAudioConn, VogentDevice } from './devices/VogentDevice';
|
|
21
21
|
import { VonageDevice } from './devices/VonageDevice';
|
|
22
22
|
import { dialStatusIsComplete } from './utils';
|
|
23
23
|
|
|
@@ -149,7 +149,7 @@ export class VogentCall {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
async connectAudio(liveListen: boolean = false) {
|
|
152
|
+
async connectAudio(liveListen: boolean = false): Promise<VogentAudioConn> {
|
|
153
153
|
const token = await this.client.mutate({
|
|
154
154
|
mutation: AI_GET_TOKEN,
|
|
155
155
|
variables: {
|
|
@@ -163,11 +163,13 @@ export class VogentCall {
|
|
|
163
163
|
const d: VogentDevice = await VonageDevice.getDevice(token.data!.browserDialToken.token, true);
|
|
164
164
|
|
|
165
165
|
const c = await d.connect({
|
|
166
|
-
params: { EltoDialSessionID: this.sessionId, LiveListen: liveListen },
|
|
166
|
+
params: { EltoDialSessionID: this.sessionId, LiveListen: liveListen, DialID: this.dialId },
|
|
167
167
|
});
|
|
168
|
+
|
|
169
|
+
return c;
|
|
168
170
|
}
|
|
169
171
|
|
|
170
|
-
async start(
|
|
172
|
+
async start() {
|
|
171
173
|
this.subscription = this.client
|
|
172
174
|
.subscribe({
|
|
173
175
|
query: AI_CONNECT_SESSION,
|
|
@@ -196,10 +198,6 @@ export class VogentCall {
|
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
});
|
|
199
|
-
|
|
200
|
-
if (!disableAudio) {
|
|
201
|
-
await this.connectAudio();
|
|
202
|
-
}
|
|
203
201
|
}
|
|
204
202
|
|
|
205
203
|
async setPaused(paused: boolean) {
|
package/devices/VogentDevice.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface VogentAudioConn {
|
|
4
4
|
on: (ev: 'mute' | 'disconnect', fn: (...args: any[]) => void) => void;
|
|
5
5
|
mute: (status: boolean) => void;
|
|
6
6
|
disconnect: () => void;
|
|
@@ -8,5 +8,5 @@ export interface VogentCall {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface VogentDevice {
|
|
11
|
-
connect: (p: any) => Promise<
|
|
11
|
+
connect: (p: any) => Promise<VogentAudioConn>;
|
|
12
12
|
}
|
package/devices/VonageDevice.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VogentAudioConn } from './VogentDevice';
|
|
2
2
|
import { VonageClient, LoggingLevel } from '@vonage/client-sdk';
|
|
3
3
|
|
|
4
4
|
export class VonageCall {
|
|
@@ -95,7 +95,7 @@ export class VonageDevice {
|
|
|
95
95
|
return new VonageDevice(sessId, client, disableEffects);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
async connect(p: any): Promise<
|
|
98
|
+
async connect(p: any): Promise<VogentAudioConn> {
|
|
99
99
|
const call = await this._client.serverCall(p.params);
|
|
100
100
|
const v = new VonageCall(call, this._client, p.params);
|
|
101
101
|
return v;
|