@vogent/vogent-web-client 0.0.7 → 0.0.8
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/dist/VogentCall.d.ts +121 -0
- package/dist/VogentCall.js +247 -0
- package/dist/__generated__/gql.d.ts +82 -0
- package/dist/__generated__/gql.js +25 -0
- package/dist/__generated__/graphql.d.ts +2367 -0
- package/dist/__generated__/graphql.js +216 -0
- package/dist/__generated__/index.d.ts +1 -0
- package/dist/__generated__/index.js +1 -0
- package/dist/codegen.d.ts +3 -0
- package/dist/codegen.js +25 -0
- package/dist/devices/VogentDevice.d.ts +43 -0
- package/dist/devices/VogentDevice.js +2 -0
- package/dist/devices/VonageDevice.d.ts +25 -0
- package/dist/devices/VonageDevice.js +79 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/queries.d.ts +21 -0
- package/{queries.ts → dist/queries.js} +0 -14
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +16 -0
- package/package.json +20 -2
- package/VogentCall.ts +0 -329
- package/__generated__/gql.ts +0 -73
- package/__generated__/graphql.ts +0 -2843
- package/__generated__/index.ts +0 -1
- package/codegen.ts +0 -29
- package/devices/VogentDevice.ts +0 -49
- package/devices/VonageDevice.ts +0 -103
- package/index.ts +0 -3
- package/utils.ts +0 -16
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export var AgentType;
|
|
2
|
+
(function (AgentType) {
|
|
3
|
+
AgentType["CustomFlow"] = "CUSTOM_FLOW";
|
|
4
|
+
AgentType["Standard"] = "STANDARD";
|
|
5
|
+
})(AgentType || (AgentType = {}));
|
|
6
|
+
export var AiModelAccessType;
|
|
7
|
+
(function (AiModelAccessType) {
|
|
8
|
+
AiModelAccessType["Deny"] = "DENY";
|
|
9
|
+
AiModelAccessType["Grant"] = "GRANT";
|
|
10
|
+
})(AiModelAccessType || (AiModelAccessType = {}));
|
|
11
|
+
export var AnswerType;
|
|
12
|
+
(function (AnswerType) {
|
|
13
|
+
AnswerType["Human"] = "HUMAN";
|
|
14
|
+
AnswerType["Machine"] = "MACHINE";
|
|
15
|
+
AnswerType["Other"] = "OTHER";
|
|
16
|
+
AnswerType["Unknown"] = "UNKNOWN";
|
|
17
|
+
})(AnswerType || (AnswerType = {}));
|
|
18
|
+
export var BrowserDialTokenType;
|
|
19
|
+
(function (BrowserDialTokenType) {
|
|
20
|
+
BrowserDialTokenType["DialSession"] = "DIAL_SESSION";
|
|
21
|
+
BrowserDialTokenType["LiveListen"] = "LIVE_LISTEN";
|
|
22
|
+
})(BrowserDialTokenType || (BrowserDialTokenType = {}));
|
|
23
|
+
export var CrmActivityType;
|
|
24
|
+
(function (CrmActivityType) {
|
|
25
|
+
CrmActivityType["Call"] = "CALL";
|
|
26
|
+
CrmActivityType["Note"] = "NOTE";
|
|
27
|
+
})(CrmActivityType || (CrmActivityType = {}));
|
|
28
|
+
export var CallDirection;
|
|
29
|
+
(function (CallDirection) {
|
|
30
|
+
CallDirection["Incoming"] = "INCOMING";
|
|
31
|
+
CallDirection["Outgoing"] = "OUTGOING";
|
|
32
|
+
})(CallDirection || (CallDirection = {}));
|
|
33
|
+
export var CallType;
|
|
34
|
+
(function (CallType) {
|
|
35
|
+
CallType["Browser"] = "BROWSER";
|
|
36
|
+
CallType["Phone"] = "PHONE";
|
|
37
|
+
})(CallType || (CallType = {}));
|
|
38
|
+
export var ChatStreamMessageType;
|
|
39
|
+
(function (ChatStreamMessageType) {
|
|
40
|
+
ChatStreamMessageType["AppendText"] = "APPEND_TEXT";
|
|
41
|
+
ChatStreamMessageType["NewSpeakerRes"] = "NEW_SPEAKER_RES";
|
|
42
|
+
})(ChatStreamMessageType || (ChatStreamMessageType = {}));
|
|
43
|
+
export var CoachingCommentVisibility;
|
|
44
|
+
(function (CoachingCommentVisibility) {
|
|
45
|
+
CoachingCommentVisibility["ManagerOnly"] = "MANAGER_ONLY";
|
|
46
|
+
CoachingCommentVisibility["VisibleToRep"] = "VISIBLE_TO_REP";
|
|
47
|
+
})(CoachingCommentVisibility || (CoachingCommentVisibility = {}));
|
|
48
|
+
export var ConnectionStatus;
|
|
49
|
+
(function (ConnectionStatus) {
|
|
50
|
+
ConnectionStatus["ApiKeyConnected"] = "API_KEY_CONNECTED";
|
|
51
|
+
ConnectionStatus["LegacyConnected"] = "LEGACY_CONNECTED";
|
|
52
|
+
ConnectionStatus["NotConnected"] = "NOT_CONNECTED";
|
|
53
|
+
ConnectionStatus["OauthConnected"] = "OAUTH_CONNECTED";
|
|
54
|
+
})(ConnectionStatus || (ConnectionStatus = {}));
|
|
55
|
+
export var DialEventType;
|
|
56
|
+
(function (DialEventType) {
|
|
57
|
+
DialEventType["PauseChange"] = "PAUSE_CHANGE";
|
|
58
|
+
DialEventType["StatusChange"] = "STATUS_CHANGE";
|
|
59
|
+
})(DialEventType || (DialEventType = {}));
|
|
60
|
+
export var DialResult;
|
|
61
|
+
(function (DialResult) {
|
|
62
|
+
DialResult["Connected"] = "CONNECTED";
|
|
63
|
+
DialResult["Meeting"] = "MEETING";
|
|
64
|
+
DialResult["NoAnswer"] = "NO_ANSWER";
|
|
65
|
+
})(DialResult || (DialResult = {}));
|
|
66
|
+
export var DialSessionStatus;
|
|
67
|
+
(function (DialSessionStatus) {
|
|
68
|
+
DialSessionStatus["Active"] = "ACTIVE";
|
|
69
|
+
DialSessionStatus["Complete"] = "COMPLETE";
|
|
70
|
+
DialSessionStatus["Initialized"] = "INITIALIZED";
|
|
71
|
+
DialSessionStatus["Paused"] = "PAUSED";
|
|
72
|
+
})(DialSessionStatus || (DialSessionStatus = {}));
|
|
73
|
+
export var DialSessionUpdateReason;
|
|
74
|
+
(function (DialSessionUpdateReason) {
|
|
75
|
+
DialSessionUpdateReason["BrowserDisconnect"] = "BROWSER_DISCONNECT";
|
|
76
|
+
DialSessionUpdateReason["Manual"] = "MANUAL";
|
|
77
|
+
DialSessionUpdateReason["PassComplete"] = "PASS_COMPLETE";
|
|
78
|
+
})(DialSessionUpdateReason || (DialSessionUpdateReason = {}));
|
|
79
|
+
export var DialTreeStrategy;
|
|
80
|
+
(function (DialTreeStrategy) {
|
|
81
|
+
DialTreeStrategy["Connect"] = "CONNECT";
|
|
82
|
+
DialTreeStrategy["Skip"] = "SKIP";
|
|
83
|
+
})(DialTreeStrategy || (DialTreeStrategy = {}));
|
|
84
|
+
export var ExtractorFieldType;
|
|
85
|
+
(function (ExtractorFieldType) {
|
|
86
|
+
ExtractorFieldType["Boolean"] = "BOOLEAN";
|
|
87
|
+
ExtractorFieldType["Custom"] = "CUSTOM";
|
|
88
|
+
ExtractorFieldType["Float"] = "FLOAT";
|
|
89
|
+
ExtractorFieldType["Integer"] = "INTEGER";
|
|
90
|
+
ExtractorFieldType["String"] = "STRING";
|
|
91
|
+
})(ExtractorFieldType || (ExtractorFieldType = {}));
|
|
92
|
+
export var FeedbackType;
|
|
93
|
+
(function (FeedbackType) {
|
|
94
|
+
FeedbackType["AiError"] = "AI_ERROR";
|
|
95
|
+
FeedbackType["FalsePositive"] = "FALSE_POSITIVE";
|
|
96
|
+
FeedbackType["PickupDelay"] = "PICKUP_DELAY";
|
|
97
|
+
})(FeedbackType || (FeedbackType = {}));
|
|
98
|
+
export var FlowConditionType;
|
|
99
|
+
(function (FlowConditionType) {
|
|
100
|
+
FlowConditionType["Always"] = "always";
|
|
101
|
+
FlowConditionType["Equal"] = "equal";
|
|
102
|
+
FlowConditionType["Greater"] = "greater";
|
|
103
|
+
FlowConditionType["In"] = "in";
|
|
104
|
+
FlowConditionType["Language"] = "language";
|
|
105
|
+
FlowConditionType["Less"] = "less";
|
|
106
|
+
})(FlowConditionType || (FlowConditionType = {}));
|
|
107
|
+
export var FunctionType;
|
|
108
|
+
(function (FunctionType) {
|
|
109
|
+
FunctionType["Api"] = "API";
|
|
110
|
+
FunctionType["Custom"] = "CUSTOM";
|
|
111
|
+
FunctionType["KnowledgeBase"] = "KNOWLEDGE_BASE";
|
|
112
|
+
})(FunctionType || (FunctionType = {}));
|
|
113
|
+
export var IvrDetectionType;
|
|
114
|
+
(function (IvrDetectionType) {
|
|
115
|
+
IvrDetectionType["None"] = "NONE";
|
|
116
|
+
IvrDetectionType["Standard"] = "STANDARD";
|
|
117
|
+
})(IvrDetectionType || (IvrDetectionType = {}));
|
|
118
|
+
export var KnowledgeBaseFileStatus;
|
|
119
|
+
(function (KnowledgeBaseFileStatus) {
|
|
120
|
+
KnowledgeBaseFileStatus["Active"] = "ACTIVE";
|
|
121
|
+
KnowledgeBaseFileStatus["Processing"] = "PROCESSING";
|
|
122
|
+
})(KnowledgeBaseFileStatus || (KnowledgeBaseFileStatus = {}));
|
|
123
|
+
export var OpeningLineType;
|
|
124
|
+
(function (OpeningLineType) {
|
|
125
|
+
OpeningLineType["InboundOnly"] = "INBOUND_ONLY";
|
|
126
|
+
OpeningLineType["InboundOutbound"] = "INBOUND_OUTBOUND";
|
|
127
|
+
})(OpeningLineType || (OpeningLineType = {}));
|
|
128
|
+
export var RecordingSettingType;
|
|
129
|
+
(function (RecordingSettingType) {
|
|
130
|
+
RecordingSettingType["BlockAreaCodes"] = "BLOCK_AREA_CODES";
|
|
131
|
+
RecordingSettingType["RecordAll"] = "RECORD_ALL";
|
|
132
|
+
RecordingSettingType["RecordNone"] = "RECORD_NONE";
|
|
133
|
+
})(RecordingSettingType || (RecordingSettingType = {}));
|
|
134
|
+
export var Role;
|
|
135
|
+
(function (Role) {
|
|
136
|
+
Role["Admin"] = "ADMIN";
|
|
137
|
+
Role["Manager"] = "MANAGER";
|
|
138
|
+
Role["Member"] = "MEMBER";
|
|
139
|
+
})(Role || (Role = {}));
|
|
140
|
+
export var RoomMessageType;
|
|
141
|
+
(function (RoomMessageType) {
|
|
142
|
+
RoomMessageType["UserJoin"] = "USER_JOIN";
|
|
143
|
+
RoomMessageType["UserLeave"] = "USER_LEAVE";
|
|
144
|
+
})(RoomMessageType || (RoomMessageType = {}));
|
|
145
|
+
export var SalesfloorType;
|
|
146
|
+
(function (SalesfloorType) {
|
|
147
|
+
SalesfloorType["Full"] = "FULL";
|
|
148
|
+
SalesfloorType["LiveListen"] = "LIVE_LISTEN";
|
|
149
|
+
SalesfloorType["None"] = "NONE";
|
|
150
|
+
})(SalesfloorType || (SalesfloorType = {}));
|
|
151
|
+
export var SalesloftNotesMode;
|
|
152
|
+
(function (SalesloftNotesMode) {
|
|
153
|
+
SalesloftNotesMode["Full"] = "FULL";
|
|
154
|
+
SalesloftNotesMode["NotesOnly"] = "NOTES_ONLY";
|
|
155
|
+
})(SalesloftNotesMode || (SalesloftNotesMode = {}));
|
|
156
|
+
export var SessionMessageType;
|
|
157
|
+
(function (SessionMessageType) {
|
|
158
|
+
SessionMessageType["ContactComplete"] = "CONTACT_COMPLETE";
|
|
159
|
+
SessionMessageType["DialConnect"] = "DIAL_CONNECT";
|
|
160
|
+
SessionMessageType["GlobalCallConnect"] = "GLOBAL_CALL_CONNECT";
|
|
161
|
+
SessionMessageType["SessionContactUpdate"] = "SESSION_CONTACT_UPDATE";
|
|
162
|
+
SessionMessageType["SessionUpdate"] = "SESSION_UPDATE";
|
|
163
|
+
})(SessionMessageType || (SessionMessageType = {}));
|
|
164
|
+
export var SystemResultType;
|
|
165
|
+
(function (SystemResultType) {
|
|
166
|
+
SystemResultType["Busy"] = "BUSY";
|
|
167
|
+
SystemResultType["Cancelled"] = "CANCELLED";
|
|
168
|
+
SystemResultType["DialTreeFound"] = "DIAL_TREE_FOUND";
|
|
169
|
+
SystemResultType["DncSkipped"] = "DNC_SKIPPED";
|
|
170
|
+
SystemResultType["Failed"] = "FAILED";
|
|
171
|
+
SystemResultType["NoAnswer"] = "NO_ANSWER";
|
|
172
|
+
SystemResultType["NumberSkipped"] = "NUMBER_SKIPPED";
|
|
173
|
+
SystemResultType["RateLimited"] = "RATE_LIMITED";
|
|
174
|
+
SystemResultType["Timeout"] = "TIMEOUT";
|
|
175
|
+
SystemResultType["UserHangup"] = "USER_HANGUP";
|
|
176
|
+
SystemResultType["VoicemailLeft"] = "VOICEMAIL_LEFT";
|
|
177
|
+
SystemResultType["VoicemailNotLeft"] = "VOICEMAIL_NOT_LEFT";
|
|
178
|
+
})(SystemResultType || (SystemResultType = {}));
|
|
179
|
+
export var UserActivityMessageType;
|
|
180
|
+
(function (UserActivityMessageType) {
|
|
181
|
+
UserActivityMessageType["SessionDialConnect"] = "SESSION_DIAL_CONNECT";
|
|
182
|
+
UserActivityMessageType["SessionDialDisconnect"] = "SESSION_DIAL_DISCONNECT";
|
|
183
|
+
UserActivityMessageType["SessionLeave"] = "SESSION_LEAVE";
|
|
184
|
+
UserActivityMessageType["SessionStatusChange"] = "SESSION_STATUS_CHANGE";
|
|
185
|
+
UserActivityMessageType["UserSessionConnect"] = "USER_SESSION_CONNECT";
|
|
186
|
+
})(UserActivityMessageType || (UserActivityMessageType = {}));
|
|
187
|
+
export var UtteranceDetectorConfigType;
|
|
188
|
+
(function (UtteranceDetectorConfigType) {
|
|
189
|
+
UtteranceDetectorConfigType["Advanced"] = "ADVANCED";
|
|
190
|
+
UtteranceDetectorConfigType["Basic"] = "BASIC";
|
|
191
|
+
})(UtteranceDetectorConfigType || (UtteranceDetectorConfigType = {}));
|
|
192
|
+
export var UtteranceDetectorSensitivity;
|
|
193
|
+
(function (UtteranceDetectorSensitivity) {
|
|
194
|
+
UtteranceDetectorSensitivity["Fast"] = "FAST";
|
|
195
|
+
UtteranceDetectorSensitivity["Medium"] = "MEDIUM";
|
|
196
|
+
UtteranceDetectorSensitivity["Slow"] = "SLOW";
|
|
197
|
+
UtteranceDetectorSensitivity["UltraFast"] = "ULTRA_FAST";
|
|
198
|
+
})(UtteranceDetectorSensitivity || (UtteranceDetectorSensitivity = {}));
|
|
199
|
+
export var VoiceGender;
|
|
200
|
+
(function (VoiceGender) {
|
|
201
|
+
VoiceGender["Female"] = "FEMALE";
|
|
202
|
+
VoiceGender["Male"] = "MALE";
|
|
203
|
+
VoiceGender["Neutral"] = "NEUTRAL";
|
|
204
|
+
})(VoiceGender || (VoiceGender = {}));
|
|
205
|
+
export var WorkspaceDialEventType;
|
|
206
|
+
(function (WorkspaceDialEventType) {
|
|
207
|
+
WorkspaceDialEventType["DialCreate"] = "DIAL_CREATE";
|
|
208
|
+
WorkspaceDialEventType["StatusChange"] = "STATUS_CHANGE";
|
|
209
|
+
})(WorkspaceDialEventType || (WorkspaceDialEventType = {}));
|
|
210
|
+
export const CreateAdHocDialSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateAdHocDialSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateAdHocDialSessionInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createAdHocDialSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "telephonyProvider" } }] } }] } }] };
|
|
211
|
+
export const StartDialSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "StartDialSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "startDialSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialSessionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } } }] }] } }] };
|
|
212
|
+
export const HangupCallDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "HangupCall" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dropVoicemail" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "transferNumber" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "hangupCall" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "dropVoicemail" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dropVoicemail" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "transferNumber" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "transferNumber" } } }] }] } }] };
|
|
213
|
+
export const SetPausedDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "SetPaused" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "pauseStatus" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pauseAI" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "pauseStatus" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "pauseStatus" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] };
|
|
214
|
+
export const RefreshTranscriptDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "RefreshTranscript" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "watchTranscript" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "speaker" } }, { "kind": "Field", "name": { "kind": "Name", "value": "text" } }, { "kind": "Field", "name": { "kind": "Name", "value": "detailType" } }] } }] } }] };
|
|
215
|
+
export const BrowserDialTokenDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "BrowserDialToken" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "BrowserDialTokenInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "browserDialToken" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "token" } }, { "kind": "Field", "name": { "kind": "Name", "value": "iceConfig" } }] } }] } }] };
|
|
216
|
+
export const ConnectSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "ConnectSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "connectSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "sessionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "messageType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "content" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "DialsUpdatedMessage" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contactId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "dials" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "answerType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "phoneField" } }, { "kind": "Field", "name": { "kind": "Name", "value": "callDispositionId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "systemResultType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toNumber" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "contactComplete" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "DialConnectMessage" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "dialId" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "SessionUpdatedMessage" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "dialSession" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }] } }] } }] } }] } }] };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./gql";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./gql";
|
package/dist/codegen.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
generates: {
|
|
3
|
+
'./__generated__/': {
|
|
4
|
+
preset: 'client',
|
|
5
|
+
schema: 'https://api.getelto.com/query',
|
|
6
|
+
documents: ['*.ts'],
|
|
7
|
+
plugins: [
|
|
8
|
+
{
|
|
9
|
+
add: {
|
|
10
|
+
content: '/* eslint-disable */',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
presetConfig: {
|
|
15
|
+
gqlTagName: 'gql',
|
|
16
|
+
fragmentMasking: false,
|
|
17
|
+
},
|
|
18
|
+
config: {
|
|
19
|
+
dedupeFragments: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
ignoreNoDocuments: true,
|
|
24
|
+
};
|
|
25
|
+
export default config;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface representing an active audio connection to a Vogent call.
|
|
3
|
+
* Returned by VogentCall.connectAudio()
|
|
4
|
+
*/
|
|
5
|
+
export interface VogentAudioConn {
|
|
6
|
+
/**
|
|
7
|
+
* Register event handlers for connection events
|
|
8
|
+
* @param ev - Event type to listen for
|
|
9
|
+
* - 'mute': Fired when the connection's mute state changes
|
|
10
|
+
* - 'disconnect': Fired when the connection is terminated
|
|
11
|
+
* @param fn - Callback function to handle the event
|
|
12
|
+
*/
|
|
13
|
+
on: (ev: 'mute' | 'disconnect', fn: (...args: any[]) => void) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Mute or unmute the audio connection
|
|
16
|
+
* @param status - True to mute, false to unmute
|
|
17
|
+
*/
|
|
18
|
+
mute: (status: boolean) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Terminate the audio connection
|
|
21
|
+
*/
|
|
22
|
+
disconnect: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Send DTMF digits through the connection
|
|
25
|
+
* @param k - String of DTMF digits to send (0-9, *, #)
|
|
26
|
+
*/
|
|
27
|
+
sendDigits: (k: string) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Interface representing a device that can establish audio connections
|
|
31
|
+
* Currently implemented by VonageDevice
|
|
32
|
+
*/
|
|
33
|
+
export interface VogentDevice {
|
|
34
|
+
/**
|
|
35
|
+
* Establish an audio connection with the specified parameters
|
|
36
|
+
* @param p - Connection parameters object containing:
|
|
37
|
+
* - params.EltoDialSessionID: The session ID for the call
|
|
38
|
+
* - params.LiveListen: Whether this is a monitoring connection
|
|
39
|
+
* - params.DialID: The ID of the dial to connect to
|
|
40
|
+
* @returns Promise resolving to an active audio connection
|
|
41
|
+
*/
|
|
42
|
+
connect: (p: any) => Promise<VogentAudioConn>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VogentAudioConn } from './VogentDevice';
|
|
2
|
+
import { VonageClient } from '@vonage/client-sdk';
|
|
3
|
+
export declare class VonageCall {
|
|
4
|
+
_callId: string;
|
|
5
|
+
_client: VonageClient;
|
|
6
|
+
_liveListen: boolean;
|
|
7
|
+
_params: any;
|
|
8
|
+
_handlers: {
|
|
9
|
+
ev: 'mute' | 'disconnect';
|
|
10
|
+
fn: (...args: any[]) => void;
|
|
11
|
+
}[];
|
|
12
|
+
constructor(callId: string, client: VonageClient, params: any);
|
|
13
|
+
mute(status: boolean): void;
|
|
14
|
+
sendDigits(k: string): void;
|
|
15
|
+
disconnect(): void;
|
|
16
|
+
sendEvent(evName: string, ...args: any[]): void;
|
|
17
|
+
on(ev: 'mute' | 'disconnect', fn: (...args: any[]) => void): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class VonageDevice {
|
|
20
|
+
_sessionId: string;
|
|
21
|
+
_client: VonageClient;
|
|
22
|
+
private constructor();
|
|
23
|
+
static getDevice(sessionToken: string, disableEffects?: boolean): Promise<VonageDevice>;
|
|
24
|
+
connect(p: any): Promise<VogentAudioConn>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { VonageClient, LoggingLevel } from '@vonage/client-sdk';
|
|
2
|
+
export class VonageCall {
|
|
3
|
+
constructor(callId, client, params) {
|
|
4
|
+
this._callId = callId;
|
|
5
|
+
this._client = client;
|
|
6
|
+
this._params = params;
|
|
7
|
+
this._handlers = [];
|
|
8
|
+
this._liveListen = false;
|
|
9
|
+
this._client.on('callHangup', (callId, _, reason) => {
|
|
10
|
+
if (callId !== this._callId) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
console.log('Call status changed', reason, callId);
|
|
14
|
+
if (!this._liveListen &&
|
|
15
|
+
(reason === 'REMOTE_HANGUP' || reason === 'REMOTE_NO_ANSWER_TIMEOUT')) {
|
|
16
|
+
console.log('Reconnecting');
|
|
17
|
+
this._client
|
|
18
|
+
.serverCall(this._params)
|
|
19
|
+
.then((cid) => {
|
|
20
|
+
this._callId = cid;
|
|
21
|
+
})
|
|
22
|
+
.catch((err) => {
|
|
23
|
+
console.error('Error reconnecting', err);
|
|
24
|
+
this.sendEvent('disconnect');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.sendEvent('disconnect');
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
mute(status) {
|
|
33
|
+
if (status) {
|
|
34
|
+
this._client.mute(this._callId).then(() => {
|
|
35
|
+
this.sendEvent('mute', true);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this._client.unmute(this._callId).then(() => {
|
|
40
|
+
this.sendEvent('mute', false);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
sendDigits(k) {
|
|
45
|
+
this._client.sendDTMF(this._callId, k);
|
|
46
|
+
}
|
|
47
|
+
disconnect() {
|
|
48
|
+
this._client.hangup(this._callId);
|
|
49
|
+
}
|
|
50
|
+
sendEvent(evName, ...args) {
|
|
51
|
+
for (const { ev, fn } of this._handlers) {
|
|
52
|
+
if (ev === evName) {
|
|
53
|
+
fn(...args);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
on(ev, fn) {
|
|
58
|
+
this._handlers.push({
|
|
59
|
+
ev,
|
|
60
|
+
fn,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class VonageDevice {
|
|
65
|
+
constructor(sessionId, client, liveListen = false) {
|
|
66
|
+
this._sessionId = sessionId;
|
|
67
|
+
this._client = client;
|
|
68
|
+
}
|
|
69
|
+
static async getDevice(sessionToken, disableEffects = false) {
|
|
70
|
+
const client = new VonageClient({ loggingLevel: LoggingLevel.Warn });
|
|
71
|
+
const sessId = await client.createSession(sessionToken);
|
|
72
|
+
return new VonageDevice(sessId, client, disableEffects);
|
|
73
|
+
}
|
|
74
|
+
async connect(p) {
|
|
75
|
+
const call = await this._client.serverCall(p.params);
|
|
76
|
+
const v = new VonageCall(call, this._client, p.params);
|
|
77
|
+
return v;
|
|
78
|
+
}
|
|
79
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const AI_START_DIAL_SESSION: import("@graphql-typed-document-node/core").TypedDocumentNode<import("./__generated__/graphql").StartDialSessionMutation, import("./__generated__/graphql").Exact<{
|
|
2
|
+
sessionId: import("./__generated__/graphql").Scalars["ID"]["input"];
|
|
3
|
+
}>>;
|
|
4
|
+
export declare const AI_HANGUP_CALL: import("@graphql-typed-document-node/core").TypedDocumentNode<import("./__generated__/graphql").HangupCallMutation, import("./__generated__/graphql").Exact<{
|
|
5
|
+
dialId: import("./__generated__/graphql").Scalars["ID"]["input"];
|
|
6
|
+
dropVoicemail?: import("./__generated__/graphql").InputMaybe<import("./__generated__/graphql").Scalars["Boolean"]["input"]>;
|
|
7
|
+
transferNumber?: import("./__generated__/graphql").InputMaybe<import("./__generated__/graphql").Scalars["String"]["input"]>;
|
|
8
|
+
}>>;
|
|
9
|
+
export declare const AI_SET_PAUSED: import("@graphql-typed-document-node/core").TypedDocumentNode<import("./__generated__/graphql").SetPausedMutation, import("./__generated__/graphql").Exact<{
|
|
10
|
+
dialId: import("./__generated__/graphql").Scalars["ID"]["input"];
|
|
11
|
+
pauseStatus: import("./__generated__/graphql").Scalars["Boolean"]["input"];
|
|
12
|
+
}>>;
|
|
13
|
+
export declare const REFRESH_TRANSCRIPT: import("@graphql-typed-document-node/core").TypedDocumentNode<import("./__generated__/graphql").RefreshTranscriptSubscription, import("./__generated__/graphql").Exact<{
|
|
14
|
+
dialId: import("./__generated__/graphql").Scalars["ID"]["input"];
|
|
15
|
+
}>>;
|
|
16
|
+
export declare const AI_GET_TOKEN: import("@graphql-typed-document-node/core").TypedDocumentNode<import("./__generated__/graphql").BrowserDialTokenMutation, import("./__generated__/graphql").Exact<{
|
|
17
|
+
input: import("./__generated__/graphql").BrowserDialTokenInput;
|
|
18
|
+
}>>;
|
|
19
|
+
export declare const AI_CONNECT_SESSION: import("@graphql-typed-document-node/core").TypedDocumentNode<import("./__generated__/graphql").ConnectSessionSubscription, import("./__generated__/graphql").Exact<{
|
|
20
|
+
sessionId: import("./__generated__/graphql").Scalars["ID"]["input"];
|
|
21
|
+
}>>;
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import { gql } from './__generated__';
|
|
2
|
-
|
|
3
|
-
export const AI_CREATE_AD_HOC_DIAL_SESSION = gql(`
|
|
4
|
-
mutation CreateAdHocDialSession($input: CreateAdHocDialSessionInput!) {
|
|
5
|
-
createAdHocDialSession(input: $input) {
|
|
6
|
-
id
|
|
7
|
-
telephonyProvider
|
|
8
|
-
}
|
|
9
|
-
}`);
|
|
10
|
-
|
|
11
2
|
export const AI_START_DIAL_SESSION = gql(`
|
|
12
3
|
mutation StartDialSession($sessionId: ID!) {
|
|
13
4
|
startDialSession(dialSessionId: $sessionId)
|
|
14
5
|
}
|
|
15
6
|
`);
|
|
16
|
-
|
|
17
7
|
export const AI_HANGUP_CALL = gql(`
|
|
18
8
|
mutation HangupCall($dialId: ID!, $dropVoicemail: Boolean, $transferNumber: String) {
|
|
19
9
|
hangupCall(dialId: $dialId, dropVoicemail: $dropVoicemail, transferNumber: $transferNumber)
|
|
20
10
|
}
|
|
21
11
|
`);
|
|
22
|
-
|
|
23
12
|
export const AI_SET_PAUSED = gql(`
|
|
24
13
|
mutation SetPaused($dialId: ID!, $pauseStatus: Boolean!) {
|
|
25
14
|
pauseAI(dialId: $dialId, pauseStatus: $pauseStatus) {
|
|
@@ -27,7 +16,6 @@ export const AI_SET_PAUSED = gql(`
|
|
|
27
16
|
}
|
|
28
17
|
}
|
|
29
18
|
`);
|
|
30
|
-
|
|
31
19
|
export const REFRESH_TRANSCRIPT = gql(`
|
|
32
20
|
subscription RefreshTranscript($dialId: ID!) {
|
|
33
21
|
watchTranscript(dialId: $dialId) {
|
|
@@ -37,7 +25,6 @@ export const REFRESH_TRANSCRIPT = gql(`
|
|
|
37
25
|
}
|
|
38
26
|
}
|
|
39
27
|
`);
|
|
40
|
-
|
|
41
28
|
export const AI_GET_TOKEN = gql(`
|
|
42
29
|
mutation BrowserDialToken($input: BrowserDialTokenInput!) {
|
|
43
30
|
browserDialToken(input: $input) {
|
|
@@ -46,7 +33,6 @@ export const AI_GET_TOKEN = gql(`
|
|
|
46
33
|
}
|
|
47
34
|
}
|
|
48
35
|
`);
|
|
49
|
-
|
|
50
36
|
export const AI_CONNECT_SESSION = gql(`
|
|
51
37
|
subscription ConnectSession($sessionId: ID!) {
|
|
52
38
|
connectSession(sessionId: $sessionId) {
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dialStatusIsComplete(status: string): boolean;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function dialStatusIsComplete(status) {
|
|
2
|
+
switch (status) {
|
|
3
|
+
case 'completed':
|
|
4
|
+
return true;
|
|
5
|
+
case 'canceled':
|
|
6
|
+
return true;
|
|
7
|
+
case 'no-answer':
|
|
8
|
+
return true;
|
|
9
|
+
case 'failed':
|
|
10
|
+
return true;
|
|
11
|
+
case 'busy':
|
|
12
|
+
return true;
|
|
13
|
+
default:
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vogent/vogent-web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@apollo/client": "^3.12.4",
|
|
@@ -8,9 +8,27 @@
|
|
|
8
8
|
"graphql": "^16.10.0",
|
|
9
9
|
"graphql-ws": "^5.16.0"
|
|
10
10
|
},
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"prepublishOnly": "yarn build"
|
|
25
|
+
},
|
|
11
26
|
"devDependencies": {
|
|
12
27
|
"@graphql-codegen/cli": "^5.0.3",
|
|
13
28
|
"@graphql-codegen/client-preset": "^4.5.1",
|
|
14
|
-
"@graphql-typed-document-node/core": "^3.2.0"
|
|
29
|
+
"@graphql-typed-document-node/core": "^3.2.0",
|
|
30
|
+
"@types/node": "^22.10.7",
|
|
31
|
+
"@types/react": "^19.0.7",
|
|
32
|
+
"typescript": "^5.7.3"
|
|
15
33
|
}
|
|
16
34
|
}
|