@onereach/step-voice 6.1.2 → 6.1.3-multilingualrecognition.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.
@@ -12,6 +12,7 @@ interface OUTPUT {
12
12
  type: string;
13
13
  digit?: string;
14
14
  value?: string;
15
+ language?: string;
15
16
  interpretation?: TODO[];
16
17
  callRecording?: TODO;
17
18
  tags?: string[];
@@ -23,6 +24,7 @@ interface EVENT extends VoiceEvent {
23
24
  digit?: string;
24
25
  digits?: string;
25
26
  phrases?: TODO[];
27
+ language?: string;
26
28
  tags?: string[];
27
29
  out?: string;
28
30
  background?: boolean;
@@ -232,6 +232,9 @@ class GlobalCommand extends voice_1.default {
232
232
  result.digit = digits;
233
233
  result.value = digits;
234
234
  }
235
+ if (!lodash_1.default.isEmpty(params.language)) {
236
+ result.language = params.language;
237
+ }
235
238
  if (!lodash_1.default.isEmpty(params.phrases)) {
236
239
  const phrases = params.phrases;
237
240
  result.value = phrases[0].text;
@@ -6,7 +6,8 @@ const exitKeypadData = ({ mfVersion, digits, event }) => mfVersion === '1'
6
6
  ? digits
7
7
  : {
8
8
  digits,
9
- digitsSplit: event.params.digitsSplit
9
+ digitsSplit: event.params.digitsSplit,
10
+ language: event.params.language,
10
11
  };
11
12
  const validateInput = ({ input = '', type, regex, expectedLength }) => {
12
13
  switch (type) {
package/dst/voice.js CHANGED
@@ -17,6 +17,7 @@ class VoiceStep extends step_1.default {
17
17
  async runBefore() {
18
18
  await super.runBefore();
19
19
  if (this.cache != null) {
20
+ //@ts-ignore
20
21
  if (this.thread.id !== this.dataThreadId)
21
22
  this.thread.refThread(this.dataThreadId);
22
23
  if (!this.state.direct)
@@ -279,6 +280,9 @@ class VoiceStep extends step_1.default {
279
280
  data.digit = digit;
280
281
  data.value = digit;
281
282
  }
283
+ if (!lodash_1.default.isEmpty(params.language)) {
284
+ data.language = params.language;
285
+ }
282
286
  if (!lodash_1.default.isEmpty(params.phrases)) {
283
287
  const phrases = params.phrases;
284
288
  const other = params.other ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "6.1.2",
3
+ "version": "6.1.3-multilingualrecognition.0",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",