@cognigy/rest-api-client 0.15.0 → 0.17.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.
Files changed (146) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/build/GenericTusFn.js +64 -0
  3. package/build/RestAPIClient.js +3 -0
  4. package/build/apigroups/AdministrationAPIGroup_2_0.js +7 -2
  5. package/build/apigroups/ResourcesAPIGroup_2_0.js +28 -23
  6. package/build/{shared/interfaces/agentAssist/ISendTileUpdateReferenceParams.js → apigroups/TTusAPIOperation.js} +1 -1
  7. package/build/apigroups/index.js +2 -0
  8. package/build/connector/AxiosAdapter.js +5 -4
  9. package/build/shared/charts/descriptors/agentAssist/constants/constants.js +7 -0
  10. package/build/shared/charts/descriptors/agentAssist/helpers/sentiment.helper.js +41 -0
  11. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/identityAssistTemplate.js +54 -0
  12. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/knowledgeAssistTemplate.js +203 -0
  13. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/nextActionWidgetTemplate.js +93 -0
  14. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage0.js +81 -0
  15. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage1.js +84 -0
  16. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage2.js +97 -0
  17. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stageError.js +85 -0
  18. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/sentimentAnalysisTemplate.js +41 -0
  19. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/stylesPartial.js +15 -0
  20. package/build/shared/charts/descriptors/agentAssist/htmlTemplates/transcriptAssistTemplate.js +53 -0
  21. package/build/shared/charts/descriptors/agentAssist/identityAssist.js +135 -0
  22. package/build/shared/charts/descriptors/agentAssist/index.js +15 -1
  23. package/build/shared/charts/descriptors/agentAssist/knowledgeAssist.js +625 -0
  24. package/build/shared/charts/descriptors/agentAssist/nextActionAssist.js +77 -0
  25. package/build/shared/charts/descriptors/agentAssist/sentimentAssist.js +86 -0
  26. package/build/shared/charts/descriptors/agentAssist/setAdaptiveCardTile.js +2 -2
  27. package/build/shared/charts/descriptors/agentAssist/setAgentAssistGrid.js +120 -0
  28. package/build/shared/charts/descriptors/agentAssist/setHtmlTile.js +2 -2
  29. package/build/shared/charts/descriptors/agentAssist/setIframeTile.js +2 -2
  30. package/build/shared/charts/descriptors/agentAssist/setSecureFormsTile.js +171 -0
  31. package/build/shared/charts/descriptors/agentAssist/transcriptAssist.js +72 -0
  32. package/build/shared/charts/descriptors/allFields.js +12 -0
  33. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/TGenerativeAIConnectionFields.js +3 -0
  34. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/alephAlphaProviderConnection.js +11 -0
  35. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/anthropicProviderConnection.js +1 -1
  36. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnectionV2.js +1 -1
  37. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +6 -2
  38. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +1 -1
  39. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/amazonStorageProviderConnection.js +4 -4
  40. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/azureBlobStorageProviderConnection.js +3 -3
  41. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/googleCloudStorageProviderConnection.js +3 -3
  42. package/build/shared/charts/descriptors/connectionNodes/mongoDB/mongoDBConnection.js +1 -1
  43. package/build/shared/charts/descriptors/connectionNodes/smtp/oAuth2Connection.js +8 -8
  44. package/build/shared/charts/descriptors/connectionNodes/smtp/serviceConnection.js +2 -2
  45. package/build/shared/charts/descriptors/connectionNodes/smtp/smtpConnection.js +5 -5
  46. package/build/shared/charts/descriptors/connectionNodes/speechProviders/awsSpeechProviderConnection.js +4 -4
  47. package/build/shared/charts/descriptors/connectionNodes/speechProviders/microsoftSpeechProviderConnection.js +2 -2
  48. package/build/shared/charts/descriptors/connectionNodes/sql/sqlConnection.js +5 -5
  49. package/build/shared/charts/descriptors/connectionNodes/translationProviders/deeplTranslationProviderConnection.js +15 -0
  50. package/build/shared/charts/descriptors/connectionNodes/translationProviders/googleTranslationProviderConnection.js +15 -0
  51. package/build/shared/charts/descriptors/connectionNodes/translationProviders/index.js +23 -0
  52. package/build/shared/charts/descriptors/connectionNodes/translationProviders/microsoftTranslationProviderConnection.js +21 -0
  53. package/build/shared/charts/descriptors/index.js +13 -2
  54. package/build/shared/charts/descriptors/knowledgeSearch/constants/constants.js +6 -0
  55. package/build/shared/charts/descriptors/knowledgeSearch/index.js +5 -1
  56. package/build/shared/charts/descriptors/knowledgeSearch/knowledgeSearch.js +7 -2
  57. package/build/shared/charts/descriptors/knowledgeSearch/knowledgeSearchV2.js +151 -0
  58. package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +985 -0
  59. package/build/shared/charts/descriptors/logic/goTo.js +2 -0
  60. package/build/shared/charts/descriptors/message/question/optionalQuestion.js +2 -2
  61. package/build/shared/charts/descriptors/message/question/question.js +215 -8
  62. package/build/shared/charts/descriptors/nlu/cleanText.js +1 -0
  63. package/build/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +107 -5
  64. package/build/shared/charts/descriptors/service/GPTConversation.js +125 -23
  65. package/build/shared/charts/descriptors/service/GPTPrompt.js +148 -12
  66. package/build/shared/charts/descriptors/service/checkAgentAvailability.js +15 -1
  67. package/build/shared/charts/descriptors/service/handoverV2.js +45 -0
  68. package/build/shared/{interfaces/twilioInterface.js → charts/descriptors/voice/interface/IBandwidth.js} +1 -1
  69. package/build/shared/charts/descriptors/voice/mappers/base.mapper.js +14 -0
  70. package/build/shared/charts/descriptors/voice/mappers/hangup.mapper.js +26 -0
  71. package/build/shared/charts/descriptors/voice/mappers/muteSpeechInput.mapper.js +17 -2
  72. package/build/shared/charts/descriptors/voice/mappers/play.mapper.js +54 -0
  73. package/build/shared/charts/descriptors/voice/mappers/record.mapper.js +7 -0
  74. package/build/shared/charts/descriptors/voice/mappers/sendMetadata.mapper.js +15 -0
  75. package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +56 -20
  76. package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +39 -13
  77. package/build/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -1
  78. package/build/shared/charts/descriptors/voice/nodes/play.js +1 -1
  79. package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +120 -29
  80. package/build/shared/charts/descriptors/voice/nodes/transfer.js +11 -3
  81. package/build/shared/charts/descriptors/voice/utils/vgConstants.js +14 -0
  82. package/build/shared/charts/descriptors/voicegateway/index.js +14 -11
  83. package/build/shared/charts/descriptors/voicegateway/utils/paramUtils.js +1 -5
  84. package/build/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +12 -1
  85. package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +6 -0
  86. package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +159 -36
  87. package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +296 -43
  88. package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +30 -4
  89. package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +1 -1
  90. package/build/shared/constants.js +5 -1
  91. package/build/shared/handoverClients/interfaces/THandoverEventType.js +3 -1
  92. package/build/shared/helper/BaseContext.js +33 -15
  93. package/build/shared/helper/nlu/textCleaner.js +25 -3
  94. package/build/shared/interfaces/IEndpointTranslationSettings.js +9 -0
  95. package/build/shared/interfaces/IOrganisation.js +2 -1
  96. package/build/shared/interfaces/agentAssist/ISendConfigUpdateParams.js +3 -0
  97. package/build/shared/interfaces/agentAssist/ISendUpdateReferenceParams.js +3 -0
  98. package/build/shared/interfaces/amqpInterface.js +18 -22
  99. package/build/shared/interfaces/channels/genesysBotConnector.js +21 -0
  100. package/build/shared/interfaces/channels/niceCXOne.js +8 -0
  101. package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +17 -7
  102. package/build/shared/interfaces/handover.js +57 -3
  103. package/build/shared/interfaces/journeys/IJourney.js +6 -0
  104. package/build/shared/interfaces/journeys/IJourneyTrackEvent.js +2 -0
  105. package/build/shared/interfaces/messageAPI/endpoints.js +93 -8
  106. package/build/shared/interfaces/messageAPI/handover.js +4 -4
  107. package/build/shared/interfaces/resources/IAuditEvent.js +1 -0
  108. package/build/shared/interfaces/resources/IConnectionSchema.js +3 -0
  109. package/build/shared/interfaces/resources/IEndpoint.js +1 -0
  110. package/build/shared/interfaces/resources/IExtension.js +3 -0
  111. package/build/shared/interfaces/resources/ILargeLanguageModel.js +24 -5
  112. package/build/shared/interfaces/resources/INodeDescriptorSet.js +24 -1
  113. package/build/shared/interfaces/resources/TNLUConnectorType.js +0 -1
  114. package/build/shared/interfaces/resources/TRestChannelType.js +16 -11
  115. package/build/shared/interfaces/resources/TSocketChannelType.js +5 -1
  116. package/build/shared/interfaces/resources/TWebhookChannelType.js +6 -1
  117. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +21 -3
  118. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +13 -2
  119. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeStore.js +1 -1
  120. package/build/shared/interfaces/resources/settings/IAgentSettings.js +3 -23
  121. package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +4 -0
  122. package/build/shared/interfaces/resources/settings/ITranslationSettings.js +63 -0
  123. package/build/shared/interfaces/resources/settings/index.js +4 -1
  124. package/build/shared/interfaces/restAPI/administration/voiceGateway/v2.0/IReadVoiceGatewayAccountRest_2_0.js +3 -0
  125. package/build/shared/interfaces/restAPI/administration/voiceGateway/v2.0/ISetupVoiceGatewayAccountRest_2_0.js +3 -0
  126. package/build/shared/interfaces/restAPI/administration/voiceGateway/v2.0/index.js +3 -0
  127. package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/ICallCounterAggregatedValue_2_0.js +3 -0
  128. package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/IGetCallCounterOrganisationRest_2_0.js +3 -0
  129. package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/IGetCallCounterRest_2_0.js +3 -0
  130. package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/index.js +3 -0
  131. package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/IGetKnowledgeQueryCounterOrganisationRest_2_0.js +3 -0
  132. package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/IGetKnowledgeQueryCounterRest_2_0.js +3 -0
  133. package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/IKnowlegeQueryCounterAggregatedValue_2_0.js +3 -0
  134. package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/index.js +3 -0
  135. package/build/shared/interfaces/restAPI/resources/nluconnector/v2.0/TNLUConnectorType_2_0.js +0 -2
  136. package/build/shared/interfaces/restAPI/resources/uploadResumable/v2.0/IUploadResumableRest_2_0.js +17 -0
  137. package/build/shared/interfaces/restAPI/resources/uploadResumable/v2.0/index.js +3 -0
  138. package/build/shared/interfaces/security/ICallCounterAggregatedValue.js +3 -0
  139. package/build/shared/interfaces/security/IKnowledgeQueryCounterAggregatedValue.js +3 -0
  140. package/build/shared/interfaces/security/IPermission.js +3 -0
  141. package/build/shared/interfaces/security/IRole.js +9 -1
  142. package/build/shared/interfaces/security/index.js +2 -1
  143. package/build/shared/interfaces/trainer/ITrainerRecord.js +2 -0
  144. package/build/test.js +27 -0
  145. package/package.json +19 -17
  146. package/types/index.d.ts +823 -140
