@onereach/step-voice 7.0.4 → 7.0.6
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.d.ts +2 -2
- package/dst/Global Command.js +2 -2
- package/dst/Initiate Call.d.ts +1 -1
- package/dst/Wait For Call.d.ts +3 -3
- package/dst/step.d.ts +4 -2
- package/dst/voice.d.ts +8 -4
- package/dst/voice.js +1 -2
- package/package.json +3 -3
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/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/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) {
|
|
@@ -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)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/step-voice",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.6",
|
|
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",
|