@aws-sdk/client-transcribe-streaming 3.621.0 → 3.623.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.
Files changed (28) hide show
  1. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  2. package/dist-cjs/index.js +99 -37
  3. package/dist-cjs/runtimeConfig.shared.js +10 -0
  4. package/dist-es/TranscribeStreamingClient.js +21 -16
  5. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  6. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  7. package/dist-es/commands/StartCallAnalyticsStreamTranscriptionCommand.js +5 -1
  8. package/dist-es/commands/StartMedicalStreamTranscriptionCommand.js +5 -1
  9. package/dist-es/commands/StartStreamTranscriptionCommand.js +5 -1
  10. package/dist-es/runtimeConfig.shared.js +10 -0
  11. package/dist-es/runtimeExtensions.js +3 -0
  12. package/dist-types/TranscribeStreamingClient.d.ts +15 -14
  13. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  14. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  15. package/dist-types/extensionConfiguration.d.ts +2 -1
  16. package/dist-types/runtimeConfig.browser.d.ts +6 -4
  17. package/dist-types/runtimeConfig.d.ts +5 -3
  18. package/dist-types/runtimeConfig.native.d.ts +6 -4
  19. package/dist-types/runtimeConfig.shared.d.ts +2 -0
  20. package/dist-types/ts3.4/TranscribeStreamingClient.d.ts +18 -20
  21. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  22. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  23. package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  24. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +9 -9
  25. package/dist-types/ts3.4/runtimeConfig.d.ts +8 -8
  26. package/dist-types/ts3.4/runtimeConfig.native.d.ts +11 -11
  27. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
  28. package/package.json +11 -11
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveHttpAuthSchemeConfig = exports.defaultTranscribeStreamingHttpAuthSchemeProvider = exports.defaultTranscribeStreamingHttpAuthSchemeParametersProvider = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const util_middleware_1 = require("@smithy/util-middleware");
6
+ const defaultTranscribeStreamingHttpAuthSchemeParametersProvider = async (config, context, input) => {
7
+ return {
8
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
9
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
10
+ (() => {
11
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
12
+ })(),
13
+ };
14
+ };
15
+ exports.defaultTranscribeStreamingHttpAuthSchemeParametersProvider = defaultTranscribeStreamingHttpAuthSchemeParametersProvider;
16
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
17
+ return {
18
+ schemeId: "aws.auth#sigv4",
19
+ signingProperties: {
20
+ name: "transcribe",
21
+ region: authParameters.region,
22
+ },
23
+ propertiesExtractor: (config, context) => ({
24
+ signingProperties: {
25
+ config,
26
+ context,
27
+ },
28
+ }),
29
+ };
30
+ }
31
+ const defaultTranscribeStreamingHttpAuthSchemeProvider = (authParameters) => {
32
+ const options = [];
33
+ switch (authParameters.operation) {
34
+ default: {
35
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
36
+ }
37
+ }
38
+ return options;
39
+ };
40
+ exports.defaultTranscribeStreamingHttpAuthSchemeProvider = defaultTranscribeStreamingHttpAuthSchemeProvider;
41
+ const resolveHttpAuthSchemeConfig = (config) => {
42
+ const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
43
+ return {
44
+ ...config_0,
45
+ };
46
+ };
47
+ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
package/dist-cjs/index.js CHANGED
@@ -69,16 +69,16 @@ var import_middleware_eventstream = require("@aws-sdk/middleware-eventstream");
69
69
  var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
70
70
  var import_middleware_logger = require("@aws-sdk/middleware-logger");
71
71
  var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
72
- var import_middleware_sdk_transcribe_streaming = require("@aws-sdk/middleware-sdk-transcribe-streaming");
73
- var import_middleware_signing = require("@aws-sdk/middleware-signing");
74
72
  var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
75
73
  var import_middleware_websocket = require("@aws-sdk/middleware-websocket");
76
74
  var import_config_resolver = require("@smithy/config-resolver");
75
+ var import_core = require("@smithy/core");
77
76
  var import_eventstream_serde_config_resolver = require("@smithy/eventstream-serde-config-resolver");
78
77
  var import_middleware_content_length = require("@smithy/middleware-content-length");
79
78
  var import_middleware_endpoint = require("@smithy/middleware-endpoint");