@@ -7,6 +7,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
7
7
  const transfer_mapper_1 = require("../../voice/mappers/transfer.mapper");
8
8
  const design_1 = require("../utils/design");
9
9
  const helper_1 = require("../utils/helper");
10
+ const customHeaderDefaultValue = "X-Custom-Header";
10
11
  exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
11
12
  type: "transfer",
12
13
  defaultLabel: "Transfer",
@@ -26,13 +27,13 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
26
27
  options: [
27
28
  {
28
29
  label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSFER_TYPE__OPTIONS__REFER__LABEL",
29
- value: "refer"
30
+ value: "refer",
30
31
  },
31
32
  {
32
33
  label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSFER_TYPE__OPTIONS__DIAL__LABEL",
33
- value: "dial"
34
- }
35
- ]
34
+ value: "dial",
35
+ },
36
+ ],
36
37
  },
37
38
  defaultValue: "refer",
38
39
  description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSFER_TYPE__DESCRIPTION",
@@ -47,6 +48,17 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
47
48
  description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSFER_TARGET__DESCRIPTION",
48
49
  defaultValue: "+49123456789",
49
50
  },
51
+ {
52
+ key: "referredBy",
53
+ label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__REFERRED_BY__LABEL",
54
+ type: "cognigyText",
55
+ description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__REFERRED_BY__DESCRIPTION",
56
+ defaultValue: "",
57
+ condition: {
58
+ key: "transferType",
59
+ value: "refer"
60
+ }
61
+ },
50
62
  {
51
63
  key: "transferReason",
52
64
  label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSFER_REASON__LABEL",
@@ -70,7 +82,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
70
82
  type: "json",
71
83
  description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSFER_SIP_HEADERS__DESCRIPTION",
72
84
  defaultValue: {
73
- "X-Custom-Header": "YourValue",
85
+ [customHeaderDefaultValue]: "YourValue",
74
86
  },
75
87
  condition: {
76
88
  key: "useTransferSipHeaders",
@@ -85,8 +97,8 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
85
97
  description: "UI__NODE_EDITOR__TRANSFER__DIAL_CALLER_ID__DESCRIPTION",
86
98
  condition: {
87
99
  key: "transferType",
88
- value: "dial",
89
- },
100
+ value: "dial"
101
+ }
90
102
  },
