@onereach/step-voice 4.0.30 → 4.0.33
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 +1 -15
- package/dst/Initiate Call.d.ts +0 -1
- package/dst/Initiate Call.js +1 -5
- package/dst/Wait For Call.js +1 -7
- package/dst/step.js +1 -2
- package/dst/voice.d.ts +0 -2
- package/dst/voice.js +0 -6
- package/package.json +4 -2
package/dst/Global Command.js
CHANGED
|
@@ -56,22 +56,8 @@ class GlobalCommand extends voice_1.default {
|
|
|
56
56
|
async globThread() {
|
|
57
57
|
const channel = await this.fetchData();
|
|
58
58
|
const findExit = (exitId) => {
|
|
59
|
-
return lodash_1.default.find(this.step.exits, (exit) => exitId === exit.
|
|
59
|
+
return lodash_1.default.find(this.step.exits, (exit) => exitId === exit.id);
|
|
60
60
|
};
|
|
61
|
-
// if (channel.autoHangup) {
|
|
62
|
-
// this.triggers.local('thread/end/main', async () => {
|
|
63
|
-
// delete this.thread.waits['thread/end/main']
|
|
64
|
-
// const channel = await this.fetchData()
|
|
65
|
-
// if (!channel.hangup) {
|
|
66
|
-
// channel.autoHangup = false
|
|
67
|
-
// await this.updateData()
|
|
68
|
-
// this.local.background = undefined
|
|
69
|
-
// await this.sendCommands(channel, [{ name: 'hangup' }])
|
|
70
|
-
// void this.process.main.enqueueAndRun({ name: 'ending' })
|
|
71
|
-
// this.exitFlow()
|
|
72
|
-
// }
|
|
73
|
-
// })
|
|
74
|
-
// }
|
|
75
61
|
this.triggers.once(`in/voice/${channel.id}/event`, async (event) => {
|
|
76
62
|
event.processed = undefined;
|
|
77
63
|
switch (event.params.type) {
|
package/dst/Initiate Call.d.ts
CHANGED
package/dst/Initiate Call.js
CHANGED
|
@@ -36,7 +36,7 @@ class InitiateCall extends voice_1.default {
|
|
|
36
36
|
this.gotoState('waitForCall');
|
|
37
37
|
}
|
|
38
38
|
async waitForCall() {
|
|
39
|
-
const {
|
|
39
|
+
const { asr, tts, from: botNumber, endUserNumber, sipHost, sipUser, sipPassword, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD } = this.data;
|
|
40
40
|
const { id: channelId } = await this.fetchData();
|
|
41
41
|
this.triggers.once(`in/voice/${channelId}/event`, async (event) => {
|
|
42
42
|
switch (event.params.type) {
|
|
@@ -57,7 +57,6 @@ class InitiateCall extends voice_1.default {
|
|
|
57
57
|
const channel = {
|
|
58
58
|
headers: event.params.headers,
|
|
59
59
|
...event.params.channel,
|
|
60
|
-
autoHangup,
|
|
61
60
|
asr: asr.getSettings(),
|
|
62
61
|
tts: tts.getVoice(),
|
|
63
62
|
botNumber: event.params.channel.to ?? 'unknown',
|
|
@@ -91,9 +90,6 @@ class InitiateCall extends voice_1.default {
|
|
|
91
90
|
}]
|
|
92
91
|
: []
|
|
93
92
|
]);
|
|
94
|
-
if (this.data.autoHangup) {
|
|
95
|
-
this.once('ending', this.autoHangup);
|
|
96
|
-
}
|
|
97
93
|
return this.exitStep('success');
|
|
98
94
|
}
|
|
99
95
|
case 'error': {
|
package/dst/Wait For Call.js
CHANGED
|
@@ -20,18 +20,12 @@ class WaitForCall extends voice_1.default {
|
|
|
20
20
|
lodash_1.default.forEach(selectedNumbers, number => {
|
|
21
21
|
this.triggers.on(`in/voice/${number.value}/call`, this.onCall);
|
|
22
22
|
});
|
|
23
|
-
if (this.data.autoHangup) {
|
|
24
|
-
this.triggers.otherwise(() => {
|
|
25
|
-
this.once('ending', this.autoHangup);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
23
|
}
|
|
29
24
|
async onCall(event) {
|
|
30
|
-
const {
|
|
25
|
+
const { asr, tts, endOfInputTimeout } = this.data;
|
|
31
26
|
const channel = {
|
|
32
27
|
headers: event.params.headers,
|
|
33
28
|
...event.params.channel,
|
|
34
|
-
autoHangup,
|
|
35
29
|
asr: asr.getSettings(),
|
|
36
30
|
tts: tts.getVoice(),
|
|
37
31
|
botNumber: event.params.channel.to ?? 'unknown',
|
package/dst/step.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
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"));
|
|
7
6
|
class ConvStep extends step_1.default {
|
|
8
7
|
get conversation() {
|
|
9
8
|
if (this.data.conversation == null)
|
|
@@ -85,7 +84,7 @@ class ConvStep extends step_1.default {
|
|
|
85
84
|
// await this.sendEventToStep({ toGlobal: this.isGlobal, action: 'onAwake' })
|
|
86
85
|
// }
|
|
87
86
|
}
|
|
88
|
-
if (this.isGlobal && !
|
|
87
|
+
if (this.isGlobal && !this.event.processed) {
|
|
89
88
|
await this.sendEventToStep({ toGlobal: false, event: { ...this.event, processed: undefined, action: 'local' } });
|
|
90
89
|
}
|
|
91
90
|
await super.runAfter();
|
package/dst/voice.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import BasicError from '@onereach/flow-sdk/dst/errors/base';
|
|
|
4
4
|
export declare type TODO = any;
|
|
5
5
|
export interface IVoiceChannel {
|
|
6
6
|
id: string;
|
|
7
|
-
autoHangup?: boolean;
|
|
8
7
|
hangup: boolean;
|
|
9
8
|
endUserNumber: string;
|
|
10
9
|
botNumber: string;
|
|
@@ -46,7 +45,6 @@ export default class VoiceStep<TIn = unknown, TOut = unknown, TParams = VoiceEve
|
|
|
46
45
|
message: string;
|
|
47
46
|
}): never;
|
|
48
47
|
handleHangup(channel: IVoiceChannel): Promise<void>;
|
|
49
|
-
autoHangup(): Promise<void>;
|
|
50
48
|
buildSections({ sections, textType, ttsSettings, allowKeypadBargeIn }: TODO): TODO;
|
|
51
49
|
buildReprompts({ prompts, allowKeypadBargeIn }: TODO): TODO;
|
|
52
50
|
buildChoices({ choices }: TODO): TODO;
|
package/dst/voice.js
CHANGED
|
@@ -113,12 +113,6 @@ class VoiceStep extends step_1.default {
|
|
|
113
113
|
channel.hangup = true;
|
|
114
114
|
await this.updateData();
|
|
115
115
|
}
|
|
116
|
-
async autoHangup() {
|
|
117
|
-
const channel = await this.fetchData();
|
|
118
|
-
if (!channel.hangup) {
|
|
119
|
-
await this.sendCommands(channel, [{ name: 'hangup', reason: 'AUTO' }]);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
116
|
buildSections({ sections, textType, ttsSettings, allowKeypadBargeIn }) {
|
|
123
117
|
return lodash_1.default.map(sections, section => ({
|
|
124
118
|
text: section.voiceTextMsg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.33",
|
|
4
|
+
"dev_version": "4.1.0",
|
|
5
|
+
"prod_version": "TODO: 4.1.0 ?",
|
|
4
6
|
"author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
|
|
5
7
|
"contributors": [
|
|
6
8
|
"Roman Zolotarov",
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
"uuid": "^8.3.2"
|
|
19
21
|
},
|
|
20
22
|
"devDependencies": {
|
|
21
|
-
"@onereach/flow-sdk": "^3.1.
|
|
23
|
+
"@onereach/flow-sdk": "^3.1.54",
|
|
22
24
|
"@swc/cli": "^0.1.57",
|
|
23
25
|
"@swc/core": "^1.2.210",
|
|
24
26
|
"@swc/jest": "^0.2.21",
|