80
79
  var import_middleware_retry = require("@smithy/middleware-retry");
81
80
 
81
+ var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
82
82
 
83
83
  // src/endpoint/EndpointParameters.ts
84
84
  var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
@@ -103,19 +103,62 @@ var import_runtimeConfig = require("././runtimeConfig");
103
103
  var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
104
104
  var import_protocol_http = require("@smithy/protocol-http");
105
105
  var import_smithy_client = require("@smithy/smithy-client");
106
+
107
+ // src/auth/httpAuthExtensionConfiguration.ts
108
+ var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
109
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
110
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
111
+ let _credentials = runtimeConfig.credentials;
112
+ return {
113
+ setHttpAuthScheme(httpAuthScheme) {
114
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
115
+ if (index === -1) {
116
+ _httpAuthSchemes.push(httpAuthScheme);
117
+ } else {
118
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
119
+ }
120
+ },
121
+ httpAuthSchemes() {
122
+ return _httpAuthSchemes;
123
+ },
124
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
125
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
126
+ },
127
+ httpAuthSchemeProvider() {
128
+ return _httpAuthSchemeProvider;
129
+ },
130
+ setCredentials(credentials) {
131
+ _credentials = credentials;
132
+ },
133
+ credentials() {
134
+ return _credentials;
135
+ }
136
+ };
137
+ }, "getHttpAuthExtensionConfiguration");
138
+ var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
139
+ return {
140
+ httpAuthSchemes: config.httpAuthSchemes(),
141
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
142
+ credentials: config.credentials()
143
+ };
144
+ }, "resolveHttpAuthRuntimeConfig");
145
+
146
+ // src/runtimeExtensions.ts
106
147
  var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
107
148
  var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
108
149
  const extensionConfiguration = {
109
150
  ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
110
151
  ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
111
- ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
152
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
153
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
112
154
  };
113
155
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
114
156
  return {
115
157
  ...runtimeConfig,
116
158
  ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
117
159
  ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
118
- ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
160
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
161
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
119
162
  };
120
163
  }, "resolveRuntimeExtensions");
121
164
 
@@ -124,26 +167,33 @@ var _TranscribeStreamingClient = class _TranscribeStreamingClient extends import
124
167
  constructor(...[configuration]) {
125
168
  const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
126
169
  const _config_1 = resolveClientEndpointParameters(_config_0);
127
- const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
128
- const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
129
- const _config_4 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_3);
130
- const _config_5 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_4);
131
- const _config_6 = (0, import_middleware_eventstream.resolveEventStreamConfig)(_config_5);
132
- const _config_7 = (0, import_middleware_websocket.resolveWebSocketConfig)(_config_6);
133
- const _config_8 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_7);
134
- const _config_9 = (0, import_middleware_retry.resolveRetryConfig)(_config_8);
135
- const _config_10 = (0, import_eventstream_serde_config_resolver.resolveEventStreamSerdeConfig)(_config_9);
170
+ const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
171
+ const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
172
+ const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
173
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
174
+ const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
175
+ const _config_7 = (0, import_eventstream_serde_config_resolver.resolveEventStreamSerdeConfig)(_config_6);
176
+ const _config_8 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_7);
177
+ const _config_9 = (0, import_middleware_eventstream.resolveEventStreamConfig)(_config_8);
178
+ const _config_10 = (0, import_middleware_websocket.resolveWebSocketConfig)(_config_9);
136
179
  const _config_11 = resolveRuntimeExtensions(_config_10, (configuration == null ? void 0 : configuration.extensions) || []);
137
180
  super(_config_11);
138
181
  this.config = _config_11;
139
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
140
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
141
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
142
- this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
143
- this.middlewareStack.use((0, import_middleware_sdk_transcribe_streaming.getTranscribeStreamingPlugin)(this.config));
144
182
  this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
145
183
  this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
146
184
  this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
185
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
186
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
187
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
188
+ this.middlewareStack.use(
189
+ (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
190
+ httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultTranscribeStreamingHttpAuthSchemeParametersProvider,
191
+ identityProviderConfigProvider: async (config) => new import_core.DefaultIdentityProviderConfig({
192
+ "aws.auth#sigv4": config.credentials
193
+ })
194
+ })
195
+ );
196
+ this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
147
197
  }