91
103
  {
92
104
  key: "dialMusic",
@@ -95,8 +107,8 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
95
107
  description: "UI__NODE_EDITOR__TRANSFER__FIELDS__DIAL_MUSIC__DESCRIPTION",
96
108
  condition: {
97
109
  key: "transferType",
98
- value: "dial",
99
- },
110
+ value: "dial"
111
+ }
100
112
  },
101
113
  {
102
114
  key: "dialTranscriptionWebhook",
@@ -105,8 +117,55 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
105
117
  description: "UI__NODE_EDITOR__TRANSFER__FIELDS__DIAL_TRANSCRIPTION_WEBHOOK__DESCRIPTION",
106
118
  condition: {
107
119
  key: "transferType",
108
- value: "dial",
120
+ value: "dial"
121
+ }
122
+ },
123
+ {
124
+ key: "sttLabel",
125
+ label: "UI__NODE_EDITOR__TRANSFER__FIELDS__DIAL_TRANSCRIPTION_STT_LABEL__LABEL",
126
+ type: "text",
127
+ description: "UI__NODE_EDITOR__TRANSFER__FIELDS__DIAL_TRANSCRIPTION_STT_LABEL__DESCRIPTION",
128
+ condition: {
129
+ key: "transferType",
130
+ value: "dial"
131
+ }
132
+ },
133
+ {
134
+ key: "dialTimeout",
135
+ label: "UI__NODE_EDITOR__TRANSFER__FIELDS__TIMEOUT__LABEL",
136
+ type: "number",
137
+ description: "UI__NODE_EDITOR__TRANSFER__FIELDS__TIMEOUT__DESCRIPTION",
138
+ condition: {
139
+ key: "transferType",
140
+ value: "dial"
109
141
  },
142
+ defaultValue: 60,
143
+ params: {
144
+ min: 0,
145
+ max: 300
146
+ }
147
+ },
148
+ {
149
+ key: "agentAssistEnabled",
150
+ label: "UI__NODE_EDITOR__TRANSFER__FIELDS__AGENT_ASSIST_ENABLED__LABEL",
151
+ type: "toggle",
152
+ description: "UI__NODE_EDITOR__TRANSFER__FIELDS__AGENT_ASSIST_ENABLED__DESCRIPTION",
153
+ defaultValue: false,
154
+ condition: {
155
+ key: "transferType",
156
+ value: "dial"
157
+ }
158
+ },
159
+ {
160
+ key: "agentAssistHeadersKey",
161
+ label: "UI__NODE_EDITOR__TRANSFER__FIELDS__AGENT_ASSIST_HEADERS_KEY__LABEL",
162
+ type: "cognigyText",
163
+ description: "UI__NODE_EDITOR__TRANSFER__FIELDS__AGENT_ASSIST_HEADERS_KEY__DESCRIPTION",
164
+ defaultValue: customHeaderDefaultValue,
165
+ condition: {
166
+ key: "agentAssistEnabled",
167
+ value: true
168
+ }
110
169
  },
