@onereach/step-voice 4.0.17 → 4.0.20
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 +4 -4
- package/dst/Global Command.js +3 -2
- package/dst/Hangup.js +2 -0
- package/dst/Initiate Call.d.ts +2 -2
- package/dst/step.d.ts +1 -1
- package/dst/step.js +4 -6
- package/package.json +4 -4
package/dst/Choice.js
CHANGED
|
@@ -106,12 +106,12 @@ class Choice extends voice_1.default {
|
|
|
106
106
|
case 'digits': {
|
|
107
107
|
const params = event.params;
|
|
108
108
|
const digit = params.digit ?? params.digits;
|
|
109
|
-
const exitId = params.exitId
|
|
109
|
+
const exitId = params.exitId;
|
|
110
110
|
// On bargeIn, we should stop playback
|
|
111
111
|
if (exitExists(exitId)) {
|
|
112
112
|
await this.transcript(channel, {
|
|
113
113
|
keyPress: digit,
|
|
114
|
-
message: lodash_1.default.replace(this.getExitStepLabel(exitId), /^(\d+\. )?(~ )?/, ''),
|
|
114
|
+
message: lodash_1.default.replace(this.getExitStepLabel(exitId) ?? '', /^(\d+\. )?(~ )?/, ''),
|
|
115
115
|
reportingSettingsKey,
|
|
116
116
|
action: 'Call DTMF',
|
|
117
117
|
actionFromBot: false
|
|
@@ -149,7 +149,7 @@ class Choice extends voice_1.default {
|
|
|
149
149
|
}
|
|
150
150
|
case 'recognition': {
|
|
151
151
|
const params = event.params;
|
|
152
|
-
const exitId = params.exitId
|
|
152
|
+
const exitId = params.exitId;
|
|
153
153
|
const phrases = params.phrases;
|
|
154
154
|
if (lodash_1.default.isEmpty(phrases)) {
|
|
155
155
|
return this.exitStep('unrecognized', {});
|
|
@@ -161,7 +161,7 @@ class Choice extends voice_1.default {
|
|
|
161
161
|
// On bargeIn, we should stop playback
|
|
162
162
|
if (exitExists(exitId)) {
|
|
163
163
|
await this.transcript(channel, {
|
|
164
|
-
message: lodash_1.default.replace(this.getExitStepLabel(exitId), /^(\d+\. )?(~ )?/, ''),
|
|
164
|
+
message: lodash_1.default.replace(this.getExitStepLabel(exitId) ?? '', /^(\d+\. )?(~ )?/, ''),
|
|
165
165
|
voiceProcessResult,
|
|
166
166
|
reportingSettingsKey,
|
|
167
167
|
action: 'Call Recognition',
|
package/dst/Global Command.js
CHANGED
|
@@ -83,6 +83,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
83
83
|
switch (event.params.type) {
|
|
84
84
|
case 'hangup': {
|
|
85
85
|
await this.hangup(channel);
|
|
86
|
+
await this.sendEventToStep({ toGlobal: false, event: { ...this.event, processed: undefined, action: 'local' } });
|
|
86
87
|
return this.end();
|
|
87
88
|
}
|
|
88
89
|
case 'avm-detected':
|
|
@@ -96,7 +97,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
96
97
|
await this.transcript(channel, {
|
|
97
98
|
previousTranscriptId: channel.lastTranscriptId,
|
|
98
99
|
keyPress: params.digit,
|
|
99
|
-
message: lodash_1.default.replace(this.getExitStepLabel(exitId), /^(\d+\. )?(~ )?/, ''),
|
|
100
|
+
message: lodash_1.default.replace(this.getExitStepLabel(exitId) ?? '', /^(\d+\. )?(~ )?/, ''),
|
|
100
101
|
action: 'Call DTMF',
|
|
101
102
|
reportingSettingsKey: 'transcript',
|
|
102
103
|
actionFromBot: false
|
|
@@ -115,7 +116,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
115
116
|
.value();
|
|
116
117
|
await this.transcript(channel, {
|
|
117
118
|
previousTranscriptId: channel.lastTranscriptId,
|
|
118
|
-
message: lodash_1.default.replace(this.getExitStepLabel(exitId), /^(\d+\. )?(~ )?/, ''),
|
|
119
|
+
message: lodash_1.default.replace(this.getExitStepLabel(exitId) ?? '', /^(\d+\. )?(~ )?/, ''),
|
|
119
120
|
action: 'Call Recognition',
|
|
120
121
|
voiceProcessResult,
|
|
121
122
|
reportingSettingsKey: 'transcript',
|
package/dst/Hangup.js
CHANGED
package/dst/Initiate Call.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import VoiceStep, { CallStartEvent, TODO } from './voice';
|
|
2
2
|
interface INPUT {
|
|
3
3
|
channelId?: string;
|
|
4
|
-
sessionTimeout?: number;
|
|
4
|
+
sessionTimeout?: number | string;
|
|
5
5
|
asr: TODO;
|
|
6
6
|
tts: TODO;
|
|
7
7
|
from: string;
|
|
@@ -9,7 +9,7 @@ interface INPUT {
|
|
|
9
9
|
sipHost?: string;
|
|
10
10
|
sipUser?: string;
|
|
11
11
|
sipPassword?: string;
|
|
12
|
-
timeout?: number;
|
|
12
|
+
timeout?: number | string;
|
|
13
13
|
headers?: Array<{
|
|
14
14
|
name: string;
|
|
15
15
|
value: string;
|
package/dst/step.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default class ConvStep<TData = unknown, TIn = unknown, TOut = unknown, TP
|
|
|
19
19
|
runBefore(): Promise<void>;
|
|
20
20
|
runAfter(): Promise<void>;
|
|
21
21
|
hasActiveGlobal(): Promise<boolean>;
|
|
22
|
-
|
|
22
|
+
setLocalTriggers(): Promise<void>;
|
|
23
23
|
waitForConversation(): Promise<void>;
|
|
24
24
|
onSkipEvent(): Promise<void>;
|
|
25
25
|
cancel(): Promise<void>;
|
package/dst/step.js
CHANGED
|
@@ -70,9 +70,7 @@ class ConvStep extends step_1.default {
|
|
|
70
70
|
if (this.isGlobal && this.event.action === 'global') {
|
|
71
71
|
return; // it was redirected from (1)
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
this.triggers.config({ params: { type: 'local' } });
|
|
75
|
-
}
|
|
73
|
+
await this.setLocalTriggers();
|
|
76
74
|
}
|
|
77
75
|
async runAfter() {
|
|
78
76
|
if (!await this.hasConversation())
|
|
@@ -91,9 +89,9 @@ class ConvStep extends step_1.default {
|
|
|
91
89
|
const globalLength = (await this._getConversation())?.glb?.length ?? 0;
|
|
92
90
|
return globalLength > 0;
|
|
93
91
|
}
|
|
94
|
-
async
|
|
95
|
-
if (!this.isGlobal &&
|
|
96
|
-
this.triggers.config({
|
|
92
|
+
async setLocalTriggers() {
|
|
93
|
+
if (!this.isGlobal && await this.hasActiveGlobal()) {
|
|
94
|
+
this.triggers.config({ target: 'session' });
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
async waitForConversation() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.20",
|
|
4
4
|
"author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Roman Zolotarov",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"uuid": "^8.3.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@onereach/flow-sdk": "^3.1.
|
|
21
|
+
"@onereach/flow-sdk": "^3.1.15",
|
|
22
22
|
"@swc/cli": "^0.1.57",
|
|
23
|
-
"@swc/core": "^1.2.
|
|
23
|
+
"@swc/core": "^1.2.198",
|
|
24
24
|
"@swc/jest": "^0.2.21",
|
|
25
25
|
"@types/jest": "^28.1.1",
|
|
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.
|
|
29
|
+
"aws-sdk": "^2.1153.0",
|
|
30
30
|
"babel-runtime": "^6.26.0",
|
|
31
31
|
"docdash": "^1.2.0",
|
|
32
32
|
"husky": "^8.0.1",
|