@onereach/step-voice 4.0.19 → 4.0.22
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.js +1 -2
- package/dst/Global Command.d.ts +1 -0
- package/dst/Global Command.js +15 -12
- package/dst/step.js +3 -2
- package/package.json +7 -7
package/dst/Choice.js
CHANGED
|
@@ -171,8 +171,7 @@ class Choice extends voice_1.default {
|
|
|
171
171
|
return this.exitStep(exitId, this.exitChoiceData('voice', params));
|
|
172
172
|
}
|
|
173
173
|
else if (this.rptsHasMore({ repromptsList }) &&
|
|
174
|
-
usePromptsTriggers
|
|
175
|
-
isRepromptTrigger(phrases, this.data.promptsTriggers)) {
|
|
174
|
+
(usePromptsTriggers ? isRepromptTrigger(phrases, this.data.promptsTriggers) : true)) {
|
|
176
175
|
await this.transcript(channel, {
|
|
177
176
|
message: 'Unrecognized',
|
|
178
177
|
voiceProcessResult,
|
package/dst/Global Command.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export default class GlobalCommand extends VoiceStep<Partial<INPUT>, OUTPUT, EVE
|
|
|
29
29
|
get isGlobal(): boolean;
|
|
30
30
|
get autoCancel(): boolean | undefined;
|
|
31
31
|
runStep(): Promise<void>;
|
|
32
|
+
initThread(): Promise<void>;
|
|
32
33
|
globThread(): Promise<void>;
|
|
33
34
|
hangup(channel: IVoiceChannel): Promise<unknown>;
|
|
34
35
|
exitThread(event: ITypedEvent<EVENT>, type: string, stepExit: string): Promise<void>;
|
package/dst/Global Command.js
CHANGED
|
@@ -13,6 +13,20 @@ class GlobalCommand extends voice_1.default {
|
|
|
13
13
|
return undefined;
|
|
14
14
|
}
|
|
15
15
|
async runStep() {
|
|
16
|
+
await this.process.runThread({
|
|
17
|
+
id: `G:${this.dataThreadId}`,
|
|
18
|
+
local: {
|
|
19
|
+
background: true
|
|
20
|
+
},
|
|
21
|
+
state: {
|
|
22
|
+
name: 'initThread',
|
|
23
|
+
step: this.step.id,
|
|
24
|
+
thread: this.dataThreadId
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
this.exitStep('no commands');
|
|
28
|
+
}
|
|
29
|
+
async initThread() {
|
|
16
30
|
const channel = await this.fetchData();
|
|
17
31
|
// if (recordCall || _.includes(['bot', 'both'], processHangUp)) {
|
|
18
32
|
// // prevent delete of session by "End" step
|
|
@@ -45,18 +59,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
45
59
|
}
|
|
46
60
|
]);
|
|
47
61
|
await this.updateData();
|
|
48
|
-
|
|
49
|
-
id: `G:${this.dataThreadId}`,
|
|
50
|
-
local: {
|
|
51
|
-
background: true
|
|
52
|
-
},
|
|
53
|
-
state: {
|
|
54
|
-
name: 'globThread',
|
|
55
|
-
step: this.step.id,
|
|
56
|
-
thread: this.dataThreadId
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
this.exitStep('no commands');
|
|
62
|
+
this.gotoState({ ...this.state, name: 'globThread' });
|
|
60
63
|
}
|
|
61
64
|
async globThread() {
|
|
62
65
|
const channel = await this.fetchData();
|
package/dst/step.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const step_1 = tslib_1.__importDefault(require("@onereach/flow-sdk/dst/step"));
|
|
6
|
+
const event_1 = tslib_1.__importDefault(require("@onereach/flow-sdk/dst/event"));
|
|
6
7
|
class ConvStep extends step_1.default {
|
|
7
8
|
get conversation() {
|
|
8
9
|
if (this.data.conversation == null)
|
|
@@ -40,13 +41,13 @@ class ConvStep extends step_1.default {
|
|
|
40
41
|
return (await this._fetchData())?._conv != null;
|
|
41
42
|
}
|
|
42
43
|
async runBefore() {
|
|
43
|
-
this.log.debug('conv.runBefore', { state: this.state, conv: this.conversation });
|
|
44
44
|
await super.runBefore();
|
|
45
45
|
// ensure cache is reset between step runs, just in case
|
|
46
46
|
this._clearCache();
|
|
47
47
|
this.triggers.local('_conv');
|
|
48
48
|
if (!await this.hasConversation())
|
|
49
49
|
return;
|
|
50
|
+
this.log.debug('conv.runBefore', { state: this.state, conv: this.convDataCache?._conv });
|
|
50
51
|
if (this.state.direct)
|
|
51
52
|
return;
|
|
52
53
|
if (this.event.action === 'cancel') {
|
|
@@ -80,7 +81,7 @@ class ConvStep extends step_1.default {
|
|
|
80
81
|
await this.sendEventToStep({ toGlobal: this.isGlobal, action: 'activate' });
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
if (this.isGlobal && this.event
|
|
84
|
+
if (this.isGlobal && !event_1.default.isProcessed(this.event)) {
|
|
84
85
|
await this.sendEventToStep({ toGlobal: false, event: { ...this.event, processed: undefined, action: 'local' } });
|
|
85
86
|
}
|
|
86
87
|
await super.runAfter();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.22",
|
|
4
4
|
"author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Roman Zolotarov",
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
"uuid": "^8.3.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@onereach/flow-sdk": "^3.1.
|
|
21
|
+
"@onereach/flow-sdk": "^3.1.25",
|
|
22
22
|
"@swc/cli": "^0.1.57",
|
|
23
|
-
"@swc/core": "^1.2.
|
|
23
|
+
"@swc/core": "^1.2.204",
|
|
24
24
|
"@swc/jest": "^0.2.21",
|
|
25
|
-
"@types/jest": "^28.1.
|
|
25
|
+
"@types/jest": "^28.1.3",
|
|
26
26
|
"@types/lodash": "^4.14.182",
|
|
27
27
|
"@types/timestring": "^6.0.2",
|
|
28
28
|
"@types/uuid": "^8.3.4",
|
|
29
|
-
"aws-sdk": "^2.
|
|
29
|
+
"aws-sdk": "^2.1159.0",
|
|
30
30
|
"babel-runtime": "^6.26.0",
|
|
31
31
|
"docdash": "^1.2.0",
|
|
32
32
|
"husky": "^8.0.1",
|
|
33
33
|
"jest": "^28.1.1",
|
|
34
34
|
"pinst": "^3.0.0",
|
|
35
35
|
"ts-standard": "^11.0.0",
|
|
36
|
-
"typescript": "^4.7.
|
|
36
|
+
"typescript": "^4.7.4"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"/dst"
|
|
@@ -73,4 +73,4 @@
|
|
|
73
73
|
"node_modules"
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
}
|