111
170
  {
112
171
  key: "amdEnabled",
@@ -116,8 +175,8 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
116
175
  defaultValue: false,
117
176
  condition: {
118
177
  key: "transferType",
119
- value: "dial",
120
- },
178
+ value: "dial"
179
+ }
121
180
  },
122
181
  {
123
182
  key: "amdRedirectOnMachineDetected",
@@ -127,8 +186,8 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
127
186
  defaultValue: false,
128
187
  condition: {
129
188
  key: "amdEnabled",
130
- value: true,
131
- },
189
+ value: true
190
+ }
132
191
  },
133
192
  {
134
193
  key: "amdRedirectText",
@@ -137,15 +196,17 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
137
196
  description: "UI__NODE_EDITOR__TRANSFER__FIELDS__AMD_REDIRECT_TEXT__DESCRIPTION",
138
197
  defaultValue: "",
139
198
  condition: {
140
- and: [{
199
+ and: [
200
+ {
141
201
  key: "amdEnabled",
142
- value: true,
202
+ value: true
143
203
  },
144
204
  {
145
205
  key: "amdRedirectOnMachineDetected",
146
- value: true,
147
- }]
148
- },
206
+ value: true
207
+ }
208
+ ]
209
+ }
149
210
  },
150
211
  {
151
212
  key: "recognitionChannel",
@@ -171,8 +232,8 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
171
232
  description: "UI__NODE_EDITOR__TRANSFER__FIELDS__RECOGNITION_CHANNEL__DESCRIPTION",
172
233
  condition: {
173
234
  key: "transferType",
174
- value: "dial",
175
- },
235
+ value: "dial"
236
+ }
176
237
  },
177
238
  {
178
239
  key: "sttVendor",
@@ -185,26 +246,168 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
185
246
  },
186
247
  condition: {
187
248
  key: "transferType",
188
- value: "dial",
189
- },
249
+ value: "dial"
250
+ }
190
251
  },
