@onereach/step-voice 4.0.21 → 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.
@@ -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>;
@@ -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
- await this.process.runThread({
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)
@@ -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.processed !== true) {
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.21",
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.24",
21
+ "@onereach/flow-sdk": "^3.1.25",
22
22
  "@swc/cli": "^0.1.57",
23
- "@swc/core": "^1.2.198",
23
+ "@swc/core": "^1.2.204",
24
24
  "@swc/jest": "^0.2.21",
25
- "@types/jest": "^28.1.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.1153.0",
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.3"
36
+ "typescript": "^4.7.4"
37
37
  },
38
38
  "files": [
39
39
  "/dst"