@onereach/step-voice 1.2202.15 → 1.2202.19
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.js +9 -8
- package/dst/Initiate Call.js +1 -1
- package/dst/Wait For Call.js +1 -1
- package/dst/voice.js +2 -3
- package/package.json +6 -6
package/dst/Global Command.js
CHANGED
|
@@ -42,14 +42,11 @@ class GlobalCommand extends voice_1.default {
|
|
|
42
42
|
]);
|
|
43
43
|
await this.updateData();
|
|
44
44
|
this.process.runThread({
|
|
45
|
-
id: `G:${this.
|
|
45
|
+
id: `G:${this.dataThreadId}`,
|
|
46
46
|
state: {
|
|
47
47
|
name: 'globThread',
|
|
48
48
|
step: this.step.id,
|
|
49
|
-
thread: this.
|
|
50
|
-
},
|
|
51
|
-
local: {
|
|
52
|
-
background: true
|
|
49
|
+
thread: this.dataThreadId
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
52
|
this.exitStep('no commands');
|
|
@@ -64,7 +61,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
64
61
|
switch (event.params.type) {
|
|
65
62
|
case 'hangup': {
|
|
66
63
|
return await this.hangup(channel, event).finally(async () => {
|
|
67
|
-
await this.sendEventToStep({ event: { ...event, processed: undefined, action: 'local' },
|
|
64
|
+
await this.sendEventToStep({ event: { ...event, processed: undefined, action: 'local' }, toGlobal: false });
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
67
|
case 'avm-detected':
|
|
@@ -180,14 +177,14 @@ class GlobalCommand extends voice_1.default {
|
|
|
180
177
|
name: 'exitToThread',
|
|
181
178
|
result: {
|
|
182
179
|
conversation: this.conversation,
|
|
183
|
-
conversationThreadId: this.
|
|
180
|
+
conversationThreadId: this.dataThreadId
|
|
184
181
|
},
|
|
185
182
|
exitStep: this.getExitStepId(stepExit),
|
|
186
183
|
step: this.currentStepId
|
|
187
184
|
}
|
|
188
185
|
});
|
|
189
186
|
// this is required to mark event as handled
|
|
190
|
-
this.gotoState(this.state, { name: 'exiting' })
|
|
187
|
+
// this.gotoState(this.state, { name: 'exiting' })
|
|
191
188
|
}
|
|
192
189
|
async exitToThread() {
|
|
193
190
|
this.thread.jumpTo(this.state.exitStep, this.state.result);
|
|
@@ -200,5 +197,9 @@ class GlobalCommand extends voice_1.default {
|
|
|
200
197
|
asr: asr.getSettings(channel.asr)
|
|
201
198
|
};
|
|
202
199
|
}
|
|
200
|
+
exitFlow() {
|
|
201
|
+
this.event.processed = false;
|
|
202
|
+
return super.exitFlow();
|
|
203
|
+
}
|
|
203
204
|
}
|
|
204
205
|
exports.default = GlobalCommand;
|
package/dst/Initiate Call.js
CHANGED
|
@@ -120,7 +120,7 @@ class InitiateCall extends voice_1.default {
|
|
|
120
120
|
actionFromBot: true
|
|
121
121
|
});
|
|
122
122
|
await this.startConversation(channel, {
|
|
123
|
-
events: [`in/voice/${channel.id}/event`]
|
|
123
|
+
events: { [`in/voice/${channel.id}/event`]: {} }
|
|
124
124
|
});
|
|
125
125
|
await this.sendCommands(channel, [
|
|
126
126
|
...isAMD
|
package/dst/Wait For Call.js
CHANGED
|
@@ -41,7 +41,7 @@ class WaitForCall extends voice_1.default {
|
|
|
41
41
|
actionFromBot: false
|
|
42
42
|
});
|
|
43
43
|
await this.startConversation(channel, {
|
|
44
|
-
events: [`in/voice/${channel.id}/event`]
|
|
44
|
+
events: { [`in/voice/${channel.id}/event`]: {} }
|
|
45
45
|
});
|
|
46
46
|
return this.exitStep('trigger');
|
|
47
47
|
}
|
package/dst/voice.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.VoiceStepError = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
|
|
7
|
-
const types_1 = require("@onereach/flow-sdk/dst/types");
|
|
8
7
|
const uuid_1 = require("uuid");
|
|
9
8
|
const step_1 = (0, tslib_1.__importDefault)(require("@onereach/step-conversation/dst/step"));
|
|
10
9
|
const base_1 = (0, tslib_1.__importDefault)(require("@onereach/flow-sdk/dst/errors/base"));
|
|
@@ -15,7 +14,7 @@ class VoiceStep extends step_1.default {
|
|
|
15
14
|
async sendCommands({ id, type, callback }, commands) {
|
|
16
15
|
if (lodash_1.default.isEmpty(commands))
|
|
17
16
|
return;
|
|
18
|
-
return this.thread.eventManager.emit({
|
|
17
|
+
return await this.thread.eventManager.emit({
|
|
19
18
|
target: 'provider',
|
|
20
19
|
name: `out/voice/${type}`,
|
|
21
20
|
params: {
|
|
@@ -25,7 +24,7 @@ class VoiceStep extends step_1.default {
|
|
|
25
24
|
reporting: this.session.getSessionRef()
|
|
26
25
|
}, {
|
|
27
26
|
target: callback,
|
|
28
|
-
invocationType:
|
|
27
|
+
invocationType: 'async',
|
|
29
28
|
timeout: 5000
|
|
30
29
|
});
|
|
31
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "1.2202.
|
|
3
|
+
"version": "1.2202.19",
|
|
4
4
|
"author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Roman Zolotarov",
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"npm": ">= 6.0.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@onereach/step-conversation": "^1.0.
|
|
16
|
+
"@onereach/step-conversation": "^1.0.16",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
18
|
"uuid": "^8.3.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@onereach/flow-sdk": "^2.7.
|
|
21
|
+
"@onereach/flow-sdk": "^2.7.82",
|
|
22
22
|
"@swc/cli": "^0.1.55",
|
|
23
|
-
"@swc/core": "^1.2.
|
|
23
|
+
"@swc/core": "^1.2.143",
|
|
24
24
|
"@swc/jest": "^0.2.17",
|
|
25
25
|
"@types/jest": "^27.4.0",
|
|
26
26
|
"@types/lodash": "^4.14.178",
|
|
27
27
|
"@types/uuid": "^8.3.4",
|
|
28
|
-
"aws-sdk": "^2.
|
|
28
|
+
"aws-sdk": "^2.1078.0",
|
|
29
29
|
"babel-runtime": "^6.26.0",
|
|
30
30
|
"docdash": "^1.2.0",
|
|
31
31
|
"husky": "^7.0.4",
|
|
@@ -71,4 +71,4 @@
|
|
|
71
71
|
"node_modules"
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
}
|