191
252
  {
192
253
  key: "sttLanguage",
193
254
  type: "sttSelect",
194
255
  defaultValue: "",
256
+ label: "_unused_"
257
+ },
258
+ {
259
+ key: "sttDisablePunctuation",
260
+ type: "toggle",
261
+ label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_DISABLE_PUNCTUATION__LABEL",
262
+ description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_DISABLE_PUNCTUATION__DESCRIPTION",
263
+ defaultValue: false,
264
+ condition: {
265
+ or: [
266
+ {
267
+ key: "sttVendor",
268
+ value: "google"
269
+ },
270
+ {
271
+ key: "sttVendor",
272
+ value: "deepgram"
273
+ }
274
+ ]
275
+ }
276
+ },
277
+ {
278
+ key: "sttDeepgramTier",
279
+ type: "sttTierModelSelect",
195
280
  label: "_unused_",
281
+ description: "_unused_",
282
+ defaultValue: "base",
283
+ params: {
284
+ languageKey: "config.sttDeepgramModel"
285
+ },
286
+ condition: {
287
+ key: "sttVendor",
288
+ value: "deepgram"
289
+ }
290
+ },
291
+ {
292
+ key: "sttDeepgramModel",
293
+ type: "sttTierModelSelect",
294
+ defaultValue: "general",
295
+ label: "_unused_"
296
+ },
297
+ {
298
+ key: "deepgramEndpointing",
299
+ type: "toggle",
300
+ label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING__LABEL",
301
+ description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING__DESCRIPTION",
302
+ defaultValue: false,
303
+ condition: {
304
+ key: "sttVendor",
305
+ value: "deepgram"
306
+ }
307
+ },
308
+ {
309
+ key: "deepgramEndpointingValue",
310
+ type: "number",
311
+ label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING_TIME__LABEL",
312
+ description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING_TIME__DESCRIPTION",
313
+ defaultValue: 1000,
314
+ params: {
315
+ min: 10,
316
+ max: 1000
317
+ },
318
+ condition: {
319
+ and: [
320
+ {
321
+ key: "sttVendor",
322
+ value: "deepgram"
323
+ },
324
+ {
325
+ key: "deepgramEndpointing",
326
+ value: true
327
+ },
328
+ ]
329
+ }
196
330
  },
331
+ {
332
+ key: "deepgramSmartFormatting",
333
+ type: "toggle",
334
+ label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_SMART_FORMATTING__LABEL",
335
+ description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_SMART_FORMATTING__DESCRIPTION",
336
+ defaultValue: false,
337
+ condition: {
338
+ key: "sttVendor",
339
+ value: "deepgram"
340
+ }
341
+ },
342
+ {
343
+ key: "googleModel",
344
+ type: "select",
345
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__LABEL",
346
+ description: "UI__NODE_EDITOR__GOOGLE_MODEL__DESCRIPTION",
347
+ defaultValue: "latest_short",
348
+ condition: {
349
+ key: "sttVendor",
350
+ value: "google"
351
+ },
352
+ params: {
353
+ options: [
354
+ {
355
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__LATEST_SHORT__LABEL",
356
+ value: "latest_short"
357
+ },
358
+ {
359
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__LATEST_LONG__LABEL",
360
+ value: "latest_long"
361
+ },
362
+ {
363
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__COMMAND_AND_SEARCH__LABEL",
364
+ value: "command_and_search"
365
+ },
366
+ {
367
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__PHONE_CALL__LABEL",
368
+ value: "phone_call"
369
+ },
370
+ {
371
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__VIDEO__LABEL",
372
+ value: "video"
373
+ },
374
+ {
375
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__MEDICAL_DICTATION__LABEL",
376
+ value: "medical_dictation"
377
+ },
378
+ {
379
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__MEDICAL_CONVERSATION__LABEL",
380
+ value: "medical_conversation"
381
+ },
382
+ {
383
+ label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__DEFAULT__LABEL",
384
+ value: "default"
385
+ }
386
+ ]
387
+ }
388
+ }
197
389
  ],
198
390
  sections: [
199
391
  {
200
392
  key: "transcribe",
201
393
  label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__TRANSCRIBE__LABEL",
202
394
  defaultCollapsed: true,
203
- fields: ["sttVendor", "dialTranscriptionWebhook", "recognitionChannel"],
395
+ fields: [
396
+ "sttVendor",
397
+ "sttLabel",
398
+ "sttDisablePunctuation",
399
+ "sttDeepgramTier",
400
+ "deepgramEndpointing",
401
+ "deepgramEndpointingValue",
402
+ "deepgramSmartFormatting",
403
+ "googleModel",
404
+ "dialTranscriptionWebhook",
405
+ "recognitionChannel"
406
+ ],
204
407
  condition: {
205
408
  key: "transferType",
206
409
  value: "dial"
207
- },
410
+ }
208
411
  },
