@onereach/step-voice 6.1.26-VOIC1449.9 → 6.1.27-VOIC1507.0
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 +1 -1
- package/dst/Custom Voice Input.js +1 -1
- package/dst/Global Command.d.ts +2 -2
- package/dst/Global Command.js +2 -2
- package/dst/Initiate Call.d.ts +1 -1
- package/dst/Keypad Input.js +1 -1
- package/dst/Say Message.js +2 -1
- package/dst/Transfer.js +0 -5
- package/dst/Wait For Call.d.ts +3 -3
- package/dst/Wait For Call.js +2 -11
- package/dst/step.d.ts +4 -2
- package/dst/voice.d.ts +8 -4
- package/dst/voice.js +3 -4
- package/package.json +3 -3
package/dst/Choice.js
CHANGED
|
@@ -102,7 +102,7 @@ class Choice extends voice_1.default {
|
|
|
102
102
|
event,
|
|
103
103
|
speechSections,
|
|
104
104
|
repromptsList,
|
|
105
|
-
reportingSettingsKey
|
|
105
|
+
reportingSettingsKey: this.rptsStarted ? 'transcriptReprompt' : 'transcriptPrompt'
|
|
106
106
|
});
|
|
107
107
|
switch (event.params.type) {
|
|
108
108
|
case 'digit':
|
|
@@ -93,7 +93,7 @@ class CustomVoiceInput extends voice_1.default {
|
|
|
93
93
|
event,
|
|
94
94
|
speechSections,
|
|
95
95
|
repromptsList,
|
|
96
|
-
reportingSettingsKey
|
|
96
|
+
reportingSettingsKey: this.rptsStarted ? 'transcriptReprompt' : 'transcriptPrompt'
|
|
97
97
|
});
|
|
98
98
|
switch (event.params.type) {
|
|
99
99
|
// digit recognition removed
|
package/dst/Global Command.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEvent } from '@onereach/flow-sdk/dst/types/event';
|
|
2
2
|
import VoiceStep, { IVoiceCall, TODO, VoiceEvent } from './voice';
|
|
3
3
|
interface INPUT {
|
|
4
4
|
asr: TODO;
|
|
@@ -59,7 +59,7 @@ export default class GlobalCommand extends VoiceStep<Partial<INPUT>, OUTPUT, EVE
|
|
|
59
59
|
} | undefined;
|
|
60
60
|
} | undefined;
|
|
61
61
|
hangup(call: IVoiceCall): Promise<unknown>;
|
|
62
|
-
exitThread(event:
|
|
62
|
+
exitThread(event: IEvent<EVENT>, type: string, stepExit: string): Promise<void>;
|
|
63
63
|
buildGrammar(call: IVoiceCall, choices: TODO[]): Promise<any>;
|
|
64
64
|
acceptAck(eventParams: any): void;
|
|
65
65
|
}
|
package/dst/Global Command.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/strict-boolean-expressions, @typescript-eslint/explicit-function-return-type */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const process_1 = require("@onereach/flow-sdk/dst/types/process");
|
|
6
6
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
7
|
const voice_1 = tslib_1.__importDefault(require("./voice"));
|
|
8
8
|
const CALL_QUALITY_RATINGS = {
|
|
@@ -151,7 +151,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
151
151
|
this.triggers.otherwise(async () => {
|
|
152
152
|
await this.initGrammar(call);
|
|
153
153
|
});
|
|
154
|
-
this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread:
|
|
154
|
+
this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: process_1.MAIN_THREAD_ID, sync: true, times: 1 }, async () => {
|
|
155
155
|
// TODO: this is not required in newer versions, delete in v6.1+
|
|
156
156
|
const allowAck = this.canVoicerAck(call);
|
|
157
157
|
if (!allowAck) {
|
package/dst/Initiate Call.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ interface INPUT {
|
|
|
21
21
|
isAMD?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export default class InitiateCall extends VoiceStep<INPUT, TODO, CallStartEvent> {
|
|
24
|
-
get conversation(): string | import("@onereach/flow-sdk/
|
|
24
|
+
get conversation(): string | import("@onereach/flow-sdk/types").IMergeField;
|
|
25
25
|
runStep(): Promise<void>;
|
|
26
26
|
onAwake(): Promise<void>;
|
|
27
27
|
waitForCall(): Promise<void>;
|
package/dst/Keypad Input.js
CHANGED
package/dst/Say Message.js
CHANGED
package/dst/Transfer.js
CHANGED
|
@@ -77,11 +77,6 @@ class Transfer extends voice_1.default {
|
|
|
77
77
|
timeout
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
console.log('transfer otherwise', {
|
|
81
|
-
data: { ...this.data },
|
|
82
|
-
headers,
|
|
83
|
-
command
|
|
84
|
-
});
|
|
85
80
|
const muteAfterTransfer = !!muteRecording;
|
|
86
81
|
await this.pauseRecording(call, command, { muteStep: muteAfterTransfer, muteBot: muteAfterTransfer, muteUser: muteAfterTransfer });
|
|
87
82
|
await this.transcript(call, {
|
package/dst/Wait For Call.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import VoiceStep, { CallStartEvent, TODO } from './voice';
|
|
2
|
-
import {
|
|
2
|
+
import { IEvent } from '@onereach/flow-sdk/dst/types/event';
|
|
3
3
|
export default class WaitForCall extends VoiceStep<TODO, TODO, TODO> {
|
|
4
|
-
get conversation(): string | import("@onereach/flow-sdk/
|
|
4
|
+
get conversation(): string | import("@onereach/flow-sdk/types").IMergeField;
|
|
5
5
|
runStep(): Promise<void>;
|
|
6
|
-
onCall(event:
|
|
6
|
+
onCall(event: IEvent<CallStartEvent>): Promise<any>;
|
|
7
7
|
}
|
package/dst/Wait For Call.js
CHANGED
|
@@ -23,8 +23,6 @@ class WaitForCall extends voice_1.default {
|
|
|
23
23
|
}
|
|
24
24
|
async onCall(event) {
|
|
25
25
|
const { asr, tts, endOfInputTimeout } = this.data;
|
|
26
|
-
this.log.debug('ON_CALL_X', event);
|
|
27
|
-
console.log('ON_CALL_X', { event });
|
|
28
26
|
const call = {
|
|
29
27
|
headers: event.params.headers,
|
|
30
28
|
// @ts-expect-error
|
|
@@ -38,20 +36,13 @@ class WaitForCall extends voice_1.default {
|
|
|
38
36
|
delete call.from;
|
|
39
37
|
delete call.to;
|
|
40
38
|
const presetTime = (Number(endOfInputTimeout) || 0) * 60 * 1000;
|
|
41
|
-
const { sessionId: previousSessionId = '', beginningSessionId = '', } = event?.reporting ?? {};
|
|
42
39
|
await this.session.start({
|
|
43
40
|
timeout: presetTime || defaultSessionTimeout,
|
|
44
41
|
reporting: {
|
|
45
42
|
settingsKey: 'session',
|
|
46
43
|
startedBy: 'Visitor',
|
|
47
|
-
sessionType: 'Phone'
|
|
48
|
-
|
|
49
|
-
beginningSessionId
|
|
50
|
-
},
|
|
51
|
-
reportingSessions: [{
|
|
52
|
-
previousSessionId,
|
|
53
|
-
beginningSessionId
|
|
54
|
-
}]
|
|
44
|
+
sessionType: 'Phone'
|
|
45
|
+
}
|
|
55
46
|
});
|
|
56
47
|
await this.startConversation(call);
|
|
57
48
|
await this.transcript(call, {
|
package/dst/step.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Step from '@onereach/flow-sdk/dst/step';
|
|
2
|
-
import {
|
|
2
|
+
import { CONFIG, IThreadId } from '@onereach/flow-sdk/dst/types/thread';
|
|
3
|
+
import { IMergeField } from '@onereach/flow-sdk/dst/types/mergeFields';
|
|
4
|
+
import { IEvent } from "@onereach/flow-sdk/types/event";
|
|
3
5
|
export interface ConvStepDataIn {
|
|
4
6
|
conversation?: string | IMergeField;
|
|
5
7
|
conversationThread?: IThreadId;
|
|
@@ -10,7 +12,7 @@ export interface IConversation {
|
|
|
10
12
|
export interface IConversationData {
|
|
11
13
|
_conv: IConversation;
|
|
12
14
|
}
|
|
13
|
-
export default class ConvStep<TData extends IConversationData, TIn = unknown, TOut = unknown,
|
|
15
|
+
export default class ConvStep<TData extends IConversationData, TIn = unknown, TOut = unknown, TEvents extends IEvent<any> = IEvent<any>> extends Step<CONFIG<TIn & ConvStepDataIn, TOut, TEvents, any, any, any>> {
|
|
14
16
|
private convDataCache?;
|
|
15
17
|
get cache(): TData | undefined;
|
|
16
18
|
get conversation(): string | IMergeField;
|
package/dst/voice.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ICallback
|
|
1
|
+
import { ICallback } from '@onereach/flow-sdk/dst/types/eventManager';
|
|
2
|
+
import { IPromtpSection, IVoiceReporterTranscriptEventArgs } from '@onereach/flow-sdk/dst/types/reporter';
|
|
3
|
+
import { IEvent } from '@onereach/flow-sdk/dst/types/event';
|
|
2
4
|
import ConvStep, { IConversationData } from './step';
|
|
3
5
|
import BasicError from '@onereach/flow-sdk/dst/errors/base';
|
|
6
|
+
import { WITH_VAR } from "@onereach/flow-sdk/types/thread";
|
|
4
7
|
export type TODO = any;
|
|
5
8
|
export interface SensitiveData {
|
|
6
9
|
muteStep: boolean;
|
|
@@ -65,7 +68,7 @@ export interface CallStartEvent extends VoiceEvent {
|
|
|
65
68
|
}
|
|
66
69
|
export interface HandleInterruptionParams<TParams extends VoiceEvent = VoiceEvent> {
|
|
67
70
|
call: IVoiceCall;
|
|
68
|
-
event:
|
|
71
|
+
event: IEvent<TParams>;
|
|
69
72
|
speechSections: IPromtpSection[];
|
|
70
73
|
repromptsList?: {
|
|
71
74
|
message?: string;
|
|
@@ -73,9 +76,10 @@ export interface HandleInterruptionParams<TParams extends VoiceEvent = VoiceEven
|
|
|
73
76
|
}[];
|
|
74
77
|
reportingSettingsKey?: string;
|
|
75
78
|
}
|
|
79
|
+
export type VoiceEvents<TParams> = IEvent<TParams, WITH_VAR<'in/voice/'>> | IEvent<TParams, WITH_VAR<'in/voice/', '/event'>>;
|
|
76
80
|
export default class VoiceStep<TIn = unknown, TOut = unknown, TParams extends VoiceEvent = VoiceEvent> extends ConvStep<IVoiceCall, TIn & {
|
|
77
81
|
handleCancel?: boolean;
|
|
78
|
-
}, TOut, TParams
|
|
82
|
+
}, TOut, VoiceEvents<TParams>> {
|
|
79
83
|
runBefore(): Promise<void>;
|
|
80
84
|
exitStep(exitId: string, data?: any, byThread?: boolean): any;
|
|
81
85
|
exitStepByThread(exitId: string, result: any): any;
|
|
@@ -107,6 +111,6 @@ export default class VoiceStep<TIn = unknown, TOut = unknown, TParams extends Vo
|
|
|
107
111
|
get rptsStarted(): boolean;
|
|
108
112
|
canVoicerHearbeat(call: IVoiceCall): boolean;
|
|
109
113
|
canVoicerAck(call: IVoiceCall): boolean;
|
|
110
|
-
getInterruptionMetadata(event:
|
|
114
|
+
getInterruptionMetadata(event: IEvent<TParams>): VoiceInterruptionMetadata | null;
|
|
111
115
|
handleInterruption(params: HandleInterruptionParams<TParams>): Promise<void>;
|
|
112
116
|
}
|
package/dst/voice.js
CHANGED
|
@@ -13,7 +13,6 @@ class VoiceStepError extends base_1.default {
|
|
|
13
13
|
}
|
|
14
14
|
exports.VoiceStepError = VoiceStepError;
|
|
15
15
|
class VoiceStep extends step_1.default {
|
|
16
|
-
// static Error = VoiceStepError
|
|
17
16
|
async runBefore() {
|
|
18
17
|
await super.runBefore();
|
|
19
18
|
if (this.cache != null) {
|
|
@@ -63,7 +62,7 @@ class VoiceStep extends step_1.default {
|
|
|
63
62
|
commands,
|
|
64
63
|
step: { key: this.session.key, trd: this.isGlobal ? this.workerThreadId : this.thread.id } // response should be sent to this session
|
|
65
64
|
},
|
|
66
|
-
reporting:
|
|
65
|
+
reporting: this.session.getSessionRef()
|
|
67
66
|
}, {
|
|
68
67
|
target: callback,
|
|
69
68
|
invocationType: 'async',
|
|
@@ -251,7 +250,7 @@ class VoiceStep extends step_1.default {
|
|
|
251
250
|
return eventId;
|
|
252
251
|
}
|
|
253
252
|
throwError(error = new Error('unknown')) {
|
|
254
|
-
throw new VoiceStepError(error.message ?? error,
|
|
253
|
+
throw new VoiceStepError(error.message ?? error, { name: error?.name });
|
|
255
254
|
}
|
|
256
255
|
async handleHangup(call) {
|
|
257
256
|
if (call.ended)
|
|
@@ -417,7 +416,7 @@ class VoiceStep extends step_1.default {
|
|
|
417
416
|
if (!interruptionMetadata)
|
|
418
417
|
return;
|
|
419
418
|
const sections = [];
|
|
420
|
-
if (repromptsList.length && reportingSettingsKey === '
|
|
419
|
+
if (repromptsList.length && reportingSettingsKey === 'transcriptReprompt') {
|
|
421
420
|
const current = repromptsList[this.rptsIndex - 1];
|
|
422
421
|
sections.push({
|
|
423
422
|
url: current?.fileName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.27-VOIC1507.0",
|
|
4
4
|
"author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Roman Zolotarov",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"uuid": "^9.0.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@onereach/flow-sdk": "^
|
|
23
|
-
"@onereach/orbes": "^
|
|
22
|
+
"@onereach/flow-sdk": "^8.0.5",
|
|
23
|
+
"@onereach/orbes": "^7.2.9",
|
|
24
24
|
"@onereach/step-voice": "./test",
|
|
25
25
|
"@swc/cli": "^0.1.62",
|
|
26
26
|
"@swc/core": "^1.3.57",
|