@vogent/vogent-web-client 0.0.10 → 0.1.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.
@@ -48,6 +48,7 @@ import { AI_CONNECT_SESSION, AI_GET_TOKEN, AI_HANGUP_CALL, AI_START_DIAL_SESSION
48
48
  import { createClient } from 'graphql-ws';
49
49
  import { VonageDevice } from './devices/VonageDevice';
50
50
  import { dialStatusIsComplete } from './utils';
51
+ import { LivekitDevice } from './devices/LivekitDevice';
51
52
  /**
52
53
  * VogentCall manages the lifecycle and state of a voice call session
53
54
  */
@@ -177,7 +178,13 @@ export class VogentCall {
177
178
  },
178
179
  },
179
180
  });
180
- const d = await VonageDevice.getDevice(token.data.browserDialToken.token, true);
181
+ let d;
182
+ if (token.data.browserDialToken.telephonyProvider === 'livekit') {
183
+ d = await LivekitDevice.getDevice(token.data.browserDialToken.token, token.data.browserDialToken.url);
184
+ }
185
+ else {
186
+ d = await VonageDevice.getDevice(token.data.browserDialToken.token, true);
187
+ }
181
188
  const c = await d.connect({
182
189
  params: { EltoDialSessionID: this.sessionId, LiveListen: liveListen, DialID: this.dialId },
183
190
  });
@@ -12,9 +12,6 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
12
12
  * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
13
13
  */
14
14
  declare const documents: {
15
- "\nmutation CreateAdHocDialSession($input: CreateAdHocDialSessionInput!) {\n createAdHocDialSession(input: $input) {\n id\n telephonyProvider\n }\n}": DocumentNode<types.CreateAdHocDialSessionMutation, types.Exact<{
16
- input: types.CreateAdHocDialSessionInput;
17
- }>>;
18
15
  "\n mutation StartDialSession($sessionId: ID!) {\n startDialSession(dialSessionId: $sessionId)\n }\n": DocumentNode<types.StartDialSessionMutation, types.Exact<{
19
16
  sessionId: types.Scalars["ID"]["input"];
20
17
  }>>;
@@ -30,7 +27,7 @@ declare const documents: {
30
27
  "\n subscription RefreshTranscript($dialId: ID!) {\n watchTranscript(dialId: $dialId) {\n speaker\n text\n detailType\n }\n }\n": DocumentNode<types.RefreshTranscriptSubscription, types.Exact<{
31
28
  dialId: types.Scalars["ID"]["input"];
32
29
  }>>;
33
- "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n }\n }\n": DocumentNode<types.BrowserDialTokenMutation, types.Exact<{
30
+ "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n telephonyProvider\n url\n }\n }\n": DocumentNode<types.BrowserDialTokenMutation, types.Exact<{
34
31
  input: types.BrowserDialTokenInput;
35
32
  }>>;
36
33
  "\n subscription ConnectSession($sessionId: ID!) {\n connectSession(sessionId: $sessionId) {\n messageType\n content {\n __typename\n ... on DialsUpdatedMessage {\n contactId\n dials {\n id\n status\n answerType\n phoneField\n callDispositionId\n systemResultType\n toNumber\n }\n contactComplete\n }\n ... on DialConnectMessage {\n dialId\n }\n ... on SessionUpdatedMessage {\n dialSession {\n id\n status\n }\n reason\n }\n }\n }\n }\n": DocumentNode<types.ConnectSessionSubscription, types.Exact<{
@@ -50,10 +47,6 @@ declare const documents: {
50
47
  * Please regenerate the types.
51
48
  */
52
49
  export declare function gql(source: string): unknown;
53
- /**
54
- * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
55
- */
56
- export declare function gql(source: "\nmutation CreateAdHocDialSession($input: CreateAdHocDialSessionInput!) {\n createAdHocDialSession(input: $input) {\n id\n telephonyProvider\n }\n}"): (typeof documents)["\nmutation CreateAdHocDialSession($input: CreateAdHocDialSessionInput!) {\n createAdHocDialSession(input: $input) {\n id\n telephonyProvider\n }\n}"];
57
50
  /**
58
51
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
59
52
  */
@@ -73,7 +66,7 @@ export declare function gql(source: "\n subscription RefreshTranscript($dialId:
73
66
  /**
74
67
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
75
68
  */
76
- export declare function gql(source: "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n }\n }\n"): (typeof documents)["\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n }\n }\n"];
69
+ export declare function gql(source: "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n telephonyProvider\n url\n }\n }\n"): (typeof documents)["\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n telephonyProvider\n url\n }\n }\n"];
77
70
  /**
78
71
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
79
72
  */
@@ -12,12 +12,11 @@ import * as types from './graphql';
12
12
  * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
13
13
  */
14
14
  const documents = {
15
- "\nmutation CreateAdHocDialSession($input: CreateAdHocDialSessionInput!) {\n createAdHocDialSession(input: $input) {\n id\n telephonyProvider\n }\n}": types.CreateAdHocDialSessionDocument,
16
15
  "\n mutation StartDialSession($sessionId: ID!) {\n startDialSession(dialSessionId: $sessionId)\n }\n": types.StartDialSessionDocument,
17
16
  "\n mutation HangupCall($dialId: ID!, $dropVoicemail: Boolean, $transferNumber: String) {\n hangupCall(dialId: $dialId, dropVoicemail: $dropVoicemail, transferNumber: $transferNumber)\n }\n": types.HangupCallDocument,
18
17
  "\n mutation SetPaused($dialId: ID!, $pauseStatus: Boolean!) {\n pauseAI(dialId: $dialId, pauseStatus: $pauseStatus) {\n id\n }\n }\n": types.SetPausedDocument,
19
18
  "\n subscription RefreshTranscript($dialId: ID!) {\n watchTranscript(dialId: $dialId) {\n speaker\n text\n detailType\n }\n }\n": types.RefreshTranscriptDocument,
20
- "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n }\n }\n": types.BrowserDialTokenDocument,
19
+ "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n telephonyProvider\n url\n }\n }\n": types.BrowserDialTokenDocument,
21
20
  "\n subscription ConnectSession($sessionId: ID!) {\n connectSession(sessionId: $sessionId) {\n messageType\n content {\n __typename\n ... on DialsUpdatedMessage {\n contactId\n dials {\n id\n status\n answerType\n phoneField\n callDispositionId\n systemResultType\n toNumber\n }\n contactComplete\n }\n ... on DialConnectMessage {\n dialId\n }\n ... on SessionUpdatedMessage {\n dialSession {\n id\n status\n }\n reason\n }\n }\n }\n }\n": types.ConnectSessionDocument,
22
21
  };
23
22
  export function gql(source) {