@aws-sdk/client-transcribe-streaming 3.95.0 → 3.105.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/CHANGELOG.md +27 -0
- package/README.md +197 -126
- package/dist-cjs/TranscribeStreamingClient.js +2 -0
- package/dist-cjs/runtimeConfig.js +2 -0
- package/dist-es/TranscribeStreamingClient.js +2 -0
- package/dist-es/runtimeConfig.js +2 -0
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.105.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.104.0...v3.105.0) (2022-06-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **clients:** support recursion detection in Lambda ([#3654](https://github.com/aws/aws-sdk-js-v3/issues/3654)) ([ecfe46e](https://github.com/aws/aws-sdk-js-v3/commit/ecfe46ea1fd8b6e3812b75b3dc6c03554fb4b3fa))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.100.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.99.0...v3.100.0) (2022-05-26)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.99.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.98.0...v3.99.0) (2022-05-25)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [3.95.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.94.0...v3.95.0) (2022-05-19)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
|
package/README.md
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
<!-- generated file, do not edit directly -->
|
|
2
|
-
|
|
3
1
|
# @aws-sdk/client-transcribe-streaming
|
|
4
2
|
|
|
5
3
|
[](https://www.npmjs.com/package/@aws-sdk/client-transcribe-streaming)
|
|
6
4
|
[](https://www.npmjs.com/package/@aws-sdk/client-transcribe-streaming)
|
|
7
5
|
|
|
8
|
-
##
|
|
6
|
+
## Introduction
|
|
7
|
+
|
|
8
|
+
Amazon Transcribe streaming enables you to send an audio stream and receive back a stream of text in real time.
|
|
9
|
+
The API makes it easy for developers to add real-time speech-to-text capability to their applications. It can be used
|
|
10
|
+
for a variety of purposes. For example:
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
- Streaming transcriptions can generate real-time subtitles for live broadcast media.
|
|
13
|
+
- Lawyers can make real-time annotations on top of streaming transcriptions during courtroom depositions.
|
|
14
|
+
- Video game chat can be transcribed in real time so that hosts can moderate content or run real-time analysis.
|
|
15
|
+
- Streaming transcriptions can provide assistance to the hearing impaired.
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
The JavaScript SDK Transcribe Streaming client encapsulates the API into a JavaScript library that can be run on
|
|
18
|
+
browsers, Node.js and _potentially_ React Native. By default, the client uses HTTP/2 connection on Node.js, and uses
|
|
19
|
+
`WebSocket` connection on browsers and React Native.
|
|
13
20
|
|
|
14
21
|
## Installing
|
|
15
22
|
|
|
@@ -22,21 +29,20 @@ using your favorite package manager:
|
|
|
22
29
|
|
|
23
30
|
## Getting Started
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
In the sections bellow, we will explain the library by an example of using `startStreamTranscription` method to
|
|
33
|
+
transcribe English speech to text.
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
the commands you need, for example `StartMedicalStreamTranscriptionCommand`:
|
|
35
|
+
If you haven't, please read [the root README](../../README.md) for guidance for creating a sample application and
|
|
36
|
+
installation. After installation, in the `index.js`, you can import the Transcribe Streaming client like:
|
|
30
37
|
|
|
31
38
|
```js
|
|
32
39
|
// ES5 example
|
|
33
|
-
const {
|
|
34
|
-
TranscribeStreamingClient,
|
|
35
|
-
StartMedicalStreamTranscriptionCommand,
|
|
36
|
-
} = require("@aws-sdk/client-transcribe-streaming");
|
|
40
|
+
const { TranscribeStreamingClient, StartStreamTranscriptionCommand } = require("@aws-sdk/client-transcribe-streaming");
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
If `require` is not available on the platform you are working on(browsers). You can import the client like:
|
|
44
|
+
|
|
45
|
+
```js
|
|
40
46
|
// ES6+ example
|
|
41
47
|
import {
|
|
42
48
|
TranscribeStreamingClient,
|
|
@@ -44,168 +50,233 @@ import {
|
|
|
44
50
|
} from "@aws-sdk/client-transcribe-streaming";
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
To send a request, you:
|
|
53
|
+
## Constructing the Service Client
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
- Initiate command with input parameters.
|
|
53
|
-
- Call `send` operation on client with command object as input.
|
|
54
|
-
- If you are using a custom http handler, you may call `destroy()` to close open connections.
|
|
55
|
+
You can create a service client like bellow:
|
|
55
56
|
|
|
56
57
|
```js
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const client = new TranscribeStreamingClient({
|
|
59
|
+
region,
|
|
60
|
+
credentials,
|
|
61
|
+
});
|
|
62
|
+
// region and credentials are optional in Node.js
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Acquire Speech Stream
|
|
66
|
+
|
|
67
|
+
The Transcribe Streaming client accepts streaming speech input as an [async iterable]. You can construct them from either an async generator or using `Symbol.asyncIterable` to emit binary chunks.
|
|
59
68
|
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
Here's an example of using async generator:
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
const audioStream = async function* () {
|
|
73
|
+
await device.start();
|
|
74
|
+
while (device.ends !== true) {
|
|
75
|
+
const chunk = await device.read();
|
|
76
|
+
yield chunk; /* yield binary chunk */
|
|
77
|
+
}
|
|
62
78
|
};
|
|
63
|
-
const command = new StartMedicalStreamTranscriptionCommand(params);
|
|
64
79
|
```
|
|
65
80
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
69
|
-
operator to wait for the promise returned by send operation as follows:
|
|
81
|
+
Then you need to construct the binary chunk into an audio chunk shape that can be recognized by the SDK:
|
|
70
82
|
|
|
71
83
|
```js
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
// error handling.
|
|
78
|
-
} finally {
|
|
79
|
-
// finally.
|
|
80
|
-
}
|
|
84
|
+
const audioStream = async function* () {
|
|
85
|
+
for await (const chunk of audioSource()) {
|
|
86
|
+
yield { AudioEvent: { AudioChunk: chunk } };
|
|
87
|
+
}
|
|
88
|
+
};
|
|
81
89
|
```
|
|
82
90
|
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
### Acquire from Node.js Stream API
|
|
92
|
+
|
|
93
|
+
In Node.js you will mostly acquire the speech in [Stream API], from HTTP request or devices. Stream API in Node.js (>=
|
|
94
|
+
10.0.0) itself is an async iterable. You can supply the streaming into the SDK input without explicit convert. You
|
|
95
|
+
only need to construct the audio chunk shape that can be recognized by the SDK:
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
```js
|
|
98
|
+
const audioSource = req; //Incoming message
|
|
99
|
+
const audioStream = async function* () {
|
|
100
|
+
for await (const payloadChunk of audioSource) {
|
|
101
|
+
yield { AudioEvent: { AudioChunk: payloadChunk } };
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
```
|
|
87
105
|
|
|
88
|
-
|
|
89
|
-
|
|
106
|
+
If you see don't limit the chunk size on the client side, for example, streams from `fs`, you might see
|
|
107
|
+
`The chunk is too big` error from the Transcribe Streaming. You can solve it by setting the [`HighWaterMark`][readable hightwatermark]:
|
|
90
108
|
|
|
91
109
|
```js
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
const { PassThrough } = require("stream");
|
|
111
|
+
const { createReadStream } = require("fs");
|
|
112
|
+
const audioSource = createReadStream("path/to/speech.wav");
|
|
113
|
+
const audioPayloadStream = new PassThrough({ highWaterMark: 1 * 1024 }); // Stream chunk less than 1 KB
|
|
114
|
+
audioSource.pipe(audioPayloadStream);
|
|
115
|
+
const audioStream = async function* () {
|
|
116
|
+
for await (const payloadChunk of audioPayloadStream) {
|
|
117
|
+
yield { AudioEvent: { AudioChunk: payloadChunk } };
|
|
98
118
|
}
|
|
99
|
-
|
|
119
|
+
};
|
|
100
120
|
```
|
|
101
121
|
|
|
102
|
-
|
|
122
|
+
Depending on the audio source, you may need to [PCM encode](#PCM-encoding) you audio chunk.
|
|
123
|
+
|
|
124
|
+
### Acquire from Browsers
|
|
125
|
+
|
|
126
|
+
The Transcribe Streaming SDK client also supports streaming from browsers. You can acquire the microphone data through
|
|
127
|
+
[`getUserMedia` API][getusermedia api]. Note that this API is supported by [a subset of browsers][getusermedia support].
|
|
128
|
+
Here's a code snippet of acquiring microphone audio stream using [`microphone-stream`][microphone-stream]
|
|
103
129
|
|
|
104
130
|
```js
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// error handling.
|
|
131
|
+
const mic = require("microphone-stream");
|
|
132
|
+
// this part should be put into an async function
|
|
133
|
+
micStream.setStream(
|
|
134
|
+
await window.navigator.mediaDevices.getUserMedia({
|
|
135
|
+
video: false,
|
|
136
|
+
audio: true,
|
|
112
137
|
})
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
);
|
|
139
|
+
const audioStream = async function* () {
|
|
140
|
+
for await (const chunk of micStream) {
|
|
141
|
+
yield { AudioEvent: { AudioChunk: pcmEncodeChunk(chunk) /* pcm Encoding is optional depending on the source */ } };
|
|
142
|
+
}
|
|
143
|
+
};
|
|
116
144
|
```
|
|
117
145
|
|
|
118
|
-
|
|
146
|
+
You can find the a full front-end example [here][front-end example repo]
|
|
147
|
+
|
|
148
|
+
#### PCM encoding
|
|
119
149
|
|
|
120
|
-
|
|
121
|
-
|
|
150
|
+
Currently Transcribe Streaming service only accepts [PCM][pcm] encoding. If your audio source is not already encoded,
|
|
151
|
+
you need to PCM encoding the chunks. Here's an example:
|
|
122
152
|
|
|
123
153
|
```js
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
154
|
+
const pcmEncodeChunk = (chunk) => {
|
|
155
|
+
const input = mic.toRaw(chunk);
|
|
156
|
+
var offset = 0;
|
|
157
|
+
var buffer = new ArrayBuffer(input.length * 2);
|
|
158
|
+
var view = new DataView(buffer);
|
|
159
|
+
for (var i = 0; i < input.length; i++, offset += 2) {
|
|
160
|
+
var s = Math.max(-1, Math.min(1, input[i]));
|
|
161
|
+
view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true);
|
|
162
|
+
}
|
|
163
|
+
return Buffer.from(buffer);
|
|
164
|
+
};
|
|
128
165
|
```
|
|
129
166
|
|
|
130
|
-
|
|
167
|
+
## Send the Speech Stream
|
|
131
168
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
169
|
+
```js
|
|
170
|
+
const command = new StartStreamTranscriptionCommand({
|
|
171
|
+
// The language code for the input audio. Valid values are en-GB, en-US, es-US, fr-CA, and fr-FR
|
|
172
|
+
LanguageCode: "en-US",
|
|
173
|
+
// The encoding used for the input audio. The only valid value is pcm.
|
|
174
|
+
MediaEncoding: "pcm",
|
|
175
|
+
// The sample rate of the input audio in Hertz. We suggest that you use 8000 Hz for low-quality audio and 16000 Hz for
|
|
176
|
+
// high-quality audio. The sample rate must match the sample rate in the audio file.
|
|
177
|
+
MediaSampleRateHertz: 44100,
|
|
178
|
+
AudioStream: audioStream(),
|
|
179
|
+
});
|
|
180
|
+
const response = await client.send(command);
|
|
181
|
+
```
|
|
135
182
|
|
|
136
|
-
|
|
137
|
-
import * as AWS from "@aws-sdk/client-transcribe-streaming";
|
|
138
|
-
const client = new AWS.TranscribeStreaming({ region: "REGION" });
|
|
183
|
+
## Handling Text Stream
|
|
139
184
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
185
|
+
If the request succeeds, you will get a response containing the streaming transcript like [this][response data example].
|
|
186
|
+
Just like the input speech stream, the transcript stream is an [async iterable][async iterable] emitting the partial
|
|
187
|
+
transcripts. Here is a code snippet of accessing the transcripts
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
// This snippet should be put into an async function
|
|
191
|
+
for await (const event of response.TranscriptResultStream) {
|
|
192
|
+
if (event.TranscriptEvent) {
|
|
193
|
+
const message = event.TranscriptEvent;
|
|
194
|
+
// Get multiple possible results
|
|
195
|
+
const results = event.TranscriptEvent.Transcript.Results;
|
|
196
|
+
// Print all the possible transcripts
|
|
197
|
+
results.map((result) => {
|
|
198
|
+
(result.Alternatives || []).map((alternative) => {
|
|
199
|
+
const transcript = alternative.Items.map((item) => item.Content).join(" ");
|
|
200
|
+
console.log(transcript);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
|
146
204
|
}
|
|
205
|
+
```
|
|
147
206
|
|
|
148
|
-
|
|
149
|
-
client
|
|
150
|
-
.startMedicalStreamTranscription(params)
|
|
151
|
-
.then((data) => {
|
|
152
|
-
// process data.
|
|
153
|
-
})
|
|
154
|
-
.catch((error) => {
|
|
155
|
-
// error handling.
|
|
156
|
-
});
|
|
207
|
+
### Pipe Transcripts Stream
|
|
157
208
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
});
|
|
209
|
+
In Node.js, you can pipe this `TranscriptResultStream` to other destinations easily with the [`from` API][readable.from]:
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
const { Readable } = require("stream");
|
|
213
|
+
const transcriptsStream = Readable.from(response.TranscriptResultStream);
|
|
214
|
+
transcriptsStream.pipe(/* some destinations */);
|
|
162
215
|
```
|
|
163
216
|
|
|
164
|
-
|
|
217
|
+
## Error Handling
|
|
165
218
|
|
|
166
|
-
|
|
167
|
-
|
|
219
|
+
If you are using `async...await` style code, you are able to catch the errors with `try...catch` block. There are 2
|
|
220
|
+
categories of exceptions can be thrown:
|
|
221
|
+
|
|
222
|
+
- Immediate exceptions thrown before transcription is started, like signature
|
|
223
|
+
exceptions, invalid parameters exceptions, and network errors;
|
|
224
|
+
- Streaming exceptions that happens after transcription is
|
|
225
|
+
started, like `InternalFailureException` or `ConflictException`.
|
|
226
|
+
|
|
227
|
+
For immediate exceptions, the SDK client will retry the request if the error is retryable, like network errors. You can
|
|
228
|
+
config the client to behave as you intend to.
|
|
229
|
+
|
|
230
|
+
For streaming exceptions, because the streaming transcription is already
|
|
231
|
+
started, client cannot retry the request automatically. The client will throw these exceptions and users can handle the
|
|
232
|
+
stream behavior accordingly.
|
|
233
|
+
|
|
234
|
+
Here's an example of error handling flow:
|
|
168
235
|
|
|
169
236
|
```js
|
|
170
237
|
try {
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
} catch (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
* }
|
|
182
|
-
*/
|
|
238
|
+
const response = await client.send(command);
|
|
239
|
+
await handleResponse(response);
|
|
240
|
+
} catch (e) {
|
|
241
|
+
if (e instanceof InternalFailureException) {
|
|
242
|
+
/* handle InternalFailureException */
|
|
243
|
+
} else if (e instanceof ConflictException) {
|
|
244
|
+
/* handle ConflictException */
|
|
245
|
+
}
|
|
246
|
+
} finally {
|
|
247
|
+
/* clean resources like input stream */
|
|
183
248
|
}
|
|
184
249
|
```
|
|
185
250
|
|
|
186
|
-
##
|
|
187
|
-
|
|
188
|
-
Please use these community resources for getting help.
|
|
189
|
-
We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
|
|
251
|
+
## Notes for React Native
|
|
190
252
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
on AWS Developer Blog.
|
|
195
|
-
- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`.
|
|
196
|
-
- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3).
|
|
197
|
-
- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose).
|
|
253
|
+
This package is compatible with React Native (>= 0.60). However, it is not tested with any React Native libraries that
|
|
254
|
+
converts microphone record into streaming data. Community input for integrating streaming microphone record data is
|
|
255
|
+
welcome.
|
|
198
256
|
|
|
199
|
-
|
|
200
|
-
|
|
257
|
+
Thank you for reading this guide. If you want to know more about how streams are encoded, how connection is established,
|
|
258
|
+
please refer to the [Service API guide][service api guide].
|
|
201
259
|
|
|
202
260
|
## Contributing
|
|
203
261
|
|
|
204
|
-
This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-transcribe-streaming`
|
|
205
|
-
To contribute to client you can check our
|
|
262
|
+
This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-transcribe-streaming`
|
|
263
|
+
package is updated. To contribute to client you can check our
|
|
264
|
+
[generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients).
|
|
206
265
|
|
|
207
266
|
## License
|
|
208
267
|
|
|
209
268
|
This SDK is distributed under the
|
|
210
269
|
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
|
|
211
|
-
see LICENSE for more
|
|
270
|
+
see LICENSE for more informatio
|
|
271
|
+
|
|
272
|
+
[async iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
|
273
|
+
[stream api]: https://nodejs.org/docs/latest-v12.x/api/stream.html
|
|
274
|
+
[readable hightwatermark]: https://nodejs.org/docs/latest-v12.x/api/stream.html#stream_readable_readablehighwatermark
|
|
275
|
+
[getusermedia api]: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
|
|
276
|
+
[getusermedia support]: https://caniuse.com/#search=getusermedia
|
|
277
|
+
[microphone-stream]: https://www.npmjs.com/package/microphone-stream
|
|
278
|
+
[front-end example repo]: https://github.com/aws-samples/amazon-transcribe-websocket-static
|
|
279
|
+
[pcm]: https://en.wikipedia.org/wiki/Pulse-code_modulation
|
|
280
|
+
[response data example]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html
|
|
281
|
+
[readable.from]: https://nodejs.org/docs/latest-v12.x/api/stream.html#stream_stream_readable_from_iterable_options
|
|
282
|
+
[service api guide]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html
|
|
@@ -7,6 +7,7 @@ const middleware_content_length_1 = require("@aws-sdk/middleware-content-length"
|
|
|
7
7
|
const middleware_eventstream_1 = require("@aws-sdk/middleware-eventstream");
|
|
8
8
|
const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
|
|
9
9
|
const middleware_logger_1 = require("@aws-sdk/middleware-logger");
|
|
10
|
+
const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
|
|
10
11
|
const middleware_retry_1 = require("@aws-sdk/middleware-retry");
|
|
11
12
|
const middleware_sdk_transcribe_streaming_1 = require("@aws-sdk/middleware-sdk-transcribe-streaming");
|
|
12
13
|
const middleware_signing_1 = require("@aws-sdk/middleware-signing");
|
|
@@ -31,6 +32,7 @@ class TranscribeStreamingClient extends smithy_client_1.Client {
|
|
|
31
32
|
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
|
32
33
|
this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
|
|
33
34
|
this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
|
|
35
|
+
this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
|
|
34
36
|
this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config));
|
|
35
37
|
this.middlewareStack.use((0, middleware_sdk_transcribe_streaming_1.getWebSocketPlugin)(this.config));
|
|
36
38
|
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
@@ -19,8 +19,10 @@ const util_utf8_node_1 = require("@aws-sdk/util-utf8-node");
|
|
|
19
19
|
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
20
20
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
21
21
|
const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node");
|
|
22
|
+
const smithy_client_2 = require("@aws-sdk/smithy-client");
|
|
22
23
|
const getRuntimeConfig = (config) => {
|
|
23
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
25
|
+
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
24
26
|
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
25
27
|
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
26
28
|
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
@@ -5,6 +5,7 @@ import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
|
|
|
5
5
|
import { resolveEventStreamConfig, } from "@aws-sdk/middleware-eventstream";
|
|
6
6
|
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
7
7
|
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
8
|
+
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
8
9
|
import { getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry";
|
|
9
10
|
import { getWebSocketPlugin, resolveWebSocketConfig, } from "@aws-sdk/middleware-sdk-transcribe-streaming";
|
|
10
11
|
import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
|
|
@@ -31,6 +32,7 @@ var TranscribeStreamingClient = (function (_super) {
|
|
|
31
32
|
_this.middlewareStack.use(getContentLengthPlugin(_this.config));
|
|
32
33
|
_this.middlewareStack.use(getHostHeaderPlugin(_this.config));
|
|
33
34
|
_this.middlewareStack.use(getLoggerPlugin(_this.config));
|
|
35
|
+
_this.middlewareStack.use(getRecursionDetectionPlugin(_this.config));
|
|
34
36
|
_this.middlewareStack.use(getAwsAuthPlugin(_this.config));
|
|
35
37
|
_this.middlewareStack.use(getWebSocketPlugin(_this.config));
|
|
36
38
|
_this.middlewareStack.use(getUserAgentPlugin(_this.config));
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -16,8 +16,10 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
|
|
|
16
16
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
17
17
|
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
18
18
|
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
|
|
19
|
+
import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
|
|
19
20
|
export var getRuntimeConfig = function (config) {
|
|
20
21
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
22
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
21
23
|
var defaultsMode = resolveDefaultsModeConfig(config);
|
|
22
24
|
var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
|
|
23
25
|
var clientSharedValues = getSharedRuntimeConfig(config);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-transcribe-streaming",
|
|
3
3
|
"description": "AWS SDK for JavaScript Transcribe Streaming Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.105.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@aws-crypto/sha256-browser": "2.0.0",
|
|
21
21
|
"@aws-crypto/sha256-js": "2.0.0",
|
|
22
|
-
"@aws-sdk/client-sts": "3.
|
|
22
|
+
"@aws-sdk/client-sts": "3.105.0",
|
|
23
23
|
"@aws-sdk/config-resolver": "3.80.0",
|
|
24
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
24
|
+
"@aws-sdk/credential-provider-node": "3.105.0",
|
|
25
25
|
"@aws-sdk/eventstream-handler-node": "3.78.0",
|
|
26
26
|
"@aws-sdk/eventstream-serde-browser": "3.78.0",
|
|
27
27
|
"@aws-sdk/eventstream-serde-config-resolver": "3.78.0",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@aws-sdk/middleware-eventstream": "3.78.0",
|
|
34
34
|
"@aws-sdk/middleware-host-header": "3.78.0",
|
|
35
35
|
"@aws-sdk/middleware-logger": "3.78.0",
|
|
36
|
+
"@aws-sdk/middleware-recursion-detection": "3.105.0",
|
|
36
37
|
"@aws-sdk/middleware-retry": "3.80.0",
|
|
37
38
|
"@aws-sdk/middleware-sdk-transcribe-streaming": "3.78.0",
|
|
38
39
|
"@aws-sdk/middleware-serde": "3.78.0",
|
|
@@ -42,15 +43,15 @@
|
|
|
42
43
|
"@aws-sdk/node-config-provider": "3.80.0",
|
|
43
44
|
"@aws-sdk/node-http-handler": "3.94.0",
|
|
44
45
|
"@aws-sdk/protocol-http": "3.78.0",
|
|
45
|
-
"@aws-sdk/smithy-client": "3.
|
|
46
|
+
"@aws-sdk/smithy-client": "3.99.0",
|
|
46
47
|
"@aws-sdk/types": "3.78.0",
|
|
47
48
|
"@aws-sdk/url-parser": "3.78.0",
|
|
48
49
|
"@aws-sdk/util-base64-browser": "3.58.0",
|
|
49
50
|
"@aws-sdk/util-base64-node": "3.55.0",
|
|
50
51
|
"@aws-sdk/util-body-length-browser": "3.55.0",
|
|
51
52
|
"@aws-sdk/util-body-length-node": "3.55.0",
|
|
52
|
-
"@aws-sdk/util-defaults-mode-browser": "3.
|
|
53
|
-
"@aws-sdk/util-defaults-mode-node": "3.
|
|
53
|
+
"@aws-sdk/util-defaults-mode-browser": "3.99.0",
|
|
54
|
+
"@aws-sdk/util-defaults-mode-node": "3.99.0",
|
|
54
55
|
"@aws-sdk/util-user-agent-browser": "3.78.0",
|
|
55
56
|
"@aws-sdk/util-user-agent-node": "3.80.0",
|
|
56
57
|
"@aws-sdk/util-utf8-browser": "3.55.0",
|