209
412
  {
210
413
  key: "amd",
@@ -214,57 +417,75 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
214
417
  condition: {
215
418
  key: "transferType",
216
419
  value: "dial"
217
- },
420
+ }
218
421
  },
219
422
  {
220
423
  key: "advanced",
221
424
  label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__ADVANCED__LABEL",
222
425
  defaultCollapsed: true,
223
- fields: ["useTransferSipHeaders", "transferSipHeaders", "enableAnsweringMachineDetection"],
224
- },
426
+ fields: [
427
+ "referredBy",
428
+ "useTransferSipHeaders",
429
+ "transferSipHeaders",
430
+ "enableAnsweringMachineDetection"
431
+ ]
432
+ }
225
433
  ],
226
434
  form: [
227
435
  {
228
436
  type: "field",
229
- key: "transferType",
437
+ key: "transferType"
230
438
  },
231
439
  {
232
440
  type: "field",
233
- key: "transferReason",
441
+ key: "transferReason"
234
442
  },
235
443
  {
236
444
  type: "field",
237
- key: "transferTarget",
445
+ key: "transferTarget"
238
446
  },
239
447
  {
240
448
  type: "field",
241
- key: "dialCallerId",
449
+ key: "dialCallerId"
242
450
  },
243
451
  {
244
452
  type: "field",
245
- key: "dialMusic",
453
+ key: "dialMusic"
246
454
  },
247
455
  {
248
- type: "section",
249
- key: "transcribe",
456
+ type: "field",
457
+ key: "dialTimeout"
458
+ },
459
+ {
460
+ type: "field",
461
+ key: "agentAssistEnabled"
462
+ },
463
+ {
464
+ type: "field",
465
+ key: "agentAssistHeadersKey"
250
466
  },
251
467
  {
252
468
  type: "section",
253
- key: "amd",
469
+ key: "transcribe"
254
470
  },
255
471
  {
256
472
  type: "section",
257
- key: "advanced",
473
+ key: "amd"
258
474
  },
475
+ {
476
+ type: "section",
477
+ key: "advanced"
478
+ }
259
479
  ],
260
480
  summary: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__SUMMARY",
261
- function: async ({ cognigy, config }) => {
481
+ function: async ({ cognigy, config, organisationId, projectId }) => {
262
482
  const { api, input } = cognigy;
263
- const { transferType, transferTarget, useTransferSipHeaders, transferSipHeaders, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId, recognitionChannel, sttVendor, sttLanguage, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText } = config;
483
+ const { transferType, transferTarget, referredBy, useTransferSipHeaders, transferSipHeaders = {}, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId, recognitionChannel, sttVendor, sttLanguage, sttDisablePunctuation, dialTimeout, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, sttLabel, googleModel, sttDeepgramTier, sttDeepgramModel, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, agentAssistEnabled, agentAssistHeadersKey = customHeaderDefaultValue } = config;
264
484
  const transferParams = {
265
485
  transferType,
266
486
  transferReason,
267
487
  transferTarget,
488
+ referredBy,
268
489
  useTransferSipHeaders,
269
490
  transferSipHeaders,
270
491
  dialMusic,
@@ -272,13 +493,45 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
272
493
  dialTranscriptionWebhook,
273
494
  amdEnabled,
274
495
  amdRedirectOnMachineDetected,
275
- amdRedirectText
496
+ amdRedirectText,
497
+ dialTimeout,
498
+ sttLabel,
276
499
  };
277
500
  try {
278
501
  if (input.channel === "adminconsole") {
279
- api.say("Transferring a call is not supported in the Interaction Panel, please use the VoiceGateway endpoint.", null);
502
+ let textWarningAdminChannel = "Transferring a call is not supported in the Interaction Panel, please use the VoiceGateway endpoint.";
503
+ if (agentAssistEnabled && !dialTranscriptionWebhook) {
504
+ textWarningAdminChannel = `${textWarningAdminChannel + "\n"} Copilot is enabled but no transcription webhook is configured. Please configure a transcription webhook in the Transfer node.`;
505
+ }
506
+ api.say(textWarningAdminChannel, null);
280
507
  return;
281
508
  }
509
+ if (agentAssistEnabled && dialTranscriptionWebhook) {
510
+ try {
511
+ const agentAssistConfigId = api.getAgentAssistConfigId();
512
+ const uui = (0, helper_1.buildUUIValue)({
513
+ sessionId: input.sessionId,
514
+ userId: input.userId,
515
+ webhookUrl: dialTranscriptionWebhook,
516
+ agentAssistConfigId,
517
+ organisationId: organisationId,
518
+ projectId,
519
+ });
520
+ if (!(~dialTranscriptionWebhook.indexOf("userId") && ~dialTranscriptionWebhook.indexOf("sessionId"))) {
521
+ transferParams.dialTranscriptionWebhook = `${dialTranscriptionWebhook}?userId=${input.userId}&sessionId=${input.sessionId}`;
522
+ }
523
+ api.addToInput("UUIValue", uui);
524
+ /* As soon as Copilot enabled, we enable SIP Headers and remove the X-Custom-Header */
525
+ if (!useTransferSipHeaders) {
526
+ transferParams.useTransferSipHeaders = true;
527
+ delete transferSipHeaders["X-Custom-Header"];
528
+ }
529
+ transferSipHeaders[agentAssistHeadersKey] = uui;
530
+ }
531
+ catch (error) {
532
+ api.log("error", "Error on Copilot configuration: " + error.message);
533
+ }
534
+ }
282
535
  if (useTransferSipHeaders &&
283
536
  transferSipHeaders &&
284
537
  !(0, helper_1.isValidJSON)(transferSipHeaders)) {
@@ -286,13 +539,13 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
286
539
  transferParams.useTransferSipHeaders = false;
287
540
  api.log("error", "Invalid JSON in Transfer SIP Headers");
288
541
  }
289
- const payload = transfer_mapper_1.transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage);
542
+ const payload = transfer_mapper_1.transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramTier, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting);
290
543
  api.say(null, {
291
544
  _cognigy: payload,
292
545
  });
293
546
  }
