Skip to content

Commit ac546be

Browse files
authored
Merge pull request watson-developer-cloud#828 from watson-developer-cloud/patch-for-stt-websockets
fix: fix `getTransactionId` method for the `RecognizeStream` class
2 parents f007a19 + e5bbe2c commit ac546be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/recognize-stream.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ const OPENING_MESSAGE_PARAMS_ALLOWED = [
3636
'word_alternatives_threshold',
3737
'profanity_filter',
3838
'smart_formatting',
39-
'speaker_labels'
39+
'speaker_labels',
40+
'grammar_name',
41+
'redaction'
4042
];
4143

4244
const QUERY_PARAMS_ALLOWED = [
@@ -45,9 +47,7 @@ const QUERY_PARAMS_ALLOWED = [
4547
'watson-token',
4648
'language_customization_id',
4749
'customization_id',
48-
'acoustic_customization_id',
49-
'grammar_name',
50-
'redaction'
50+
'acoustic_customization_id'
5151
];
5252

5353
interface RecognizeStream extends Duplex {
@@ -506,7 +506,7 @@ class RecognizeStream extends Duplex {
506506
this.socket._client.response.headers['x-global-transaction-id']
507507
);
508508
} else {
509-
this.on('connect', () =>
509+
this.on('open', () =>
510510
resolve(
511511
this.socket._client.response.headers['x-global-transaction-id']
512512
)

0 commit comments

Comments
 (0)