@onereach/step-voice 4.0.25 → 4.0.29

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.d.ts CHANGED
@@ -14,6 +14,7 @@ interface INPUT {
14
14
  noReplyDelay: number;
15
15
  promptsTriggers: TODO[];
16
16
  usePromptsTriggers: boolean;
17
+ recognitionModel?: string;
17
18
  }
18
19
  interface EVENT extends VoiceEvent {
19
20
  callRecording?: TODO;
package/dst/Choice.js CHANGED
@@ -34,7 +34,7 @@ const getPhrasesForSpeechRec = (choices) => {
34
34
  }
35
35
  return texts;
36
36
  };
37
- const getAsrSettings = (settings, choices) => {
37
+ const getAsrSettings = (settings, choices, recognitionModel) => {
38
38
  if (settings.engine === 'google' || settings.engine === 'google_beta') {
39
39
  return {
40
40
  ...settings,
@@ -43,7 +43,8 @@ const getAsrSettings = (settings, choices) => {
43
43
  {
44
44
  phrases: getPhrasesForSpeechRec(choices)
45
45
  }
46
- ]
46
+ ],
47
+ recognitionModel
47
48
  }
48
49
  };
49
50
  }
@@ -68,13 +69,13 @@ const isRepromptTrigger = (recogResult, promptsTriggers) => {
68
69
  class Choice extends voice_1.default {
69
70
  async runStep() {
70
71
  const channel = await this.fetchData();
71
- const { textType, asr, tts, sensitiveData, noReplyDelay, usePromptsTriggers } = this.data;
72
+ const { textType, asr, tts, sensitiveData, noReplyDelay, usePromptsTriggers, recognitionModel } = this.data;
72
73
  const exitExists = (exitId) => {
73
74
  return lodash_1.default.some(choices, (choice) => choice.exitId === exitId);
74
75
  };
75
76
  const choices = this.buildChoices({ choices: this.data.choices });
76
77
  const ttsSettings = tts.getSettings(channel.tts);
77
- const asrSettings = getAsrSettings(asr.getSettings(channel.asr), choices);
78
+ const asrSettings = getAsrSettings(asr.getSettings(channel.asr), choices, recognitionModel);
78
79
  const repromptsList = this.buildReprompts({ prompts: this.data.prompts });
79
80
  const speechSections = this.buildSections({ sections: this.data.audio, textType, ttsSettings });
80
81
  const grammar = {
@@ -19,6 +19,7 @@ interface INPUT {
19
19
  expectedNumberOfDigits: number;
20
20
  regExToValidate: string;
21
21
  mfVersion: string;
22
+ recognitionModel?: string;
22
23
  }
23
24
  interface EVENT extends VoiceEvent {
24
25
  callRecording?: TODO;
@@ -26,7 +26,7 @@ const validateInput = ({ input = '', type, regex, expectedLength }) => {
26
26
  class KeypadInput extends voice_1.default {
27
27
  async runStep() {
28
28
  const channel = await this.fetchData();
29
- const { interTimeout, asr, tts, noReplyDelay, textType, keypadBargeIn, endInput, terminationKey, endUserInputValidationOther, expectedNumberOfDigits, regExToValidate, mfVersion, sensitiveData } = this.data;
29
+ const { interTimeout, asr, tts, noReplyDelay, textType, keypadBargeIn, endInput, terminationKey, endUserInputValidationOther, expectedNumberOfDigits, regExToValidate, mfVersion, sensitiveData, recognitionModel } = this.data;
30
30
  const interDigitTimeout = Number(interTimeout) * 1000;
31
31
  const ttsSettings = tts.getSettings(channel.tts);
32
32
  const asrSettings = asr.getSettings(channel.asr);
@@ -35,7 +35,8 @@ class KeypadInput extends voice_1.default {
35
35
  asr: {
36
36
  ...asrSettings,
37
37
  config: {
38
- version: 'v1beta'
38
+ version: 'v1beta',
39
+ recognitionModel
39
40
  }
40
41
  }
41
42
  };
package/dst/step.js CHANGED
@@ -149,7 +149,7 @@ class ConvStep extends step_1.default {
149
149
  }
150
150
  }
151
151
  async waitCancelEnd() {
152
- this.end();
152
+ this.exitFlow();
153
153
  }
154
154
  async pause() {
155
155
  const conv = await this._getConversation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "4.0.25",
3
+ "version": "4.0.29",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",
@@ -47,6 +47,7 @@
47
47
  "download-dev": "sh scripts/download.sh dev",
48
48
  "upload-prod": "sh scripts/upload.sh prod",
49
49
  "upload-dev": "sh scripts/upload.sh dev",
50
+ "publish-patch": "npm run build && npm version patch && npm publish",
50
51
  "test": "jest"
51
52
  },
52
53
  "repository": {