@aws-sdk/client-transcribe-streaming 3.180.0 → 3.183.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 CHANGED
@@ -3,6 +3,26 @@
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.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
9
+
10
+
11
+
12
+
13
+
14
+ # [3.181.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.180.0...v3.181.0) (2022-09-29)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **clients:** make parseErrorBody async ([#3999](https://github.com/aws/aws-sdk-js-v3/issues/3999)) ([2558c93](https://github.com/aws/aws-sdk-js-v3/commit/2558c93c050357ac6dc47aa0452b15b12ebfd676))
20
+ * **clients:** populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/issues/3995)) ([02e47f1](https://github.com/aws/aws-sdk-js-v3/commit/02e47f14397ae0a5d2e2883350d038b307fdcdb4))
21
+
22
+
23
+
24
+
25
+
6
26
  # [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
7
27
 
8
28
  **Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
@@ -146,7 +146,7 @@ exports.deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = deseria
146
146
  const deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = async (output, context) => {
147
147
  const parsedOutput = {
148
148
  ...output,
149
- body: await parseBody(output.body, context),
149
+ body: await parseErrorBody(output.body, context),
150
150
  };
151
151
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
152
152
  switch (errorCode) {
@@ -230,7 +230,7 @@ exports.deserializeAws_restJson1StartStreamTranscriptionCommand = deserializeAws
230
230
  const deserializeAws_restJson1StartStreamTranscriptionCommandError = async (output, context) => {
231
231
  const parsedOutput = {
232
232
  ...output,
233
- body: await parseBody(output.body, context),
233
+ body: await parseErrorBody(output.body, context),
234
234
  };
235
235
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
236
236
  switch (errorCode) {
@@ -689,6 +689,12 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
689
689
  }
690
690
  return {};
691
691
  });
692
+ const parseErrorBody = async (errorBody, context) => {
693
+ var _a;
694
+ const value = await parseBody(errorBody, context);
695
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
696
+ return value;
697
+ };
692
698
  const loadRestJsonErrorCode = (output, data) => {
693
699
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
694
700
  const sanitizeErrorCode = (rawValue) => {
@@ -1,40 +1,33 @@
1
- import { __extends } from "tslib";
2
1
  import { StartMedicalStreamTranscriptionCommand, } from "./commands/StartMedicalStreamTranscriptionCommand";
3
2
  import { StartStreamTranscriptionCommand, } from "./commands/StartStreamTranscriptionCommand";
4
3
  import { TranscribeStreamingClient } from "./TranscribeStreamingClient";
5
- var TranscribeStreaming = (function (_super) {
6
- __extends(TranscribeStreaming, _super);
7
- function TranscribeStreaming() {
8
- return _super !== null && _super.apply(this, arguments) || this;
9
- }
10
- TranscribeStreaming.prototype.startMedicalStreamTranscription = function (args, optionsOrCb, cb) {
11
- var command = new StartMedicalStreamTranscriptionCommand(args);
4
+ export class TranscribeStreaming extends TranscribeStreamingClient {
5
+ startMedicalStreamTranscription(args, optionsOrCb, cb) {
6
+ const command = new StartMedicalStreamTranscriptionCommand(args);
12
7
  if (typeof optionsOrCb === "function") {
13
8
  this.send(command, optionsOrCb);
14
9
  }
15
10
  else if (typeof cb === "function") {
16
11
  if (typeof optionsOrCb !== "object")
17
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
12
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
18
13
  this.send(command, optionsOrCb || {}, cb);
19
14
  }
20
15
  else {
21
16
  return this.send(command, optionsOrCb);
22
17
  }
23
- };
24
- TranscribeStreaming.prototype.startStreamTranscription = function (args, optionsOrCb, cb) {
25
- var command = new StartStreamTranscriptionCommand(args);
18
+ }
19
+ startStreamTranscription(args, optionsOrCb, cb) {
20
+ const command = new StartStreamTranscriptionCommand(args);
26
21
  if (typeof optionsOrCb === "function") {
27
22
  this.send(command, optionsOrCb);
28
23
  }
29
24
  else if (typeof cb === "function") {
30
25
  if (typeof optionsOrCb !== "object")
31
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
26
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
32
27
  this.send(command, optionsOrCb || {}, cb);
33
28
  }
34
29
  else {
35
30
  return this.send(command, optionsOrCb);
36
31
  }
37
- };
38
- return TranscribeStreaming;
39
- }(TranscribeStreamingClient));
40
- export { TranscribeStreaming };
32
+ }
33
+ }
@@ -1,4 +1,3 @@
1
- import { __extends } from "tslib";
2
1
  import { resolveEndpointsConfig, resolveRegionConfig, } from "@aws-sdk/config-resolver";
3
2
  import { resolveEventStreamSerdeConfig, } from "@aws-sdk/eventstream-serde-config-resolver";
4
3
  import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
@@ -12,35 +11,30 @@ import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-sig
12
11
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
13
12
  import { Client as __Client, } from "@aws-sdk/smithy-client";
14
13
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
15
- var TranscribeStreamingClient = (function (_super) {
16
- __extends(TranscribeStreamingClient, _super);
17
- function TranscribeStreamingClient(configuration) {
18
- var _this = this;
19
- var _config_0 = __getRuntimeConfig(configuration);
20
- var _config_1 = resolveRegionConfig(_config_0);
21
- var _config_2 = resolveEndpointsConfig(_config_1);
22
- var _config_3 = resolveRetryConfig(_config_2);
23
- var _config_4 = resolveHostHeaderConfig(_config_3);
24
- var _config_5 = resolveAwsAuthConfig(_config_4);
25
- var _config_6 = resolveEventStreamConfig(_config_5);
26
- var _config_7 = resolveWebSocketConfig(_config_6);
27
- var _config_8 = resolveUserAgentConfig(_config_7);
28
- var _config_9 = resolveEventStreamSerdeConfig(_config_8);
29
- _this = _super.call(this, _config_9) || this;
30
- _this.config = _config_9;
31
- _this.middlewareStack.use(getRetryPlugin(_this.config));
32
- _this.middlewareStack.use(getContentLengthPlugin(_this.config));
33
- _this.middlewareStack.use(getHostHeaderPlugin(_this.config));
34
- _this.middlewareStack.use(getLoggerPlugin(_this.config));
35
- _this.middlewareStack.use(getRecursionDetectionPlugin(_this.config));
36
- _this.middlewareStack.use(getAwsAuthPlugin(_this.config));
37
- _this.middlewareStack.use(getWebSocketPlugin(_this.config));
38
- _this.middlewareStack.use(getUserAgentPlugin(_this.config));
39
- return _this;
14
+ export class TranscribeStreamingClient extends __Client {
15
+ constructor(configuration) {
16
+ const _config_0 = __getRuntimeConfig(configuration);
17
+ const _config_1 = resolveRegionConfig(_config_0);
18
+ const _config_2 = resolveEndpointsConfig(_config_1);
19
+ const _config_3 = resolveRetryConfig(_config_2);
20
+ const _config_4 = resolveHostHeaderConfig(_config_3);
21
+ const _config_5 = resolveAwsAuthConfig(_config_4);
22
+ const _config_6 = resolveEventStreamConfig(_config_5);
23
+ const _config_7 = resolveWebSocketConfig(_config_6);
24
+ const _config_8 = resolveUserAgentConfig(_config_7);
25
+ const _config_9 = resolveEventStreamSerdeConfig(_config_8);
26
+ super(_config_9);
27
+ this.config = _config_9;
28
+ this.middlewareStack.use(getRetryPlugin(this.config));
29
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
30
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
31
+ this.middlewareStack.use(getLoggerPlugin(this.config));
32
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
33
+ this.middlewareStack.use(getAwsAuthPlugin(this.config));
34
+ this.middlewareStack.use(getWebSocketPlugin(this.config));
35
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
40
36
  }
41
- TranscribeStreamingClient.prototype.destroy = function () {
42
- _super.prototype.destroy.call(this);
43
- };
44
- return TranscribeStreamingClient;
45
- }(__Client));
46
- export { TranscribeStreamingClient };
37
+ destroy() {
38
+ super.destroy();
39
+ }
40
+ }
@@ -1,41 +1,34 @@
1
- import { __extends } from "tslib";
2
1
  import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
3
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
5
4
  import { StartMedicalStreamTranscriptionRequestFilterSensitiveLog, StartMedicalStreamTranscriptionResponseFilterSensitiveLog, } from "../models/models_0";
6
5
  import { deserializeAws_restJson1StartMedicalStreamTranscriptionCommand, serializeAws_restJson1StartMedicalStreamTranscriptionCommand, } from "../protocols/Aws_restJson1";
7
- var StartMedicalStreamTranscriptionCommand = (function (_super) {
8
- __extends(StartMedicalStreamTranscriptionCommand, _super);
9
- function StartMedicalStreamTranscriptionCommand(input) {
10
- var _this = _super.call(this) || this;
11
- _this.input = input;
12
- return _this;
6
+ export class StartMedicalStreamTranscriptionCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
13
10
  }
14
- StartMedicalStreamTranscriptionCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
11
+ resolveMiddleware(clientStack, configuration, options) {
15
12
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
16
13
  this.middlewareStack.use(getEventStreamPlugin(configuration));
17
- var stack = clientStack.concat(this.middlewareStack);
18
- var logger = configuration.logger;
19
- var clientName = "TranscribeStreamingClient";
20
- var commandName = "StartMedicalStreamTranscriptionCommand";
21
- var handlerExecutionContext = {
22
- logger: logger,
23
- clientName: clientName,
24
- commandName: commandName,
14
+ const stack = clientStack.concat(this.middlewareStack);
15
+ const { logger } = configuration;
16
+ const clientName = "TranscribeStreamingClient";
17
+ const commandName = "StartMedicalStreamTranscriptionCommand";
18
+ const handlerExecutionContext = {
19
+ logger,
20
+ clientName,
21
+ commandName,
25
22
  inputFilterSensitiveLog: StartMedicalStreamTranscriptionRequestFilterSensitiveLog,
26
23
  outputFilterSensitiveLog: StartMedicalStreamTranscriptionResponseFilterSensitiveLog,
27
24
  };
28
- var requestHandler = configuration.requestHandler;
29
- return stack.resolve(function (request) {
30
- return requestHandler.handle(request.request, options || {});
31
- }, handlerExecutionContext);
32
- };
33
- StartMedicalStreamTranscriptionCommand.prototype.serialize = function (input, context) {
25
+ const { requestHandler } = configuration;
26
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
27
+ }
28
+ serialize(input, context) {
34
29
  return serializeAws_restJson1StartMedicalStreamTranscriptionCommand(input, context);
35
- };
36
- StartMedicalStreamTranscriptionCommand.prototype.deserialize = function (output, context) {
30
+ }
31
+ deserialize(output, context) {
37
32
  return deserializeAws_restJson1StartMedicalStreamTranscriptionCommand(output, context);
38
- };
39
- return StartMedicalStreamTranscriptionCommand;
40
- }($Command));
41
- export { StartMedicalStreamTranscriptionCommand };
33
+ }
34
+ }
@@ -1,41 +1,34 @@
1
- import { __extends } from "tslib";
2
1
  import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
3
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
5
4
  import { StartStreamTranscriptionRequestFilterSensitiveLog, StartStreamTranscriptionResponseFilterSensitiveLog, } from "../models/models_0";
6
5
  import { deserializeAws_restJson1StartStreamTranscriptionCommand, serializeAws_restJson1StartStreamTranscriptionCommand, } from "../protocols/Aws_restJson1";
7
- var StartStreamTranscriptionCommand = (function (_super) {
8
- __extends(StartStreamTranscriptionCommand, _super);
9
- function StartStreamTranscriptionCommand(input) {
10
- var _this = _super.call(this) || this;
11
- _this.input = input;
12
- return _this;
6
+ export class StartStreamTranscriptionCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
13
10
  }
14
- StartStreamTranscriptionCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
11
+ resolveMiddleware(clientStack, configuration, options) {
15
12
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
16
13
  this.middlewareStack.use(getEventStreamPlugin(configuration));
17
- var stack = clientStack.concat(this.middlewareStack);
18
- var logger = configuration.logger;
19
- var clientName = "TranscribeStreamingClient";
20
- var commandName = "StartStreamTranscriptionCommand";
21
- var handlerExecutionContext = {
22
- logger: logger,
23
- clientName: clientName,
24
- commandName: commandName,
14
+ const stack = clientStack.concat(this.middlewareStack);
15
+ const { logger } = configuration;
16
+ const clientName = "TranscribeStreamingClient";
17
+ const commandName = "StartStreamTranscriptionCommand";
18
+ const handlerExecutionContext = {
19
+ logger,
20
+ clientName,
21
+ commandName,
25
22
  inputFilterSensitiveLog: StartStreamTranscriptionRequestFilterSensitiveLog,
26
23
  outputFilterSensitiveLog: StartStreamTranscriptionResponseFilterSensitiveLog,
27
24
  };
28
- var requestHandler = configuration.requestHandler;
29
- return stack.resolve(function (request) {
30
- return requestHandler.handle(request.request, options || {});
31
- }, handlerExecutionContext);
32
- };
33
- StartStreamTranscriptionCommand.prototype.serialize = function (input, context) {
25
+ const { requestHandler } = configuration;
26
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
27
+ }
28
+ serialize(input, context) {
34
29
  return serializeAws_restJson1StartStreamTranscriptionCommand(input, context);
35
- };
36
- StartStreamTranscriptionCommand.prototype.deserialize = function (output, context) {
30
+ }
31
+ deserialize(output, context) {
37
32
  return deserializeAws_restJson1StartStreamTranscriptionCommand(output, context);
38
- };
39
- return StartStreamTranscriptionCommand;
40
- }($Command));
41
- export { StartStreamTranscriptionCommand };
33
+ }
34
+ }
@@ -1,7 +1,6 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { getRegionInfo } from "@aws-sdk/config-resolver";
3
- var regionHash = {};
4
- var partitionHash = {
2
+ const regionHash = {};
3
+ const partitionHash = {
5
4
  aws: {
6
5
  regions: [
7
6
  "af-south-1",
@@ -129,8 +128,9 @@ var partitionHash = {
129
128
  ],
130
129
  },
131
130
  };
132
- export var defaultRegionInfoProvider = function (region, options) { return __awaiter(void 0, void 0, void 0, function () {
133
- return __generator(this, function (_a) {
134
- return [2, getRegionInfo(region, __assign(__assign({}, options), { signingService: "transcribe", regionHash: regionHash, partitionHash: partitionHash }))];
135
- });
136
- }); };
131
+ export const defaultRegionInfoProvider = async (region, options) => getRegionInfo(region, {
132
+ ...options,
133
+ signingService: "transcribe",
134
+ regionHash,
135
+ partitionHash,
136
+ });
@@ -1,12 +1,7 @@
1
- import { __extends } from "tslib";
2
1
  import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
3
- var TranscribeStreamingServiceException = (function (_super) {
4
- __extends(TranscribeStreamingServiceException, _super);
5
- function TranscribeStreamingServiceException(options) {
6
- var _this = _super.call(this, options) || this;
7
- Object.setPrototypeOf(_this, TranscribeStreamingServiceException.prototype);
8
- return _this;
2
+ export class TranscribeStreamingServiceException extends __ServiceException {
3
+ constructor(options) {
4
+ super(options);
5
+ Object.setPrototypeOf(this, TranscribeStreamingServiceException.prototype);
9
6
  }
10
- return TranscribeStreamingServiceException;
11
- }(__ServiceException));
12
- export { TranscribeStreamingServiceException };
7
+ }