@onereach/step-voice 4.0.14 → 4.0.15
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/step.js +12 -7
- package/dst/voice.d.ts +0 -1
- package/dst/voice.js +1 -17
- package/package.json +1 -1
package/dst/step.js
CHANGED
|
@@ -50,7 +50,6 @@ class ConvStep extends step_1.default {
|
|
|
50
50
|
if (this.state.direct)
|
|
51
51
|
return;
|
|
52
52
|
if (this.event.action === 'cancel') {
|
|
53
|
-
this.state.prevCancelName = this.state.name;
|
|
54
53
|
this.state.name = 'onCancel';
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
@@ -134,14 +133,20 @@ class ConvStep extends step_1.default {
|
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
async onCancel() {
|
|
137
|
-
if (
|
|
138
|
-
this.log.debug('conv.
|
|
139
|
-
this.
|
|
136
|
+
if (this.getExitStepId('cancel')) {
|
|
137
|
+
this.log.debug('conv.cancel exit');
|
|
138
|
+
this.exitStep('cancel');
|
|
140
139
|
}
|
|
141
140
|
else {
|
|
142
|
-
this.
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
const conversationThread = this.state.thread ?? this.thread.id;
|
|
142
|
+
if (conversationThread === this.thread.id) {
|
|
143
|
+
this.log.debug('conv.cancel wait for end', this.conversation);
|
|
144
|
+
this.gotoState({ name: 'waitForEnd', direct: true });
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
this.log.debug('conv.cancel end', this.conversation);
|
|
148
|
+
this.end();
|
|
149
|
+
}
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
152
|
async pause() {
|
package/dst/voice.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ export default class VoiceStep<TIn = unknown, TOut = unknown, TParams = VoiceEve
|
|
|
35
35
|
handleCancel?: boolean;
|
|
36
36
|
}, TOut, TParams> {
|
|
37
37
|
get autoCancel(): boolean | undefined;
|
|
38
|
-
onCancel(): Promise<void>;
|
|
39
38
|
waitForEnd(): Promise<void>;
|
|
40
39
|
sendCommands({ id, type, callback }: IVoiceChannel, commands: TODO[]): Promise<unknown>;
|
|
41
40
|
extractSectionMessages(sections: IPromtpSection[]): string;
|
package/dst/voice.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/strict-boolean-expressions
|
|
2
|
+
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.VoiceStepError = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
@@ -16,22 +16,6 @@ class VoiceStep extends step_1.default {
|
|
|
16
16
|
get autoCancel() {
|
|
17
17
|
return true;
|
|
18
18
|
}
|
|
19
|
-
async onCancel() {
|
|
20
|
-
if (this.data.handleCancel === true) {
|
|
21
|
-
this.exitStep('cancel');
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const conversationThread = this.state.thread ?? this.thread.id;
|
|
25
|
-
if (conversationThread === this.thread.id) {
|
|
26
|
-
this.log.debug('cancel wait for end', this.conversation);
|
|
27
|
-
this.gotoState({ name: 'waitForEnd', direct: true });
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this.log.debug('cancel end', this.conversation);
|
|
31
|
-
this.end();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
19
|
async waitForEnd() {
|
|
36
20
|
this.exitFlow();
|
|
37
21
|
}
|