@onereach/step-voice 4.0.33 → 4.0.34
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/Global Command.js +11 -8
- package/package.json +3 -3
package/dst/Global Command.js
CHANGED
|
@@ -55,9 +55,6 @@ class GlobalCommand extends voice_1.default {
|
|
|
55
55
|
}
|
|
56
56
|
async globThread() {
|
|
57
57
|
const channel = await this.fetchData();
|
|
58
|
-
const findExit = (exitId) => {
|
|
59
|
-
return lodash_1.default.find(this.step.exits, (exit) => exitId === exit.id);
|
|
60
|
-
};
|
|
61
58
|
this.triggers.once(`in/voice/${channel.id}/event`, async (event) => {
|
|
62
59
|
event.processed = undefined;
|
|
63
60
|
switch (event.params.type) {
|
|
@@ -72,8 +69,8 @@ class GlobalCommand extends voice_1.default {
|
|
|
72
69
|
case 'digit':
|
|
73
70
|
case 'digits': {
|
|
74
71
|
const params = event.params;
|
|
75
|
-
const exitId = params.exitId
|
|
76
|
-
if (
|
|
72
|
+
const exitId = params.exitId;
|
|
73
|
+
if (exitId && this.getExitStepId(exitId, false)) {
|
|
77
74
|
await this.transcript(channel, {
|
|
78
75
|
previousTranscriptId: channel.lastTranscriptId,
|
|
79
76
|
keyPress: params.digit,
|
|
@@ -84,12 +81,15 @@ class GlobalCommand extends voice_1.default {
|
|
|
84
81
|
});
|
|
85
82
|
return await this.exitThread(event, 'digit', exitId);
|
|
86
83
|
}
|
|
84
|
+
else {
|
|
85
|
+
this.log.debug('exitId missmatch', { exitId, exits: this.step.exits });
|
|
86
|
+
}
|
|
87
87
|
return {};
|
|
88
88
|
}
|
|
89
89
|
case 'recognition': {
|
|
90
90
|
const params = event.params;
|
|
91
|
-
const exitId = params.exitId
|
|
92
|
-
if (
|
|
91
|
+
const exitId = params.exitId;
|
|
92
|
+
if (exitId && this.getExitStepId(exitId, false)) {
|
|
93
93
|
const voiceProcessResult = lodash_1.default.chain(params.phrases)
|
|
94
94
|
.map((p) => p.lexical)
|
|
95
95
|
.join(' | ')
|
|
@@ -104,6 +104,9 @@ class GlobalCommand extends voice_1.default {
|
|
|
104
104
|
});
|
|
105
105
|
return await this.exitThread(event, 'voice', exitId);
|
|
106
106
|
}
|
|
107
|
+
else {
|
|
108
|
+
this.log.debug('exitId missmatch', { exitId, exits: this.step.exits });
|
|
109
|
+
}
|
|
107
110
|
return {};
|
|
108
111
|
}
|
|
109
112
|
case 'error':
|
|
@@ -138,7 +141,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
async exitThread(event, type, stepExit) {
|
|
141
|
-
|
|
144
|
+
this.log.debug('exitThread', type, stepExit);
|
|
142
145
|
const params = event.params;
|
|
143
146
|
const data = { type };
|
|
144
147
|
if (!lodash_1.default.isEmpty(params.tags)) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "4.0.34",
|
|
4
|
+
"pkg_version": "4",
|
|
5
|
+
"dep_version": "^$[__package.pkg_version]",
|
|
6
6
|
"author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
|
|
7
7
|
"contributors": [
|
|
8
8
|
"Roman Zolotarov",
|