@onereach/step-voice 6.0.6 → 6.0.8
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.d.ts +0 -1
- package/dst/Global Command.js +7 -18
- package/dst/step.js +1 -4
- package/package.json +1 -1
package/dst/Global Command.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ export default class GlobalCommand extends VoiceStep<Partial<INPUT>, OUTPUT, EVE
|
|
|
37
37
|
exitThread(event: ITypedEvent<EVENT>, type: string, stepExit: string): Promise<void>;
|
|
38
38
|
exitToThread(): void;
|
|
39
39
|
buildGrammar(call: IVoiceCall, choices: TODO[]): Promise<any>;
|
|
40
|
-
exitFlow(): unknown;
|
|
41
40
|
sleepUntilHangup(): void;
|
|
42
41
|
}
|
|
43
42
|
export {};
|
package/dst/Global Command.js
CHANGED
|
@@ -72,17 +72,15 @@ class GlobalCommand extends voice_1.default {
|
|
|
72
72
|
await this.initGrammar();
|
|
73
73
|
});
|
|
74
74
|
const dataThread = this.process.getThread(this.dataThreadId);
|
|
75
|
-
if (this.dataThreadId !== types_1.MAIN_THREAD_ID && dataThread != null
|
|
75
|
+
if (this.dataThreadId !== types_1.MAIN_THREAD_ID && dataThread != null) {
|
|
76
76
|
this.triggers.hook({ name: "ending" /* ACTION.ending */, thread: this.dataThreadId, sync: true }, async () => {
|
|
77
77
|
delete this.waits['@ending'];
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
}
|
|
78
|
+
this.log.debug('sleep data thread', { thread: this.dataThreadId });
|
|
79
|
+
dataThread.gotoState({
|
|
80
|
+
direct: true,
|
|
81
|
+
step: this.currentStepId,
|
|
82
|
+
name: this.sleepUntilHangup.name
|
|
83
|
+
});
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
86
|
this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: types_1.MAIN_THREAD_ID, sync: true }, async () => {
|
|
@@ -92,7 +90,6 @@ class GlobalCommand extends voice_1.default {
|
|
|
92
90
|
this.end();
|
|
93
91
|
});
|
|
94
92
|
this.triggers.local(`in/voice/${call.id}`, async (event) => {
|
|
95
|
-
event.processed = undefined;
|
|
96
93
|
switch (event.params.type) {
|
|
97
94
|
case 'hangup': {
|
|
98
95
|
await this.hangup(call);
|
|
@@ -155,15 +152,12 @@ class GlobalCommand extends voice_1.default {
|
|
|
155
152
|
this.log.error('gc.error', event.params.error);
|
|
156
153
|
// TODO throw it?
|
|
157
154
|
}
|
|
158
|
-
this.event.processed = true;
|
|
159
155
|
break;
|
|
160
156
|
}
|
|
161
157
|
case 'cancel': {
|
|
162
|
-
this.event.processed = true;
|
|
163
158
|
return this.handleCancel();
|
|
164
159
|
}
|
|
165
160
|
case 'background': {
|
|
166
|
-
this.event.processed = true;
|
|
167
161
|
this.thread.background = event.params.background ?? false;
|
|
168
162
|
await this.handleHeartbeat(call);
|
|
169
163
|
break;
|
|
@@ -243,7 +237,6 @@ class GlobalCommand extends voice_1.default {
|
|
|
243
237
|
step: this.currentStepId
|
|
244
238
|
}
|
|
245
239
|
});
|
|
246
|
-
event.processed = true;
|
|
247
240
|
}
|
|
248
241
|
exitToThread() {
|
|
249
242
|
this.thread.exitStep(this.state.exitStep, this.state.result);
|
|
@@ -256,10 +249,6 @@ class GlobalCommand extends voice_1.default {
|
|
|
256
249
|
asr: asr.getSettings(call.asr)
|
|
257
250
|
};
|
|
258
251
|
}
|
|
259
|
-
exitFlow() {
|
|
260
|
-
this.event.processed = false;
|
|
261
|
-
return super.exitFlow();
|
|
262
|
-
}
|
|
263
252
|
sleepUntilHangup() {
|
|
264
253
|
this.triggers.local(LocalEvents.hangup, () => {
|
|
265
254
|
this.end();
|
package/dst/step.js
CHANGED
|
@@ -157,10 +157,7 @@ class ConvStep extends step_1.default {
|
|
|
157
157
|
async startConversation(data, { thread: _thread } = {}) {
|
|
158
158
|
this.convDataCache = {
|
|
159
159
|
...data,
|
|
160
|
-
_conv: data._conv ?? {
|
|
161
|
-
glb: [],
|
|
162
|
-
lcl: []
|
|
163
|
-
}
|
|
160
|
+
_conv: data._conv ?? {}
|
|
164
161
|
};
|
|
165
162
|
await this.updateData();
|
|
166
163
|
// this.state.thread = this.dataThreadId
|