148
198
  /**
149
199
  * Destroy underlying resources, like sockets. It's usually not necessary to do this.
@@ -162,6 +212,7 @@ var TranscribeStreamingClient = _TranscribeStreamingClient;
162
212
 
163
213
  // src/commands/StartCallAnalyticsStreamTranscriptionCommand.ts
164
214
 
215
+ var import_middleware_sdk_transcribe_streaming = require("@aws-sdk/middleware-sdk-transcribe-streaming");
165
216
 
166
217
 
167
218
  var import_middleware_serde = require("@smithy/middleware-serde");
@@ -503,11 +554,11 @@ var StartStreamTranscriptionResponseFilterSensitiveLog = /* @__PURE__ */ __name(
503
554
  }), "StartStreamTranscriptionResponseFilterSensitiveLog");
504
555
 
505
556
  // src/protocols/Aws_restJson1.ts
506
- var import_core = require("@aws-sdk/core");
507
- var import_core2 = require("@smithy/core");
557
+ var import_core2 = require("@aws-sdk/core");
558
+
508
559
 
509
560
  var se_StartCallAnalyticsStreamTranscriptionCommand = /* @__PURE__ */ __name(async (input, context) => {
510
- const b = (0, import_core2.requestBuilder)(input, context);
561
+ const b = (0, import_core.requestBuilder)(input, context);
511
562
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
512
563
  "content-type": "application/json",
513
564
  [_xatlc]: input[_LC],
@@ -533,7 +584,7 @@ var se_StartCallAnalyticsStreamTranscriptionCommand = /* @__PURE__ */ __name(asy
533
584
  return b.build();
534
585
  }, "se_StartCallAnalyticsStreamTranscriptionCommand");
535
586
  var se_StartMedicalStreamTranscriptionCommand = /* @__PURE__ */ __name(async (input, context) => {
536
- const b = (0, import_core2.requestBuilder)(input, context);
587
+ const b = (0, import_core.requestBuilder)(input, context);
537
588
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
538
589
  "content-type": "application/json",
539
590
  [_xatlc]: input[_LC],
@@ -557,7 +608,7 @@ var se_StartMedicalStreamTranscriptionCommand = /* @__PURE__ */ __name(async (in
557
608
  return b.build();
558
609
  }, "se_StartMedicalStreamTranscriptionCommand");
559
610
  var se_StartStreamTranscriptionCommand = /* @__PURE__ */ __name(async (input, context) => {
560
- const b = (0, import_core2.requestBuilder)(input, context);
611
+ const b = (0, import_core.requestBuilder)(input, context);
561
612
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
562
613
  "content-type": "application/json",
563
614
  [_xatlc]: input[_LC],
@@ -676,9 +727,9 @@ var de_StartStreamTranscriptionCommand = /* @__PURE__ */ __name(async (output, c
676
727
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
677
728
  const parsedOutput = {
678
729
  ...output,
679
- body: await (0, import_core.parseJsonErrorBody)(output.body, context)
730
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
680
731
  };
681
- const errorCode = (0, import_core.loadRestJsonErrorCode)(output, parsedOutput.body);
732
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
682
733
  switch (errorCode) {
683
734
  case "BadRequestException":
684
735
  case "com.amazonaws.transcribestreaming#BadRequestException":
@@ -923,59 +974,59 @@ var de_TranscriptResultStream = /* @__PURE__ */ __name((output, context) => {
923
974
  var de_BadRequestException_event = /* @__PURE__ */ __name(async (output, context) => {
924
975
  const parsedOutput = {
925
976
  ...output,
926
- body: await (0, import_core.parseJsonBody)(output.body, context)
977
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
927
978
  };
928
979
  return de_BadRequestExceptionRes(parsedOutput, context);
929
980
  }, "de_BadRequestException_event");
930
981
  var de_CategoryEvent_event = /* @__PURE__ */ __name(async (output, context) => {
931
982
  const contents = {};
932
- const data = await (0, import_core.parseJsonBody)(output.body, context);
983
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
933
984
  Object.assign(contents, (0, import_smithy_client._json)(data));
934
985
  return contents;
935
986
  }, "de_CategoryEvent_event");
936
987
  var de_ConflictException_event = /* @__PURE__ */ __name(async (output, context) => {
937
988
  const parsedOutput = {
938
989
  ...output,
939
- body: await (0, import_core.parseJsonBody)(output.body, context)
990
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
940
991
  };
941
992
  return de_ConflictExceptionRes(parsedOutput, context);
942
993
  }, "de_ConflictException_event");
943
994
  var de_InternalFailureException_event = /* @__PURE__ */ __name(async (output, context) => {
944
995
  const parsedOutput = {
945
996
  ...output,
946
- body: await (0, import_core.parseJsonBody)(output.body, context)
997
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
947
998
  };
948
999
  return de_InternalFailureExceptionRes(parsedOutput, context);
949
1000
  }, "de_InternalFailureException_event");
950
1001
  var de_LimitExceededException_event = /* @__PURE__ */ __name(async (output, context) => {
951
1002
  const parsedOutput = {
952
1003
  ...output,
953
- body: await (0, import_core.parseJsonBody)(output.body, context)
1004
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
954
1005
  };
955
1006
  return de_LimitExceededExceptionRes(parsedOutput, context);
956
1007
  }, "de_LimitExceededException_event");
957
1008
  var de_MedicalTranscriptEvent_event = /* @__PURE__ */ __name(async (output, context) => {
958
1009
  const contents = {};
959
- const data = await (0, import_core.parseJsonBody)(output.body, context);
1010
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
960
1011
  Object.assign(contents, de_MedicalTranscriptEvent(data, context));
961
1012
  return contents;
962
1013
  }, "de_MedicalTranscriptEvent_event");
963
1014
  var de_ServiceUnavailableException_event = /* @__PURE__ */ __name(async (output, context) => {
964
1015
  const parsedOutput = {
965
1016
  ...output,
966
- body: await (0, import_core.parseJsonBody)(output.body, context)
1017
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
967
1018
  };
968
1019
  return de_ServiceUnavailableExceptionRes(parsedOutput, context);
969
1020
  }, "de_ServiceUnavailableException_event");
970
1021
  var de_TranscriptEvent_event = /* @__PURE__ */ __name(async (output, context) => {
971
1022
  const contents = {};
972
- const data = await (0, import_core.parseJsonBody)(output.body, context);
1023
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
973
1024
  Object.assign(contents, de_TranscriptEvent(data, context));
974
1025
  return contents;
975
1026
  }, "de_TranscriptEvent_event");
976
1027
  var de_UtteranceEvent_event = /* @__PURE__ */ __name(async (output, context) => {
977
1028
  const contents = {};
978
- const data = await (0, import_core.parseJsonBody)(output.body, context);
1029
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
979
1030
  Object.assign(contents, de_UtteranceEvent(data, context));
980
1031
  return contents;
981
1032
  }, "de_UtteranceEvent_event");
@@ -1249,7 +1300,10 @@ var _StartCallAnalyticsStreamTranscriptionCommand = class _StartCallAnalyticsStr
1249
1300
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1250
1301
  (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1251
1302
  (0, import_middleware_eventstream.getEventStreamPlugin)(config),
1252
- (0, import_middleware_websocket.getWebSocketPlugin)(config, { headerPrefix: "x-amzn-transcribe-" })
1303
+ (0, import_middleware_websocket.getWebSocketPlugin)(config, {
1304
+ headerPrefix: "x-amzn-transcribe-"
1305
+ }),
1306
+ (0, import_middleware_sdk_transcribe_streaming.getTranscribeStreamingPlugin)(config)
1253
1307
  ];
1254
1308
  }).s("Transcribe", "StartCallAnalyticsStreamTranscription", {
1255
1309
  /**
@@ -1273,6 +1327,7 @@ var StartCallAnalyticsStreamTranscriptionCommand = _StartCallAnalyticsStreamTran
1273
1327
 
1274
1328
 
1275
1329
 
1330
+
1276
1331
  var _StartMedicalStreamTranscriptionCommand = class _StartMedicalStreamTranscriptionCommand extends import_smithy_client.Command.classBuilder().ep({
1277
1332
  ...commonParams
1278
1333
  }).m(function(Command, cs, config, o) {
@@ -1280,7 +1335,10 @@ var _StartMedicalStreamTranscriptionCommand = class _StartMedicalStreamTranscrip
1280
1335
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1281
1336
  (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1282
1337
  (0, import_middleware_eventstream.getEventStreamPlugin)(config),
1283
- (0, import_middleware_websocket.getWebSocketPlugin)(config, { headerPrefix: "x-amzn-transcribe-" })
1338
+ (0, import_middleware_websocket.getWebSocketPlugin)(config, {
1339
+ headerPrefix: "x-amzn-transcribe-"
1340
+ }),
1341
+ (0, import_middleware_sdk_transcribe_streaming.getTranscribeStreamingPlugin)(config)
1284
1342
  ];
1285
1343
  }).s("Transcribe", "StartMedicalStreamTranscription", {
1286
1344
  /**
@@ -1304,6 +1362,7 @@ var StartMedicalStreamTranscriptionCommand = _StartMedicalStreamTranscriptionCom
1304
1362
 
1305
1363
 
1306
1364
 
1365
+
1307
1366
  var _StartStreamTranscriptionCommand = class _StartStreamTranscriptionCommand extends import_smithy_client.Command.classBuilder().ep({
1308
1367
  ...commonParams
1309
1368
  }).m(function(Command, cs, config, o) {
@@ -1311,7 +1370,10 @@ var _StartStreamTranscriptionCommand = class _StartStreamTranscriptionCommand ex
1311
1370
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1312
1371
  (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1313
1372
  (0, import_middleware_eventstream.getEventStreamPlugin)(config),
1314
- (0, import_middleware_websocket.getWebSocketPlugin)(config, { headerPrefix: "x-amzn-transcribe-" })
1373
+ (0, import_middleware_websocket.getWebSocketPlugin)(config, {
1374
+ headerPrefix: "x-amzn-transcribe-"
1375
+ }),
1376
+ (0, import_middleware_sdk_transcribe_streaming.getTranscribeStreamingPlugin)(config)
1315
1377
  ];
1316
1378
  }).s("Transcribe", "StartStreamTranscription", {
1317
1379
  /**
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
4
5
  const smithy_client_1 = require("@smithy/smithy-client");
5
6
  const url_parser_1 = require("@smithy/url-parser");
6
7
  const util_base64_1 = require("@smithy/util-base64");
7
8
  const util_utf8_1 = require("@smithy/util-utf8");
9
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
8
10
  const endpointResolver_1 = require("./endpoint/endpointResolver");
9
11
  const getRuntimeConfig = (config) => {
10
12
  return {
@@ -14,6 +16,14 @@ const getRuntimeConfig = (config) => {
14
16
  disableHostPrefix: config?.disableHostPrefix ?? false,
15
17
  endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
16
18
  extensions: config?.extensions ?? [],
19
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultTranscribeStreamingHttpAuthSchemeProvider,
20
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
21
+ {
22
+ schemeId: "aws.auth#sigv4",
23
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
24
+ signer: new core_1.AwsSdkSigV4Signer(),
25
+ },
26
+ ],
17
27
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
18
28
  serviceId: config?.serviceId ?? "Transcribe Streaming",
19
29
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
@@ -2,16 +2,16 @@ import { resolveEventStreamConfig, } from "@aws-sdk/middleware-eventstream";
2
2
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
3
3
  import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
4
4
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
5
- import { getTranscribeStreamingPlugin } from "@aws-sdk/middleware-sdk-transcribe-streaming";
6
- import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
7
5
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
8
6
  import { resolveWebSocketConfig } from "@aws-sdk/middleware-websocket";
9
7
  import { resolveRegionConfig } from "@smithy/config-resolver";
8
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
10
9
  import { resolveEventStreamSerdeConfig, } from "@smithy/eventstream-serde-config-resolver";
11
10
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
12
11
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
13
12
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
14
13
  import { Client as __Client, } from "@smithy/smithy-client";
14
+ import { defaultTranscribeStreamingHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
15
15
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
16
16
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
17
17
  import { resolveRuntimeExtensions } from "./runtimeExtensions";
@@ -20,26 +20,31 @@ export class TranscribeStreamingClient extends __Client {
20
20
  constructor(...[configuration]) {
21
21
  const _config_0 = __getRuntimeConfig(configuration || {});
22
22
  const _config_1 = resolveClientEndpointParameters(_config_0);
23
- const _config_2 = resolveRegionConfig(_config_1);
24
- const _config_3 = resolveEndpointConfig(_config_2);
25
- const _config_4 = resolveHostHeaderConfig(_config_3);
26
- const _config_5 = resolveAwsAuthConfig(_config_4);
27
- const _config_6 = resolveEventStreamConfig(_config_5);
28
- const _config_7 = resolveWebSocketConfig(_config_6);
29
- const _config_8 = resolveUserAgentConfig(_config_7);
30
- const _config_9 = resolveRetryConfig(_config_8);
31
- const _config_10 = resolveEventStreamSerdeConfig(_config_9);
23
+ const _config_2 = resolveUserAgentConfig(_config_1);
24
+ const _config_3 = resolveRetryConfig(_config_2);
25
+ const _config_4 = resolveRegionConfig(_config_3);
26
+ const _config_5 = resolveHostHeaderConfig(_config_4);
27
+ const _config_6 = resolveEndpointConfig(_config_5);
28
+ const _config_7 = resolveEventStreamSerdeConfig(_config_6);
29
+ const _config_8 = resolveHttpAuthSchemeConfig(_config_7);
30
+ const _config_9 = resolveEventStreamConfig(_config_8);
31
+ const _config_10 = resolveWebSocketConfig(_config_9);
32
32
  const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []);
33
33
  super(_config_11);
34
34
  this.config = _config_11;
35
- this.middlewareStack.use(getHostHeaderPlugin(this.config));
36
- this.middlewareStack.use(getLoggerPlugin(this.config));
37
- this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
38
- this.middlewareStack.use(getAwsAuthPlugin(this.config));
39
- this.middlewareStack.use(getTranscribeStreamingPlugin(this.config));
40
35
  this.middlewareStack.use(getUserAgentPlugin(this.config));
41
36
  this.middlewareStack.use(getRetryPlugin(this.config));
42
37
  this.middlewareStack.use(getContentLengthPlugin(this.config));
38
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
39
+ this.middlewareStack.use(getLoggerPlugin(this.config));
40
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
41
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
42
+ httpAuthSchemeParametersProvider: defaultTranscribeStreamingHttpAuthSchemeParametersProvider,
43
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
44
+ "aws.auth#sigv4": config.credentials,
45
+ }),
46
+ }));
47
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
43
48
  }
44
49
  destroy() {
45
50
  super.destroy();
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _credentials = runtimeConfig.credentials;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setCredentials(credentials) {
25
+ _credentials = credentials;
26
+ },
27
+ credentials() {
28
+ return _credentials;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ credentials: config.credentials(),
37
+ };
38
+ };
@@ -0,0 +1,41 @@
1
+ import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
3
+ export const defaultTranscribeStreamingHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
+ return {
5
+ operation: getSmithyContext(context).operation,
6
+ region: (await normalizeProvider(config.region)()) ||
7
+ (() => {
8
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
9
+ })(),
10
+ };
11
+ };
12
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
13
+ return {
14
+ schemeId: "aws.auth#sigv4",
15
+ signingProperties: {
16
+ name: "transcribe",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ export const defaultTranscribeStreamingHttpAuthSchemeProvider = (authParameters) => {
28
+ const options = [];
29
+ switch (authParameters.operation) {
30
+ default: {
31
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
32
+ }
33
+ }
34
+ return options;
35
+ };
36
+ export const resolveHttpAuthSchemeConfig = (config) => {
37
+ const config_0 = resolveAwsSdkSigV4Config(config);
38
+ return {
39
+ ...config_0,
40
+ };
41
+ };
@@ -1,4 +1,5 @@
1
1
  import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
2
+ import { getTranscribeStreamingPlugin } from "@aws-sdk/middleware-sdk-transcribe-streaming";
2
3
  import { getWebSocketPlugin } from "@aws-sdk/middleware-websocket";
3
4
  import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4
5
  import { getSerdePlugin } from "@smithy/middleware-serde";
@@ -17,7 +18,10 @@ export class StartCallAnalyticsStreamTranscriptionCommand extends $Command
17
18
  getSerdePlugin(config, this.serialize, this.deserialize),
18
19
  getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
19
20
  getEventStreamPlugin(config),
20
- getWebSocketPlugin(config, { headerPrefix: "x-amzn-transcribe-" }),
21
+ getWebSocketPlugin(config, {
22
+ headerPrefix: "x-amzn-transcribe-",
23
+ }),
24
+ getTranscribeStreamingPlugin(config),
21
25
  ];
22
26
  })
23
27
  .s("Transcribe", "StartCallAnalyticsStreamTranscription", {
@@ -1,4 +1,5 @@
1
1
  import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
2
+ import { getTranscribeStreamingPlugin } from "@aws-sdk/middleware-sdk-transcribe-streaming";
2
3
  import { getWebSocketPlugin } from "@aws-sdk/middleware-websocket";
3
4
  import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4
5
  import { getSerdePlugin } from "@smithy/middleware-serde";
@@ -17,7 +18,10 @@ export class StartMedicalStreamTranscriptionCommand extends $Command
17
18
  getSerdePlugin(config, this.serialize, this.deserialize),
18
19
  getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
19
20
  getEventStreamPlugin(config),
20
- getWebSocketPlugin(config, { headerPrefix: "x-amzn-transcribe-" }),
21
+ getWebSocketPlugin(config, {
22
+ headerPrefix: "x-amzn-transcribe-",
23
+ }),
24
+ getTranscribeStreamingPlugin(config),
21
25
  ];
22
26
  })
23
27
  .s("Transcribe", "StartMedicalStreamTranscription", {
@@ -1,4 +1,5 @@
1
1
  import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
2
+ import { getTranscribeStreamingPlugin } from "@aws-sdk/middleware-sdk-transcribe-streaming";
2
3
  import { getWebSocketPlugin } from "@aws-sdk/middleware-websocket";
3
4
  import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4
5
  import { getSerdePlugin } from "@smithy/middleware-serde";
@@ -17,7 +18,10 @@ export class StartStreamTranscriptionCommand extends $Command
17
18
  getSerdePlugin(config, this.serialize, this.deserialize),
18
19
  getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
19
20
  getEventStreamPlugin(config),
20
- getWebSocketPlugin(config, { headerPrefix: "x-amzn-transcribe-" }),
21
+ getWebSocketPlugin(config, {
22
+ headerPrefix: "x-amzn-transcribe-",
23
+ }),
24
+ getTranscribeStreamingPlugin(config),
21
25
  ];
22
26
  })
23
27
  .s("Transcribe", "StartStreamTranscription", {
@@ -1,7 +1,9 @@
1
+ import { AwsSdkSigV4Signer } from "@aws-sdk/core";
1
2
  import { NoOpLogger } from "@smithy/smithy-client";
2
3
  import { parseUrl } from "@smithy/url-parser";
3
4
  import { fromBase64, toBase64 } from "@smithy/util-base64";
4
5
  import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
6
+ import { defaultTranscribeStreamingHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
5
7
  import { defaultEndpointResolver } from "./endpoint/endpointResolver";
6
8
  export const getRuntimeConfig = (config) => {
7
9
  return {
@@ -11,6 +13,14 @@ export const getRuntimeConfig = (config) => {
11
13
  disableHostPrefix: config?.disableHostPrefix ?? false,
12
14
  endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
13
15
  extensions: config?.extensions ?? [],
16
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultTranscribeStreamingHttpAuthSchemeProvider,
17
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
18
+ {
19
+ schemeId: "aws.auth#sigv4",
20
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
21
+ signer: new AwsSdkSigV4Signer(),
22
+ },
23
+ ],
14
24
  logger: config?.logger ?? new NoOpLogger(),
15
25
  serviceId: config?.serviceId ?? "Transcribe Streaming",
16
26
  urlParser: config?.urlParser ?? parseUrl,
@@ -1,12 +1,14 @@
1
1
  import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
2
2
  import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
3
3
  import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
4
+ import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
4
5
  const asPartial = (t) => t;
5
6
  export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
6
7
  const extensionConfiguration = {
7
8
  ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
8
9
  ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
9
10
  ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
11
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
10
12
  };
11
13
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
12
14
  return {
@@ -14,5 +16,6 @@ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
14
16
  ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
15
17
  ...resolveDefaultRuntimeConfig(extensionConfiguration),
16
18
  ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
19
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration),
17
20
  };
18
21
  };