294
547
  catch (error) {
295
- throw new Error(`Error on Transfer node. Error message: ${error.message}`);
548
+ throw new Error(`Error on Transfer node type: ${transferType}. Error message: ${error.message}`);
296
549
  }
297
550
  },
298
551
  });
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isValidJSON = exports.cleanTarget = void 0;
3
+ exports.buildUUIValue = exports.isValidJSON = exports.cleanTarget = void 0;
4
4
  function cleanTarget(rawTarget, isPrefixRequired) {
5
5
  if (rawTarget.includes("@")) {
6
- // handle sip refer
7
6
  const sip = rawTarget.replace(/\s/g, "");
8
- if (rawTarget.substring(0, 4) === "sip:")
7
+ /* Leave the referTo target untouched in case it's already an URI */
8
+ if (!rawTarget.startsWith('<') && !rawTarget.startsWith('sip') && !rawTarget.startsWith('"')) {
9
+ return `sip:${sip}`;
10
+ }
11
+ else {
9
12
  return sip;
10
- return `sip:${sip}`;
13
+ }
11
14
  }
12
15
  // handle telephone refer
13
16
  let processedTarget = rawTarget;
@@ -43,4 +46,27 @@ function isValidJSON(json) {
43
46
  }
44
47
  }
45
48
  exports.isValidJSON = isValidJSON;
49
+ const extractURLToken = (url) => {
50
+ const [path] = url.split('?');
51
+ const [token] = path.split('/').reverse();
52
+ return token;
53
+ };
54
+ const encodeHex = (plain) => {
55
+ return plain.split("")
56
+ .map(c => c.charCodeAt(0).toString(16).padStart(2, "0"))
57
+ .join("");
58
+ };
59
+ const createFullUUIValue = (uui) => {
60
+ return `00${encodeHex(uui)};encoding=hex`;
61
+ };
62
+ const buildUUIValue = (params) => {
63
+ const { webhookUrl, userId, sessionId, agentAssistConfigId, organisationId, projectId } = params;
64
+ const { AGENT_ASSIST_WORKSPACE_FRONTEND_URL_WITH_PROTOCOL } = process.env;
65
+ const URLToken = extractURLToken(webhookUrl);
66
+ const assistUserId = `assist-${userId}`;
67
+ const assistSessionId = `assist-${sessionId}`;
68
+ const uui = `${AGENT_ASSIST_WORKSPACE_FRONTEND_URL_WITH_PROTOCOL}/?userId=${assistUserId}&sessionId=${assistSessionId}&URLToken=${URLToken}&organisationId=${organisationId}&projectId=${projectId}&configId=${agentAssistConfigId}`;
69
+ return createFullUUIValue(uui);
70
+ };
71
+ exports.buildUUIValue = buildUUIValue;
46
72
  //# sourceMappingURL=helper.js.map
