@onereach/step-voice 6.1.10 → 6.1.11-repromptsimprovements.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.
- package/dst/Choice.d.ts +1 -0
- package/dst/Choice.js +4 -3
- package/dst/Custom Voice Input.d.ts +1 -0
- package/dst/Custom Voice Input.js +3 -2
- package/dst/Keypad Input.d.ts +1 -0
- package/dst/Keypad Input.js +3 -2
- package/package.json +1 -1
package/dst/Choice.d.ts
CHANGED
package/dst/Choice.js
CHANGED
|
@@ -69,7 +69,7 @@ const isRepromptTrigger = (recogResult, promptsTriggers) => {
|
|
|
69
69
|
class Choice extends voice_1.default {
|
|
70
70
|
async runStep() {
|
|
71
71
|
const call = await this.fetchData();
|
|
72
|
-
const { textType, asr, tts, sensitiveData, noReplyDelay, usePromptsTriggers, recognitionModel, useInterspeechTimeout, interSpeechTimeout, longRecognition } = this.data;
|
|
72
|
+
const { textType, asr, tts, sensitiveData, noReplyDelay, usePromptsTriggers, recognitionModel, useInterspeechTimeout, interSpeechTimeout, longRecognition, usePromptsForUnrecognized } = this.data;
|
|
73
73
|
const exitExists = (exitId) => {
|
|
74
74
|
return lodash_1.default.some(choices, (choice) => choice.exitId === exitId);
|
|
75
75
|
};
|
|
@@ -115,7 +115,7 @@ class Choice extends voice_1.default {
|
|
|
115
115
|
await this.resumeRecording(call, sensitiveData);
|
|
116
116
|
return this.exitStep(exitId, this.exitChoiceData('dtmf', params), longRecognition);
|
|
117
117
|
}
|
|
118
|
-
else if (this.rptsHasMore({ repromptsList })) {
|
|
118
|
+
else if ((lodash_1.default.isUndefined(usePromptsForUnrecognized) || usePromptsForUnrecognized) && this.rptsHasMore({ repromptsList })) {
|
|
119
119
|
await this.transcript(call, {
|
|
120
120
|
message: 'Unrecognized',
|
|
121
121
|
keyPress: digit,
|
|
@@ -169,7 +169,8 @@ class Choice extends voice_1.default {
|
|
|
169
169
|
// There might be hooks after this step which we will try to avoid
|
|
170
170
|
return this.exitStep(exitId, this.exitChoiceData('voice', params), longRecognition);
|
|
171
171
|
}
|
|
172
|
-
else if (
|
|
172
|
+
else if ((lodash_1.default.isUndefined(usePromptsForUnrecognized) || usePromptsForUnrecognized) &&
|
|
173
|
+
this.rptsHasMore({ repromptsList }) &&
|
|
173
174
|
(usePromptsTriggers ? isRepromptTrigger(phrases, this.data.promptsTriggers) : true)) {
|
|
174
175
|
await this.transcript(call, {
|
|
175
176
|
message: 'Unrecognized',
|
|
@@ -55,7 +55,7 @@ const alterRecognitionPhrases = (phrases, interpretation) => {
|
|
|
55
55
|
class CustomVoiceInput extends voice_1.default {
|
|
56
56
|
async runStep() {
|
|
57
57
|
const call = await this.fetchData();
|
|
58
|
-
const { textType, tts, sensitiveData, noReplyDelay, usePromptsTriggers, recognitionModel, phraseList } = this.data;
|
|
58
|
+
const { textType, tts, sensitiveData, noReplyDelay, usePromptsTriggers, recognitionModel, phraseList, usePromptsForUnrecognized } = this.data;
|
|
59
59
|
const exitExists = (exitId) => {
|
|
60
60
|
return lodash_1.default.some(choices, (choice) => choice.exitId === exitId);
|
|
61
61
|
};
|
|
@@ -116,7 +116,8 @@ class CustomVoiceInput extends voice_1.default {
|
|
|
116
116
|
// There might be hooks after this step which we will try to avoid
|
|
117
117
|
return this.exitStep(exitId, this.exitChoiceData('voice', params));
|
|
118
118
|
}
|
|
119
|
-
else if (
|
|
119
|
+
else if ((lodash_1.default.isUndefined(usePromptsForUnrecognized) || usePromptsForUnrecognized) &&
|
|
120
|
+
this.rptsHasMore({ repromptsList }) &&
|
|
120
121
|
(usePromptsTriggers ? isRepromptTrigger(phrases, this.data.promptsTriggers) : true)) {
|
|
121
122
|
await this.transcript(call, {
|
|
122
123
|
message: 'Unrecognized',
|
package/dst/Keypad Input.d.ts
CHANGED
package/dst/Keypad Input.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
4
5
|
const voice_1 = tslib_1.__importDefault(require("./voice"));
|
|
5
6
|
const exitKeypadData = ({ mfVersion, digits, event }) => mfVersion === '1'
|
|
6
7
|
? digits
|
|
@@ -27,7 +28,7 @@ const validateInput = ({ input = '', type, regex, expectedLength }) => {
|
|
|
27
28
|
class KeypadInput extends voice_1.default {
|
|
28
29
|
async runStep() {
|
|
29
30
|
const call = await this.fetchData();
|
|
30
|
-
const { interTimeout, asr, tts, noReplyDelay, textType, keypadBargeIn, endInput, terminationKey, endUserInputValidationOther, expectedNumberOfDigits, regExToValidate, mfVersion, sensitiveData, recognitionModel } = this.data;
|
|
31
|
+
const { interTimeout, asr, tts, noReplyDelay, textType, keypadBargeIn, endInput, terminationKey, endUserInputValidationOther, expectedNumberOfDigits, regExToValidate, mfVersion, sensitiveData, recognitionModel, usePromptsForUnrecognized } = this.data;
|
|
31
32
|
const interDigitTimeout = Number(interTimeout) * 1000;
|
|
32
33
|
const ttsSettings = tts.getSettings(call.tts);
|
|
33
34
|
const asrSettings = asr.getSettings(call.asr);
|
|
@@ -89,7 +90,7 @@ class KeypadInput extends voice_1.default {
|
|
|
89
90
|
return this.exitStep('reply', exitKeypadData({ mfVersion, digits, event }));
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
92
|
-
if (this.rptsHasMore({ repromptsList })) {
|
|
93
|
+
if ((lodash_1.default.isUndefined(usePromptsForUnrecognized) || usePromptsForUnrecognized) && this.rptsHasMore({ repromptsList })) {
|
|
93
94
|
await this.transcript(call, {
|
|
94
95
|
message: 'Unrecognized',
|
|
95
96
|
keyPress: digits,
|