@cognigy/rest-api-client 0.13.0 → 0.13.2
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/.eslintConfig.json +117 -0
- package/.eslintrc.json +2 -2
- package/CHANGELOG.md +22 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +10 -1
- package/build/shared/charts/descriptors/allFields.js +8 -0
- package/build/shared/charts/descriptors/apps/getAppSessionPin.js +9 -9
- package/build/shared/charts/descriptors/apps/initAppSession.js +36 -53
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +5 -18
- package/build/shared/charts/descriptors/apps/setAppState.js +6 -6
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +3 -3
- package/build/shared/charts/descriptors/apps/utils/buildAppUrl.js +12 -0
- package/build/shared/charts/descriptors/index.js +1 -1
- package/build/shared/charts/descriptors/logic/switch/switch.js +3 -2
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +8 -1
- package/build/shared/charts/descriptors/message/question/question.js +7 -3
- package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +6 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +1 -1
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +28 -25
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +53 -0
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +5 -3
- package/build/shared/charts/descriptors/voice/nodes/play.js +10 -3
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +4 -0
- package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +5 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +17 -5
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +27 -9
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +5 -1
- package/build/shared/errors/BadGatewayError.js +2 -1
- package/build/shared/errors/BadRequestError.js +2 -1
- package/build/shared/errors/ForbiddenError.js +2 -1
- package/build/shared/errors/GatewayTimeoutError.js +2 -1
- package/build/shared/errors/MethodNotAllowedError.js +2 -1
- package/build/shared/errors/NetworkError.js +2 -1
- package/build/shared/errors/PayloadTooLargeError.js +2 -1
- package/build/shared/errors/PaymentRequiredError.js +2 -1
- package/build/shared/errors/ServiceUnavailableError.js +2 -1
- package/build/shared/errors/UnauthorizedError.js +2 -1
- package/build/shared/errors/baseError.js +27 -4
- package/build/shared/errors/conflict.js +2 -1
- package/build/shared/errors/databaseConnectError.js +2 -2
- package/build/shared/errors/databaseQueryError.js +2 -2
- package/build/shared/errors/databaseRead.js +2 -2
- package/build/shared/errors/databaseWrite.js +2 -2
- package/build/shared/errors/exportError.js +2 -2
- package/build/shared/errors/fileRead.js +2 -2
- package/build/shared/errors/fileWrite.js +2 -2
- package/build/shared/errors/importError.js +1 -1
- package/build/shared/errors/inputOutputError.js +2 -2
- package/build/shared/errors/internalServerError.js +2 -1
- package/build/shared/errors/invalidArgument.js +2 -2
- package/build/shared/errors/missingArgument.js +2 -2
- package/build/shared/errors/notImplementedError.js +2 -1
- package/build/shared/errors/process.js +2 -2
- package/build/shared/errors/resourceNotFound.js +5 -1
- package/build/shared/errors/smtpConnectError.js +2 -2
- package/build/shared/errors/timeoutError.js +2 -2
- package/build/shared/interfaces/handover.js +1 -0
- package/build/shared/interfaces/resources/IAgentAssistConfig.js +56 -0
- package/build/shared/interfaces/resources/ILocale.js +25 -3
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +1 -0
- package/build/shared/interfaces/resources/TResourceType.js +3 -0
- package/build/shared/interfaces/resources/settings/ISharedSettings.js +1 -1
- package/build/shared/interfaces/resources/yesNoIntent/IYesNoItem.js +5 -5
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ICognigyLiveAgentMiddleware_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IAgentAssistConfig_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/ICreateAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IDeleteAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IIndexAgentAssistConfigsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IReadAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IUpdateAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/ITrainYesNoIntentsProjectRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntents_2_0.js +4 -4
- package/build/shared/interfaces/security/IACL.js +1 -1
- package/build/shared/interfaces/security/IPermission.js +2 -0
- package/build/shared/interfaces/security/IRole.js +4 -0
- package/package.json +2 -2
- package/types/index.d.ts +218 -66
|
@@ -129,11 +129,15 @@ exports.QUESTION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
129
129
|
label: "Data",
|
|
130
130
|
value: "data",
|
|
131
131
|
},
|
|
132
|
+
process.env.FEATURE_USE_COGNIGY_APPS && {
|
|
133
|
+
label: "xApp",
|
|
134
|
+
value: "app",
|
|
135
|
+
},
|
|
132
136
|
{
|
|
133
137
|
label: "Custom",
|
|
134
138
|
value: "custom",
|
|
135
139
|
},
|
|
136
|
-
],
|
|
140
|
+
].filter(option => !!option),
|
|
137
141
|
},
|
|
138
142
|
defaultValue: 'yesNo'
|
|
139
143
|
},
|
|
@@ -500,7 +504,7 @@ exports.QUESTION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
500
504
|
process.env.FEATURE_USE_COGNIGY_LIVE_AGENT && {
|
|
501
505
|
key: "escalateAnswersAgentAssistInitMessage",
|
|
502
506
|
type: "cognigyText",
|
|
503
|
-
label: "Live Agent - Initial
|
|
507
|
+
label: "Live Agent - Initial Agent Assist Trigger",
|
|
504
508
|
description: "If an Assist Flow is configured, this trigger message is sent to it as an input upon Live Agent handover",
|
|
505
509
|
condition: {
|
|
506
510
|
key: "escalateAnswersAction",
|
|
@@ -843,7 +847,7 @@ exports.QUESTION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
843
847
|
process.env.FEATURE_USE_COGNIGY_LIVE_AGENT && {
|
|
844
848
|
key: "escalateIntentsAgentAssistInitMessage",
|
|
845
849
|
type: "cognigyText",
|
|
846
|
-
label: "Live Agent - Initial
|
|
850
|
+
label: "Live Agent - Initial Agent Assist Trigger",
|
|
847
851
|
description: "If an Assist Flow is configured, this trigger message is sent to it as an input upon Live Agent handover",
|
|
848
852
|
condition: {
|
|
849
853
|
key: "escalateIntentsAction",
|
|
@@ -7,6 +7,7 @@ const getQuestionText_1 = require("./getQuestionText");
|
|
|
7
7
|
* Evaluates the answer of a question against its type
|
|
8
8
|
*/
|
|
9
9
|
function evaluateQuestionAnswer({ cognigy, config }) {
|
|
10
|
+
var _a, _b, _c;
|
|
10
11
|
const { type, keyphraseTag, usePositiveOnly, regex: regexField, storeDetailedResults } = config;
|
|
11
12
|
const { input } = cognigy;
|
|
12
13
|
let result;
|
|
@@ -90,6 +91,11 @@ function evaluateQuestionAnswer({ cognigy, config }) {
|
|
|
90
91
|
result = input.data;
|
|
91
92
|
}
|
|
92
93
|
break;
|
|
94
|
+
case "app":
|
|
95
|
+
if (((_c = (_b = (_a = input.data) === null || _a === void 0 ? void 0 : _a._cognigy) === null || _b === void 0 ? void 0 : _b._app) === null || _c === void 0 ? void 0 : _c.type) === "submit") {
|
|
96
|
+
result = input.data._cognigy._app.payload;
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
93
99
|
case "custom":
|
|
94
100
|
// the custom type is always true
|
|
95
101
|
result = true;
|
|
@@ -72,7 +72,7 @@ exports.HANDOVER_V2 = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
72
72
|
{
|
|
73
73
|
key: "agentAssistInitMessage",
|
|
74
74
|
type: "cognigyText",
|
|
75
|
-
label: "Initial
|
|
75
|
+
label: "Initial Agent Assist Trigger",
|
|
76
76
|
description: "If an Assist Flow is configured, this trigger message is sent to it as an input upon Live Agent handover"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
@@ -5,12 +5,13 @@ const strip_nulls_1 = require("../../voicegateway2/utils/strip-nulls");
|
|
|
5
5
|
const helper_1 = require("../utils/helper");
|
|
6
6
|
const constants_1 = require("../utils/constants");
|
|
7
7
|
function voiceConfigParamsToVoiceSettings(config, api) {
|
|
8
|
+
var _a, _b, _c;
|
|
8
9
|
let voiceSettings = {};
|
|
9
10
|
if (config.bargeInOnSpeech || config.bargeInOnDtmf) {
|
|
10
11
|
voiceSettings.bargeIn = {
|
|
11
12
|
bargeInEnable: false,
|
|
12
|
-
bargeInOnDtmf: config.bargeInOnDtmf ?
|
|
13
|
-
bargeInOnSpeech: config.bargeInOnSpeech ?
|
|
13
|
+
bargeInOnDtmf: (_a = config.bargeInOnDtmf) !== null && _a !== void 0 ? _a : false,
|
|
14
|
+
bargeInOnSpeech: (_b = config.bargeInOnSpeech) !== null && _b !== void 0 ? _b : false,
|
|
14
15
|
bargeInMinimunWords: config.bargeInMinWordCount,
|
|
15
16
|
};
|
|
16
17
|
}
|
|
@@ -44,17 +45,14 @@ function voiceConfigParamsToVoiceSettings(config, api) {
|
|
|
44
45
|
userNoInputSpeech: config.userNoInputSpeech,
|
|
45
46
|
userNoInputUrl: config.userNoInputUrl,
|
|
46
47
|
};
|
|
47
|
-
// dtmf
|
|
48
48
|
voiceSettings.dtmf = {
|
|
49
49
|
dtmfEnable: config.dtmfEnable,
|
|
50
50
|
dtmfInterDigitTimeout: config.dtmfInterDigitTimeout,
|
|
51
51
|
dtmfMaxDigits: config.dtmfMaxDigits,
|
|
52
52
|
dtmfMinDigits: config.dtmfMinDigits,
|
|
53
|
-
dtmfSubmitDigit: config.dtmfSubmitDigit,
|
|
53
|
+
dtmfSubmitDigit: (_c = config.dtmfSubmitDigit) === null || _c === void 0 ? void 0 : _c.trim(),
|
|
54
54
|
};
|
|
55
55
|
if (config === null || config === void 0 ? void 0 : config.dtmfEnable) {
|
|
56
|
-
if (config.dtmfSubmitDigit)
|
|
57
|
-
voiceSettings.dtmf.dtmfSubmitDigit = config.dtmfSubmitDigit.trim();
|
|
58
56
|
if (voiceSettings.dtmf.dtmfSubmitDigit &&
|
|
59
57
|
!(0, helper_1.isValidDTMF)(voiceSettings.dtmf.dtmfSubmitDigit)) {
|
|
60
58
|
if (api)
|
|
@@ -115,6 +113,7 @@ exports.setSessionConfig = {
|
|
|
115
113
|
}
|
|
116
114
|
},
|
|
117
115
|
handleVGInput(voiceSettings) {
|
|
116
|
+
var _a;
|
|
118
117
|
const { bargeIn, continuousAsr, stt, tts, userNoInput, dtmf, vad } = voiceSettings;
|
|
119
118
|
const user = {};
|
|
120
119
|
const synthesizer = {};
|
|
@@ -129,12 +128,12 @@ exports.setSessionConfig = {
|
|
|
129
128
|
}
|
|
130
129
|
recognizer.vendor = (stt === null || stt === void 0 ? void 0 : stt.sttVendor) ? stt.sttVendor : "default";
|
|
131
130
|
recognizer.punctuation = stt === null || stt === void 0 ? void 0 : stt.sttDisablePunctuation;
|
|
132
|
-
if (vad
|
|
133
|
-
recognizer.vad = {
|
|
134
|
-
|
|
135
|
-
mode
|
|
136
|
-
voiceMs
|
|
137
|
-
}
|
|
131
|
+
if (vad) {
|
|
132
|
+
recognizer.vad = { enable: vad.enable };
|
|
133
|
+
if (vad.enable) {
|
|
134
|
+
recognizer.vad.mode = vad.mode;
|
|
135
|
+
recognizer.vad.voiceMs = vad.voiceMs;
|
|
136
|
+
}
|
|
138
137
|
}
|
|
139
138
|
//verify if there are TTS Configs to set
|
|
140
139
|
if (tts) {
|
|
@@ -155,17 +154,20 @@ exports.setSessionConfig = {
|
|
|
155
154
|
? userNoInput.userNoInputTimeout / 1000
|
|
156
155
|
: 10;
|
|
157
156
|
}
|
|
158
|
-
//verify if there are Continuous ASR Configs to set
|
|
157
|
+
// verify if there are Continuous ASR Configs to set
|
|
159
158
|
if (continuousAsr === null || continuousAsr === void 0 ? void 0 : continuousAsr.asrEnabled) {
|
|
160
159
|
recognizer.asrDtmfTerminationDigit = continuousAsr.asrDigit;
|
|
161
160
|
recognizer.asrTimeout = continuousAsr.asrTimeout
|
|
162
161
|
? continuousAsr.asrTimeout / 1000
|
|
163
162
|
: undefined;
|
|
164
163
|
}
|
|
165
|
-
//verify if there are Barge In Configs to set
|
|
164
|
+
// verify if there are Barge In Configs to set
|
|
166
165
|
if (bargeIn) {
|
|
167
166
|
barge.enable = bargeIn.bargeInEnable;
|
|
168
|
-
|
|
167
|
+
/* Barge in minimum words. min: 1, max: 5, default: 1 */
|
|
168
|
+
bargeIn.bargeInMinimunWords >= 1 && bargeIn.bargeInMinimunWords <= 5
|
|
169
|
+
? barge.minBargeinWordCount = bargeIn.bargeInMinimunWords
|
|
170
|
+
: barge.minBargeinWordCount = 1;
|
|
169
171
|
barge.input = [];
|
|
170
172
|
barge.actionHook = "voice";
|
|
171
173
|
barge.dtmfBargein = bargeIn.bargeInOnDtmf;
|
|
@@ -178,32 +180,33 @@ exports.setSessionConfig = {
|
|
|
178
180
|
barge.input.push("speech");
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
|
-
//verify if there are DTMF Configs to set
|
|
183
|
+
// verify if there are DTMF Configs to set
|
|
182
184
|
if (dtmf) {
|
|
183
185
|
dtmfParam = dtmf.dtmfEnable;
|
|
184
186
|
if (dtmf.dtmfEnable) {
|
|
187
|
+
barge.enable = (_a = barge.enable) !== null && _a !== void 0 ? _a : false;
|
|
185
188
|
barge.interDigitTimeout =
|
|
186
189
|
dtmf.dtmfInterDigitTimeout && dtmf.dtmfInterDigitTimeout >= 0
|
|
187
190
|
? dtmf.dtmfInterDigitTimeout === 0
|
|
188
191
|
? 0
|
|
189
192
|
: dtmf.dtmfInterDigitTimeout / 1000
|
|
190
193
|
: undefined;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
/* Max digits. min: 1, max: - default: 1 */
|
|
195
|
+
barge.maxDigits = dtmf.dtmfMaxDigits >= 1
|
|
196
|
+
? barge.maxDigits = dtmf.dtmfMaxDigits
|
|
197
|
+
: 1;
|
|
195
198
|
barge.minDigits = dtmf.dtmfMinDigits || 1;
|
|
196
199
|
barge.finishOnKey = dtmf.dtmfSubmitDigit;
|
|
197
200
|
}
|
|
198
201
|
}
|
|
199
|
-
//Check if there are configs for synthesizer, recognizer and bargeIn
|
|
202
|
+
// Check if there are configs for synthesizer, recognizer and bargeIn
|
|
200
203
|
const voiceConfig = {
|
|
201
|
-
synthesizer: synthesizer
|
|
202
|
-
recognizer: recognizer
|
|
203
|
-
bargeIn: barge
|
|
204
|
+
synthesizer: synthesizer || undefined,
|
|
205
|
+
recognizer: recognizer || undefined,
|
|
206
|
+
bargeIn: barge || undefined,
|
|
204
207
|
};
|
|
205
208
|
(0, strip_nulls_1.stripNulls)(voiceConfig);
|
|
206
|
-
//Check if there are configs for No User Input and DTMF
|
|
209
|
+
// Check if there are configs for No User Input and DTMF
|
|
207
210
|
const cognigyConfig = {
|
|
208
211
|
user: user ? user : undefined,
|
|
209
212
|
dtmf: dtmfParam,
|
|
@@ -42,12 +42,65 @@ exports.BARGE_IN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
42
42
|
step: 1,
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
key: "dtmfInterDigitTimeout",
|
|
47
|
+
type: "number",
|
|
48
|
+
label: "DTMF Inter Digit Timeout",
|
|
49
|
+
description: "Defines the timeout in between collected DTMF digits",
|
|
50
|
+
defaultValue: 2000,
|
|
51
|
+
params: {
|
|
52
|
+
min: 0,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "dtmfMaxDigits",
|
|
57
|
+
type: "number",
|
|
58
|
+
label: "DTMF Max Digits",
|
|
59
|
+
description: "Defines the maximum number of digits which can be entered by the user, the digits are being submitted automatically once this limit is reached",
|
|
60
|
+
defaultValue: 1,
|
|
61
|
+
params: {
|
|
62
|
+
min: 1,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "dtmfSubmitDigit",
|
|
67
|
+
type: "cognigyText",
|
|
68
|
+
label: "DTMF Submit Digit",
|
|
69
|
+
description: "Defines the DTMF submit digit which will be used for submitting the previously entered digits.",
|
|
70
|
+
defaultValue: "#",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
sections: [
|
|
74
|
+
{
|
|
75
|
+
key: "paramsDtmf",
|
|
76
|
+
label: "DTMF",
|
|
77
|
+
defaultCollapsed: false,
|
|
78
|
+
fields: ["dtmfInterDigitTimeout", "dtmfMaxDigits", "dtmfSubmitDigit"],
|
|
79
|
+
condition: {
|
|
80
|
+
key: "bargeInOnDtmf",
|
|
81
|
+
value: true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
form: [
|
|
86
|
+
{ type: "field", key: "bargeInOnSpeech" },
|
|
87
|
+
{ type: "field", key: "bargeInOnDtmf" },
|
|
88
|
+
{ type: "field", key: "bargeInMinWordCount" },
|
|
89
|
+
{ type: "section", key: "paramsDtmf" }
|
|
45
90
|
],
|
|
46
91
|
function: async ({ cognigy, config }) => {
|
|
47
92
|
const { api, input } = cognigy;
|
|
48
93
|
const { endpointType } = input;
|
|
49
94
|
try {
|
|
95
|
+
if (config.bargeInOnDtmf) {
|
|
96
|
+
config.dtmfEnable = true;
|
|
97
|
+
}
|
|
98
|
+
if (config.bargeInOnSpeech || config.bargeInOnDtmf) {
|
|
99
|
+
config.bargeInEnable = true;
|
|
100
|
+
}
|
|
50
101
|
const payload = setSessionConfig_mapper_1.setSessionConfig.handleInput(endpointType, (0, setSessionConfig_mapper_2.voiceConfigParamsToVoiceSettings)(config, api));
|
|
102
|
+
/* we need to store this for the DTMF Collect - Config node */
|
|
103
|
+
api.setSystemContext("vgSettings", { bargeInOnDtmf: config.bargeInOnDtmf });
|
|
51
104
|
api.say(null, {
|
|
52
105
|
_cognigy: payload,
|
|
53
106
|
});
|
|
@@ -64,16 +64,18 @@ exports.DTMF = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
66
|
function: async ({ cognigy, config }) => {
|
|
67
|
+
var _a, _b;
|
|
67
68
|
const { api, input } = cognigy;
|
|
68
69
|
const { endpointType } = input;
|
|
69
|
-
const
|
|
70
|
+
const voiceConfig = {
|
|
70
71
|
dtmfEnable: config.dtmfEnable,
|
|
71
72
|
dtmfInterDigitTimeout: config.dtmfInterDigitTimeout,
|
|
72
73
|
dtmfMaxDigits: config.dtmfMaxDigits,
|
|
73
|
-
dtmfSubmitDigit: config.dtmfSubmitDigit
|
|
74
|
+
dtmfSubmitDigit: config.dtmfSubmitDigit,
|
|
75
|
+
bargeInOnDtmf: (_b = (_a = api.getSystemContext("vgSettings")) === null || _a === void 0 ? void 0 : _a.bargeInOnDtmf) !== null && _b !== void 0 ? _b : false,
|
|
74
76
|
};
|
|
75
77
|
try {
|
|
76
|
-
const payload = setSessionConfig_mapper_1.setSessionConfig.handleInput(endpointType, (0, setSessionConfig_mapper_2.voiceConfigParamsToVoiceSettings)(
|
|
78
|
+
const payload = setSessionConfig_mapper_1.setSessionConfig.handleInput(endpointType, (0, setSessionConfig_mapper_2.voiceConfigParamsToVoiceSettings)(voiceConfig, api));
|
|
77
79
|
api.say(null, {
|
|
78
80
|
_cognigy: payload,
|
|
79
81
|
});
|
|
@@ -7,9 +7,16 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const play_mapper_1 = require("../mappers/play.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const setSessionConfig_1 = require("../../voicegateway2/nodes/setSessionConfig");
|
|
10
|
+
const fields = setSessionConfig_1.voiceConfigFields.map(field => {
|
|
11
|
+
if (field.key !== "sttDisablePunctuation" &&
|
|
12
|
+
field.key !== "sttVadEnabled" &&
|
|
13
|
+
field.key !== "sttVadMode" &&
|
|
14
|
+
field.key !== "sttVadVoiceMs")
|
|
15
|
+
return field;
|
|
16
|
+
});
|
|
10
17
|
exports.PLAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
18
|
type: "play",
|
|
12
|
-
defaultLabel: "Play",
|
|
19
|
+
defaultLabel: "Play URL",
|
|
13
20
|
tags: ['voice'],
|
|
14
21
|
preview: {
|
|
15
22
|
key: "url",
|
|
@@ -35,14 +42,14 @@ exports.PLAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
35
42
|
type: "toggle",
|
|
36
43
|
defaultValue: false
|
|
37
44
|
},
|
|
38
|
-
...
|
|
45
|
+
...fields
|
|
39
46
|
],
|
|
40
47
|
sections: [
|
|
41
48
|
{
|
|
42
49
|
key: "params_stt",
|
|
43
50
|
label: "Recognizer (STT)",
|
|
44
51
|
defaultCollapsed: true,
|
|
45
|
-
fields: ["
|
|
52
|
+
fields: ["sttVendor", "sttHints"],
|
|
46
53
|
condition: {
|
|
47
54
|
key: "setActivityParams",
|
|
48
55
|
value: true
|
|
@@ -88,6 +88,10 @@ exports.TRANSFER_VOICE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
88
88
|
const { referTo, useTransferSipHeaders, transferSipHeaders, transferReason, } = config;
|
|
89
89
|
const { endpointType } = input;
|
|
90
90
|
try {
|
|
91
|
+
if (input.channel === "adminconsole") {
|
|
92
|
+
api.say("Transferring a call is not supported in the Interaction Panel.", null);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
91
95
|
const transferParams = {
|
|
92
96
|
transferReason: transferReason,
|
|
93
97
|
transferTarget: (0, helper_1.cleanTarget)(referTo),
|
|
@@ -117,7 +117,7 @@ exports.handoverNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
117
117
|
}
|
|
118
118
|
],
|
|
119
119
|
function: async ({ cognigy, config }) => {
|
|
120
|
-
const { api } = cognigy;
|
|
120
|
+
const { api, input } = cognigy;
|
|
121
121
|
const { handoverReason, transferTarget, transferReferredByURL, useTransferSipHeaders, transferSipHeaders, transferNotifications, transferNotificationsHangupMS } = config;
|
|
122
122
|
const transferParams = {
|
|
123
123
|
transferReason: handoverReason,
|
|
@@ -129,6 +129,10 @@ exports.handoverNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
129
129
|
transferReferredByURL
|
|
130
130
|
};
|
|
131
131
|
try {
|
|
132
|
+
if (input.channel === "adminconsole") {
|
|
133
|
+
api.say("Transferring a call is not supported in the Interaction Panel, please use the AudioCodes endpoint.", null);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
132
136
|
const payload = transfer_mapper_1.transfer.handleInput("audioCodes", transferParams, false);
|
|
133
137
|
api.say(null, {
|
|
134
138
|
_cognigy: payload
|
|
@@ -61,7 +61,14 @@ exports.playNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
61
61
|
key: "params_stt",
|
|
62
62
|
label: "Recognizer (STT)",
|
|
63
63
|
defaultCollapsed: true,
|
|
64
|
-
fields: [
|
|
64
|
+
fields: [
|
|
65
|
+
"sttVendor",
|
|
66
|
+
"sttHints",
|
|
67
|
+
"sttDisablePunctuation",
|
|
68
|
+
"sttVadEnabled",
|
|
69
|
+
"sttVadMode",
|
|
70
|
+
"sttVadVoiceMs"
|
|
71
|
+
],
|
|
65
72
|
condition: {
|
|
66
73
|
key: "setActivityParams",
|
|
67
74
|
value: true
|
|
@@ -81,12 +88,18 @@ exports.playNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
81
88
|
key: "params_dtmf",
|
|
82
89
|
label: "DTMF",
|
|
83
90
|
defaultCollapsed: true,
|
|
84
|
-
fields: [
|
|
91
|
+
fields: [
|
|
92
|
+
"dtmfEnable",
|
|
93
|
+
"dtmfInterDigitTimeout",
|
|
94
|
+
"dtmfMaxDigits",
|
|
95
|
+
"dtmfMinDigits",
|
|
96
|
+
"dtmfSubmitDigit"
|
|
97
|
+
],
|
|
85
98
|
condition: {
|
|
86
99
|
key: "setActivityParams",
|
|
87
100
|
value: true
|
|
88
101
|
}
|
|
89
|
-
}
|
|
102
|
+
}
|
|
90
103
|
],
|
|
91
104
|
form: [
|
|
92
105
|
{ type: "field", key: "url" },
|
|
@@ -94,7 +107,7 @@ exports.playNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
94
107
|
{ type: "field", key: "setActivityParams" },
|
|
95
108
|
{ type: "section", key: "params_stt" },
|
|
96
109
|
{ type: "section", key: "params_bargein" },
|
|
97
|
-
{ type: "section", key: "params_dtmf" }
|
|
110
|
+
{ type: "section", key: "params_dtmf" }
|
|
98
111
|
],
|
|
99
112
|
function: async ({ cognigy, config }) => {
|
|
100
113
|
const { api } = cognigy;
|
|
@@ -107,7 +120,6 @@ exports.playNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
107
120
|
catch (error) {
|
|
108
121
|
throw new Error(`Error on play node. Error message: ${error.message}`);
|
|
109
122
|
}
|
|
110
|
-
;
|
|
111
123
|
}
|
|
112
124
|
});
|
|
113
125
|
//# sourceMappingURL=play.js.map
|
|
@@ -15,7 +15,7 @@ exports.voiceConfigFields = [
|
|
|
15
15
|
description: "Defines the minimum number of words that the user must say for the Voice Gateway to consider it a barge in",
|
|
16
16
|
defaultValue: 1,
|
|
17
17
|
params: {
|
|
18
|
-
min:
|
|
18
|
+
min: 1,
|
|
19
19
|
max: 5,
|
|
20
20
|
step: 1
|
|
21
21
|
}
|
|
@@ -31,7 +31,7 @@ exports.voiceConfigFields = [
|
|
|
31
31
|
key: "bargeInOnDtmf",
|
|
32
32
|
type: "toggle",
|
|
33
33
|
label: "Barge In On DTMF",
|
|
34
|
-
description: "Allows the user to interrupt bot output with DTMF.
|
|
34
|
+
description: "Allows the user to interrupt bot output with DTMF. Enabling Barge in on DTMF will also enable DTMF capture.",
|
|
35
35
|
defaultValue: false
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -44,6 +44,12 @@ exports.voiceConfigFields = [
|
|
|
44
44
|
languageKey: "config.sttLanguage"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
key: "sttLanguage",
|
|
49
|
+
type: "sttSelect",
|
|
50
|
+
defaultValue: "",
|
|
51
|
+
label: "_unused_"
|
|
52
|
+
},
|
|
47
53
|
{
|
|
48
54
|
key: "sttHints",
|
|
49
55
|
type: "textArray",
|
|
@@ -51,13 +57,6 @@ exports.voiceConfigFields = [
|
|
|
51
57
|
description: "Array of words or phrases to assist speech detection",
|
|
52
58
|
defaultValue: [""]
|
|
53
59
|
},
|
|
54
|
-
{
|
|
55
|
-
key: "sttVadEnabled",
|
|
56
|
-
type: "toggle",
|
|
57
|
-
label: "Enable Voice Activity Detection",
|
|
58
|
-
description: "Delay connection to cloud recognizer until speech is detected",
|
|
59
|
-
defaultValue: true
|
|
60
|
-
},
|
|
61
60
|
{
|
|
62
61
|
key: "sttDisablePunctuation",
|
|
63
62
|
type: "toggle",
|
|
@@ -65,6 +64,13 @@ exports.voiceConfigFields = [
|
|
|
65
64
|
description: "Prevents the STT response from the bot to include punctuation marks",
|
|
66
65
|
defaultValue: false
|
|
67
66
|
},
|
|
67
|
+
{
|
|
68
|
+
key: "sttVadEnabled",
|
|
69
|
+
type: "toggle",
|
|
70
|
+
label: "Enable Voice Activity Detection",
|
|
71
|
+
description: "Delay connection to cloud recognizer until speech is detected",
|
|
72
|
+
defaultValue: false
|
|
73
|
+
},
|
|
68
74
|
{
|
|
69
75
|
key: "sttVadMode",
|
|
70
76
|
type: "slider",
|
|
@@ -116,6 +122,18 @@ exports.voiceConfigFields = [
|
|
|
116
122
|
voiceKey: "config.ttsVoice"
|
|
117
123
|
}
|
|
118
124
|
},
|
|
125
|
+
{
|
|
126
|
+
key: "ttsVoice",
|
|
127
|
+
type: "ttsSelect",
|
|
128
|
+
defaultValue: "",
|
|
129
|
+
label: "_unused_",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
key: "ttsLanguage",
|
|
133
|
+
type: "ttsSelect",
|
|
134
|
+
defaultValue: "",
|
|
135
|
+
label: "_unused_",
|
|
136
|
+
},
|
|
119
137
|
{
|
|
120
138
|
key: "userNoInputMode",
|
|
121
139
|
type: "select",
|
|
@@ -70,7 +70,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
70
70
|
],
|
|
71
71
|
summary: "Transfer the call to another target",
|
|
72
72
|
function: async ({ cognigy, config }) => {
|
|
73
|
-
const { api } = cognigy;
|
|
73
|
+
const { api, input } = cognigy;
|
|
74
74
|
const { referTo, useTransferSipHeaders, transferSipHeaders } = config;
|
|
75
75
|
const transferParams = {
|
|
76
76
|
transferReason: "",
|
|
@@ -79,6 +79,10 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
79
79
|
transferSipHeaders,
|
|
80
80
|
};
|
|
81
81
|
try {
|
|
82
|
+
if (input.channel === "adminconsole") {
|
|
83
|
+
api.say("Transferring a call is not supported in the Interaction Panel, please use the VG2 endpoint.", null);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
82
86
|
if (useTransferSipHeaders &&
|
|
83
87
|
transferSipHeaders &&
|
|
84
88
|
!(0, helper_1.isValidJSON)(transferSipHeaders)) {
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class BadGatewayError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Bad Gateway Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class BadGatewayError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -42,7 +42,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
42
42
|
* example: {}
|
|
43
43
|
*/
|
|
44
44
|
class BadRequestError extends baseError_1.BaseError {
|
|
45
|
-
constructor(message, stack, meta, details) {
|
|
45
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
46
46
|
super({
|
|
47
47
|
name: "Bad Request Error",
|
|
48
48
|
message,
|
|
@@ -52,6 +52,7 @@ class BadRequestError extends baseError_1.BaseError {
|
|
|
52
52
|
meta,
|
|
53
53
|
stack,
|
|
54
54
|
details,
|
|
55
|
+
logLevel,
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class ForbiddenError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Forbidden Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class ForbiddenError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class GatewayTimeoutError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Gateway Timeout Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class GatewayTimeoutError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class MethodNotAllowedError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Method Not Allowed Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class MethodNotAllowedError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -5,7 +5,7 @@ exports.NetworkError = void 0;
|
|
|
5
5
|
const baseError_1 = require("./baseError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class NetworkError extends baseError_1.BaseError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
9
|
super({
|
|
10
10
|
name: "Network Error",
|
|
11
11
|
message,
|
|
@@ -15,6 +15,7 @@ class NetworkError extends baseError_1.BaseError {
|
|
|
15
15
|
meta,
|
|
16
16
|
stack,
|
|
17
17
|
details,
|
|
18
|
+
logLevel,
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class PayloadTooLargeError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Payload Too Large Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class PayloadTooLargeError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -42,7 +42,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
42
42
|
* example: {}
|
|
43
43
|
*/
|
|
44
44
|
class PaymentRequiredError extends baseError_1.BaseError {
|
|
45
|
-
constructor(message, stack, meta, details) {
|
|
45
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
46
46
|
super({
|
|
47
47
|
name: "Payment Required Error",
|
|
48
48
|
message,
|
|
@@ -52,6 +52,7 @@ class PaymentRequiredError extends baseError_1.BaseError {
|
|
|
52
52
|
meta,
|
|
53
53
|
stack,
|
|
54
54
|
details,
|
|
55
|
+
logLevel,
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class ServiceUnavailableError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Service Unavailable Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class ServiceUnavailableError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|