@@ -19,7 +19,7 @@ const rephraseMultipleSentencesWithAI = async (sentences, config, api, organisat
19
19
  exports.rephraseMultipleSentencesWithAI = rephraseMultipleSentencesWithAI;
20
20
  const createRephraseSentenceWithAIOptions = (params) => {
21
21
  const options = {
22
- promptType: params.promtType,
22
+ promptType: params.promptType,
23
23
  questionType: params.questionType,
24
24
  temperature: params.generativeAI_temperature,
25
25
  question: params.question,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IP_NOT_AVAILABLE = exports.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS = exports.AUDIO_PREVIEW_PROVIDER_EXTENSION = exports.GENERATIVE_AI_PROVIDER_EXTENSION = exports.ADMIN_CONSOLE_URL_TOKEN = exports.X_COGNIGY_ORIGIN = exports.EMBEDDED_EXTENSION = exports.INTERNAL_STORAGE_PROVIDER_EXTENSION = exports.VOICE_GATEWAY_2_EXTENSION = exports.MICROSOFT_EXTENSION = exports.VOICE_GATEWAY_EXTENSION = exports.SMTP_EXTENSION = exports.SQL_EXTENSION = exports.MONGO_DB_EXTENSION = exports.BASIC_EXTENSION = exports.MAX_INT32 = exports.PASSWORD_RESET_TOKEN_TTL_IN_SECONDS = exports.SCOPED_USER = exports.SYSTEM_EMAIL = exports.SYSTEM = exports.CREATED_BY_SSO = void 0;
3
+ exports.IP_NOT_AVAILABLE = exports.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS = exports.TRANSLATION_PROVIDER_EXTENSION = exports.AUDIO_PREVIEW_PROVIDER_EXTENSION = exports.GENERATIVE_AI_PROVIDER_EXTENSION = exports.ADMIN_CONSOLE_URL_TOKEN = exports.X_COGNIGY_ORIGIN = exports.EMBEDDED_EXTENSION = exports.INTERNAL_STORAGE_PROVIDER_EXTENSION = exports.VOICE_GATEWAY_2_EXTENSION = exports.MICROSOFT_EXTENSION = exports.VOICE_GATEWAY_EXTENSION = exports.SMTP_EXTENSION = exports.SQL_EXTENSION = exports.MONGO_DB_EXTENSION = exports.BASIC_EXTENSION = exports.MAX_INT32 = exports.PASSWORD_RESET_TOKEN_TTL_IN_SECONDS = exports.SCOPED_USER = exports.SYSTEM_EMAIL = exports.SYSTEM = exports.CREATED_BY_SSO = void 0;
4
4
  exports.CREATED_BY_SSO = "000000000000000000000550";
5
5
  exports.SYSTEM = "000000000000000000000000";
6
6
  exports.SYSTEM_EMAIL = "system@mail.com";
@@ -22,6 +22,7 @@ exports.X_COGNIGY_ORIGIN = "x-cognigy-origin";
22
22
  exports.ADMIN_CONSOLE_URL_TOKEN = "ffffffffffffffffffff55555555555555555eeeeeeeeeeeeeeeaaaaaaaaaaaa";
23
23
  exports.GENERATIVE_AI_PROVIDER_EXTENSION = "@cognigy/generative-ai-provider";
24
24
  exports.AUDIO_PREVIEW_PROVIDER_EXTENSION = "@cognigy/audio-preview-provider";
25
+ exports.TRANSLATION_PROVIDER_EXTENSION = "@cognigy/translation-provider";
25
26
  exports.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS = {
26
27
  ESCALATE_INTENTS_HANDOVER_LIVE_AGENT_INBOX_ID: "escalateIntentsHandoverLiveAgentInboxId",
27
28
  ESCALATE_INTENTS_AGENT_ASSIST_INIT_MESSAGE: "escalateIntentsAgentAssistInitMessage",
@@ -30,6 +31,9 @@ exports.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS = {
30
31
  ESCALATE_ANSWERS_ALLOW_AGENT_INJECT: "escalateAnswersAllowAgentInject",
31
32
  ESCALATE_ANSWERS_AGENT_ASSIST_INIT_MESSAGE: "escalateAnswersAgentAssistInitMessage",
32
33
  LIVE_AGENT_INBOX_ID: "liveAgentInboxId",
34
+ LIVE_AGENT_SKILLS: "liveAgentSkills",
35
+ LIVE_AGENT_LANGUAGES: "liveAgentLanguages",
36
+ LIVE_AGENT_PRIORITY: "liveAgentPriority",
33
37
  AGENT_ASSIST_INIT_MESSAGE: "agentAssistInitMessage",
34
38
  ALLOW_AGENT_INJECT: "allowAgentInject",
35
39
  };
@@ -7,6 +7,8 @@ exports.handoverEventTypes = [
7
7
  "conversationFailed",
8
8
  "agentTypingOn",
9
9
  "agentTypingOff",
10
- "unknown"
10
+ "queueUpdate",
11
+ "RCEImplementationInfo",
12
+ "unknown",
11
13
  ];
12
14
  //# sourceMappingURL=THandoverEventType.js.map