@onereach/step-voice 5.0.9-fixsubflow.12 → 5.0.9-fixsubflow.13

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 CHANGED
@@ -232,7 +232,7 @@ class Choice extends voice_1.default {
232
232
  return await this.waitConvEnd();
233
233
  }
234
234
  case 'cancel': {
235
- return this.data.handleCancel === true && this.exitStep('cancel');
235
+ return this.handleCancel();
236
236
  }
237
237
  case 'error':
238
238
  return this.throwError(event.params.error);
@@ -178,7 +178,7 @@ class CustomVoiceInput extends voice_1.default {
178
178
  return await this.waitConvEnd();
179
179
  }
180
180
  case 'cancel': {
181
- return this.data.handleCancel === true && this.exitStep('cancel');
181
+ return this.handleCancel();
182
182
  }
183
183
  case 'error':
184
184
  return this.throwError(event.params.error);
@@ -136,8 +136,7 @@ class GlobalCommand extends voice_1.default {
136
136
  }
137
137
  case 'cancel': {
138
138
  this.event.processed = true;
139
- this.end();
140
- break;
139
+ return this.handleCancel();
141
140
  }
142
141
  case 'background': {
143
142
  this.event.processed = true;
package/dst/Hangup.js CHANGED
@@ -13,7 +13,7 @@ class Hangup extends voice_1.default {
13
13
  case 'error':
14
14
  return this.throwError(event.params.error);
15
15
  case 'cancel': {
16
- return this.data.handleCancel === true && this.exitStep('cancel');
16
+ return this.handleCancel();
17
17
  }
18
18
  default:
19
19
  return this.exitFlow();
@@ -149,7 +149,7 @@ class KeypadInput extends voice_1.default {
149
149
  return await this.waitConvEnd();
150
150
  }
151
151
  case 'cancel': {
152
- return this.data.handleCancel === true && this.exitStep('cancel');
152
+ return this.handleCancel();
153
153
  }
154
154
  case 'error':
155
155
  return this.throwError(event.params.error);
@@ -19,7 +19,7 @@ class SayMessage extends voice_1.default {
19
19
  case 'error':
20
20
  return this.throwError(event.params.error);
21
21
  case 'cancel': {
22
- return this.data.handleCancel === true && this.exitStep('cancel');
22
+ return this.handleCancel();
23
23
  }
24
24
  default:
25
25
  return this.exitFlow();
package/dst/voice.d.ts CHANGED
@@ -47,6 +47,7 @@ export default class VoiceStep<TIn = unknown, TOut = unknown, TParams extends Vo
47
47
  runBefore(): Promise<void>;
48
48
  sendCommands({ id, type, callback }: IVoiceCall, commands: TODO[]): Promise<void>;
49
49
  handleHeartbeat(call: IVoiceCall): Promise<void>;
50
+ handleCancel(): void;
50
51
  extractSectionMessages(sections: IPromtpSection[]): string;
51
52
  extractSectionFiles(sections: IPromtpSection[]): Array<{
52
53
  fileUrl: string;
package/dst/voice.js CHANGED
@@ -65,6 +65,12 @@ class VoiceStep extends step_1.default {
65
65
  await this.updateData();
66
66
  }
67
67
  }
68
+ handleCancel() {
69
+ if (this.data.handleCancel === true)
70
+ this.exitStep('cancel');
71
+ else
72
+ this.end();
73
+ }
68
74
  extractSectionMessages(sections) {
69
75
  return lodash_1.default.chain(sections)
70
76
  .filter(s => Boolean(s.text))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "5.0.9-fixsubflow.12",
3
+ "version": "5.0.9-fixsubflow.13",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",