@aws-sdk/client-lex-runtime-v2 3.1068.0 → 3.1070.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.
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveHttpAuthSchemeConfig = exports.defaultLexRuntimeV2HttpAuthSchemeProvider = exports.defaultLexRuntimeV2HttpAuthSchemeParametersProvider = void 0;
4
- const httpAuthSchemes_1 = require("@aws-sdk/core/httpAuthSchemes");
5
- const client_1 = require("@smithy/core/client");
6
- const defaultLexRuntimeV2HttpAuthSchemeParametersProvider = async (config, context, input) => {
1
+ const { resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
2
+ const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
3
+ exports.defaultLexRuntimeV2HttpAuthSchemeParametersProvider = async (config, context, input) => {
7
4
  return {
8
- operation: (0, client_1.getSmithyContext)(context).operation,
9
- region: await (0, client_1.normalizeProvider)(config.region)() || (() => {
5
+ operation: getSmithyContext(context).operation,
6
+ region: await normalizeProvider(config.region)() || (() => {
10
7
  throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
11
8
  })(),
12
9
  };
13
10
  };
14
- exports.defaultLexRuntimeV2HttpAuthSchemeParametersProvider = defaultLexRuntimeV2HttpAuthSchemeParametersProvider;
15
11
  function createAwsAuthSigv4HttpAuthOption(authParameters) {
16
12
  return {
17
13
  schemeId: "aws.auth#sigv4",
@@ -27,7 +23,7 @@ function createAwsAuthSigv4HttpAuthOption(authParameters) {
27
23
  }),
28
24
  };
29
25
  }
30
- const defaultLexRuntimeV2HttpAuthSchemeProvider = (authParameters) => {
26
+ exports.defaultLexRuntimeV2HttpAuthSchemeProvider = (authParameters) => {
31
27
  const options = [];
32
28
  switch (authParameters.operation) {
33
29
  default: {
@@ -36,11 +32,9 @@ const defaultLexRuntimeV2HttpAuthSchemeProvider = (authParameters) => {
36
32
  }
37
33
  return options;
38
34
  };
39
- exports.defaultLexRuntimeV2HttpAuthSchemeProvider = defaultLexRuntimeV2HttpAuthSchemeProvider;
40
- const resolveHttpAuthSchemeConfig = (config) => {
41
- const config_0 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4Config)(config);
35
+ exports.resolveHttpAuthSchemeConfig = (config) => {
36
+ const config_0 = resolveAwsSdkSigV4Config(config);
42
37
  return Object.assign(config_0, {
43
- authSchemePreference: (0, client_1.normalizeProvider)(config.authSchemePreference ?? []),
38
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
44
39
  });
45
40
  };
46
- exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bdd = void 0;
4
- const endpoints_1 = require("@smithy/core/endpoints");
1
+ const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
5
2
  const k = "ref";
6
3
  const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
7
4
  const _data = {
@@ -46,4 +43,4 @@ const nodes = new Int32Array([
46
43
  3, r + 1, 13,
47
44
  4, r + 2, r + 3,
48
45
  ]);
49
- exports.bdd = endpoints_1.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
46
+ exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
@@ -1,18 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultEndpointResolver = void 0;
4
- const client_1 = require("@aws-sdk/core/client");
5
- const endpoints_1 = require("@smithy/core/endpoints");
6
- const bdd_1 = require("./bdd");
7
- const cache = new endpoints_1.EndpointCache({
1
+ const { awsEndpointFunctions } = require("@aws-sdk/core/client");
2
+ const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
3
+ const { bdd } = require("./bdd");
4
+ const cache = new EndpointCache({
8
5
  size: 50,
9
6
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
10
7
  });
11
- const defaultEndpointResolver = (endpointParams, context = {}) => {
12
- return cache.get(endpointParams, () => (0, endpoints_1.decideEndpoint)(bdd_1.bdd, {
8
+ exports.defaultEndpointResolver = (endpointParams, context = {}) => {
9
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
13
10
  endpointParams: endpointParams,
14
11
  logger: context.logger,
15
12
  }));
16
13
  };
17
- exports.defaultEndpointResolver = defaultEndpointResolver;
18
- endpoints_1.customEndpointFunctions.aws = client_1.awsEndpointFunctions;
14
+ customEndpointFunctions.aws = awsEndpointFunctions;
package/dist-cjs/index.js CHANGED
@@ -1,20 +1,23 @@
1
- 'use strict';
2
-
3
- var client$1 = require('@aws-sdk/core/client');
4
- var middlewareEventstream = require('@aws-sdk/middleware-eventstream');
5
- var core = require('@smithy/core');
6
- var client = require('@smithy/core/client');
7
- var config = require('@smithy/core/config');
8
- var endpoints = require('@smithy/core/endpoints');
9
- var eventStreams = require('@smithy/core/event-streams');
10
- var protocols = require('@smithy/core/protocols');
11
- var retry = require('@smithy/core/retry');
12
- var schema = require('@smithy/core/schema');
13
- var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
- var runtimeConfig = require('./runtimeConfig');
15
- var schemas_0 = require('./schemas/schemas_0');
16
- var errors = require('./models/errors');
17
- var LexRuntimeV2ServiceException = require('./models/LexRuntimeV2ServiceException');
1
+ var __exportStar = (m, e) => { Object.assign(e, m); };
2
+ const { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
3
+ const { resolveEventStreamConfig, getEventStreamPlugin } = require("@aws-sdk/middleware-eventstream");
4
+ const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin } = require("@smithy/core");
5
+ const { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
6
+ exports.$Command = Command;
7
+ exports.__Client = Client;
8
+ const { resolveRegionConfig } = require("@smithy/core/config");
9
+ const { resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
10
+ const { resolveEventStreamSerdeConfig } = require("@smithy/core/event-streams");
11
+ const { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
12
+ const { resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
13
+ const { getSchemaSerdePlugin } = require("@smithy/core/schema");
14
+ const { resolveHttpAuthSchemeConfig, defaultLexRuntimeV2HttpAuthSchemeParametersProvider } = require("./auth/httpAuthSchemeProvider");
15
+ const { getRuntimeConfig } = require("./runtimeConfig");
16
+ const { DeleteSession$, GetSession$, PutSession$, RecognizeText$, RecognizeUtterance$, StartConversation$ } = require("./schemas/schemas_0");
17
+ __exportStar(require("./schemas/schemas_0"), exports);
18
+ __exportStar(require("./models/errors"), exports);
19
+ const { LexRuntimeV2ServiceException } = require("./models/LexRuntimeV2ServiceException");
20
+ exports.LexRuntimeV2ServiceException = LexRuntimeV2ServiceException;
18
21
 
19
22
  const resolveClientEndpointParameters = (options) => {
20
23
  return Object.assign(options, {
@@ -70,115 +73,115 @@ const resolveHttpAuthRuntimeConfig = (config) => {
70
73
  };
71
74
 
72
75
  const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
73
- const extensionConfiguration = Object.assign(client$1.getAwsRegionExtensionConfiguration(runtimeConfig), client.getDefaultExtensionConfiguration(runtimeConfig), protocols.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
76
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
74
77
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
75
- return Object.assign(runtimeConfig, client$1.resolveAwsRegionExtensionConfiguration(extensionConfiguration), client.resolveDefaultRuntimeConfig(extensionConfiguration), protocols.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
78
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
76
79
  };
77
80
 
78
- class LexRuntimeV2Client extends client.Client {
81
+ class LexRuntimeV2Client extends Client {
79
82
  config;
80
83
  constructor(...[configuration]) {
81
- const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
84
+ const _config_0 = getRuntimeConfig(configuration || {});
82
85
  super(_config_0);
83
86
  this.initConfig = _config_0;
84
87
  const _config_1 = resolveClientEndpointParameters(_config_0);
85
- const _config_2 = client$1.resolveUserAgentConfig(_config_1);
86
- const _config_3 = retry.resolveRetryConfig(_config_2);
87
- const _config_4 = config.resolveRegionConfig(_config_3);
88
- const _config_5 = client$1.resolveHostHeaderConfig(_config_4);
89
- const _config_6 = endpoints.resolveEndpointConfig(_config_5);
90
- const _config_7 = eventStreams.resolveEventStreamSerdeConfig(_config_6);
91
- const _config_8 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_7);
92
- const _config_9 = middlewareEventstream.resolveEventStreamConfig(_config_8);
88
+ const _config_2 = resolveUserAgentConfig(_config_1);
89
+ const _config_3 = resolveRetryConfig(_config_2);
90
+ const _config_4 = resolveRegionConfig(_config_3);
91
+ const _config_5 = resolveHostHeaderConfig(_config_4);
92
+ const _config_6 = resolveEndpointConfig(_config_5);
93
+ const _config_7 = resolveEventStreamSerdeConfig(_config_6);
94
+ const _config_8 = resolveHttpAuthSchemeConfig(_config_7);
95
+ const _config_9 = resolveEventStreamConfig(_config_8);
93
96
  const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []);
94
97
  this.config = _config_10;
95
- this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
96
- this.middlewareStack.use(client$1.getUserAgentPlugin(this.config));
97
- this.middlewareStack.use(retry.getRetryPlugin(this.config));
98
- this.middlewareStack.use(protocols.getContentLengthPlugin(this.config));
99
- this.middlewareStack.use(client$1.getHostHeaderPlugin(this.config));
100
- this.middlewareStack.use(client$1.getLoggerPlugin(this.config));
101
- this.middlewareStack.use(client$1.getRecursionDetectionPlugin(this.config));
102
- this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
103
- httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultLexRuntimeV2HttpAuthSchemeParametersProvider,
104
- identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
98
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
99
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
100
+ this.middlewareStack.use(getRetryPlugin(this.config));
101
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
102
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
103
+ this.middlewareStack.use(getLoggerPlugin(this.config));
104
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
105
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
106
+ httpAuthSchemeParametersProvider: defaultLexRuntimeV2HttpAuthSchemeParametersProvider,
107
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
105
108
  "aws.auth#sigv4": config.credentials,
106
109
  }),
107
110
  }));
108
- this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
111
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
109
112
  }
110
113
  destroy() {
111
114
  super.destroy();
112
115
  }
113
116
  }
114
117
 
115
- class DeleteSessionCommand extends client.Command
118
+ class DeleteSessionCommand extends Command
116
119
  .classBuilder()
117
120
  .ep(commonParams)
118
121
  .m(function (Command, cs, config, o) {
119
- return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
122
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
120
123
  })
121
124
  .s("AWSDeepSenseRunTimeServiceApi2_0", "DeleteSession", {})
122
125
  .n("LexRuntimeV2Client", "DeleteSessionCommand")
123
- .sc(schemas_0.DeleteSession$)
126
+ .sc(DeleteSession$)
124
127
  .build() {
125
128
  }
126
129
 
127
- class GetSessionCommand extends client.Command
130
+ class GetSessionCommand extends Command
128
131
  .classBuilder()
129
132
  .ep(commonParams)
130
133
  .m(function (Command, cs, config, o) {
131
- return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
134
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
132
135
  })
133
136
  .s("AWSDeepSenseRunTimeServiceApi2_0", "GetSession", {})
134
137
  .n("LexRuntimeV2Client", "GetSessionCommand")
135
- .sc(schemas_0.GetSession$)
138
+ .sc(GetSession$)
136
139
  .build() {
137
140
  }
138
141
 
139
- class PutSessionCommand extends client.Command
142
+ class PutSessionCommand extends Command
140
143
  .classBuilder()
141
144
  .ep(commonParams)
142
145
  .m(function (Command, cs, config, o) {
143
- return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
146
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
144
147
  })
145
148
  .s("AWSDeepSenseRunTimeServiceApi2_0", "PutSession", {})
146
149
  .n("LexRuntimeV2Client", "PutSessionCommand")
147
- .sc(schemas_0.PutSession$)
150
+ .sc(PutSession$)
148
151
  .build() {
149
152
  }
150
153
 
151
- class RecognizeTextCommand extends client.Command
154
+ class RecognizeTextCommand extends Command
152
155
  .classBuilder()
153
156
  .ep(commonParams)
154
157
  .m(function (Command, cs, config, o) {
155
- return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
158
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
156
159
  })
157
160
  .s("AWSDeepSenseRunTimeServiceApi2_0", "RecognizeText", {})
158
161
  .n("LexRuntimeV2Client", "RecognizeTextCommand")
159
- .sc(schemas_0.RecognizeText$)
162
+ .sc(RecognizeText$)
160
163
  .build() {
161
164
  }
162
165
 
163
- class RecognizeUtteranceCommand extends client.Command
166
+ class RecognizeUtteranceCommand extends Command
164
167
  .classBuilder()
165
168
  .ep(commonParams)
166
169
  .m(function (Command, cs, config, o) {
167
- return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
170
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
168
171
  })
169
172
  .s("AWSDeepSenseRunTimeServiceApi2_0", "RecognizeUtterance", {})
170
173
  .n("LexRuntimeV2Client", "RecognizeUtteranceCommand")
171
- .sc(schemas_0.RecognizeUtterance$)
174
+ .sc(RecognizeUtterance$)
172
175
  .build() {
173
176
  }
174
177
 
175
- class StartConversationCommand extends client.Command
178
+ class StartConversationCommand extends Command
176
179
  .classBuilder()
177
180
  .ep(commonParams)
178
181
  .m(function (Command, cs, config, o) {
179
182
  return [
180
- endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
181
- middlewareEventstream.getEventStreamPlugin(config),
183
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
184
+ getEventStreamPlugin(config),
182
185
  ];
183
186
  })
184
187
  .s("AWSDeepSenseRunTimeServiceApi2_0", "StartConversation", {
@@ -188,7 +191,7 @@ class StartConversationCommand extends client.Command
188
191
  },
189
192
  })
190
193
  .n("LexRuntimeV2Client", "StartConversationCommand")
191
- .sc(schemas_0.StartConversation$)
194
+ .sc(StartConversation$)
192
195
  .build() {
193
196
  }
194
197
 
@@ -202,7 +205,7 @@ const commands = {
202
205
  };
203
206
  class LexRuntimeV2 extends LexRuntimeV2Client {
204
207
  }
205
- client.createAggregatedClient(commands, LexRuntimeV2);
208
+ createAggregatedClient(commands, LexRuntimeV2);
206
209
 
207
210
  const ConfirmationState = {
208
211
  CONFIRMED: "Confirmed",
@@ -266,9 +269,6 @@ const PlaybackInterruptionReason = {
266
269
  VOICE_START_DETECTED: "VOICE_START_DETECTED",
267
270
  };
268
271
 
269
- exports.$Command = client.Command;
270
- exports.__Client = client.Client;
271
- exports.LexRuntimeV2ServiceException = LexRuntimeV2ServiceException.LexRuntimeV2ServiceException;
272
272
  exports.ConfirmationState = ConfirmationState;
273
273
  exports.ConversationMode = ConversationMode;
274
274
  exports.DeleteSessionCommand = DeleteSessionCommand;
@@ -288,23 +288,3 @@ exports.SentimentType = SentimentType;
288
288
  exports.Shape = Shape;
289
289
  exports.StartConversationCommand = StartConversationCommand;
290
290
  exports.StyleType = StyleType;
291
- Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&
292
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
293
- Object.defineProperty(exports, '__proto__', {
294
- enumerable: true,
295
- value: schemas_0['__proto__']
296
- });
297
-
298
- Object.keys(schemas_0).forEach(function (k) {
299
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];
300
- });
301
- Object.prototype.hasOwnProperty.call(errors, '__proto__') &&
302
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
303
- Object.defineProperty(exports, '__proto__', {
304
- enumerable: true,
305
- value: errors['__proto__']
306
- });
307
-
308
- Object.keys(errors).forEach(function (k) {
309
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];
310
- });
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LexRuntimeV2ServiceException = exports.__ServiceException = void 0;
4
- const client_1 = require("@smithy/core/client");
5
- Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return client_1.ServiceException; } });
6
- class LexRuntimeV2ServiceException extends client_1.ServiceException {
1
+ const { ServiceException: __ServiceException } = require("@smithy/core/client");
2
+ exports.__ServiceException = __ServiceException;
3
+ exports.LexRuntimeV2ServiceException = class LexRuntimeV2ServiceException extends __ServiceException {
7
4
  constructor(options) {
8
5
  super(options);
9
6
  Object.setPrototypeOf(this, LexRuntimeV2ServiceException.prototype);
10
7
  }
11
- }
12
- exports.LexRuntimeV2ServiceException = LexRuntimeV2ServiceException;
8
+ };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DependencyFailedException = exports.BadGatewayException = exports.ValidationException = exports.ThrottlingException = exports.ResourceNotFoundException = exports.InternalServerException = exports.ConflictException = exports.AccessDeniedException = void 0;
4
- const LexRuntimeV2ServiceException_1 = require("./LexRuntimeV2ServiceException");
5
- class AccessDeniedException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
1
+ const { LexRuntimeV2ServiceException: __BaseException } = require("./LexRuntimeV2ServiceException");
2
+ exports.AccessDeniedException = class AccessDeniedException extends __BaseException {
6
3
  name = "AccessDeniedException";
7
4
  $fault = "client";
8
5
  constructor(opts) {
@@ -13,9 +10,8 @@ class AccessDeniedException extends LexRuntimeV2ServiceException_1.LexRuntimeV2S
13
10
  });
14
11
  Object.setPrototypeOf(this, AccessDeniedException.prototype);
15
12
  }
16
- }
17
- exports.AccessDeniedException = AccessDeniedException;
18
- class ConflictException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
13
+ };
14
+ exports.ConflictException = class ConflictException extends __BaseException {
19
15
  name = "ConflictException";
20
16
  $fault = "client";
21
17
  constructor(opts) {
@@ -26,9 +22,8 @@ class ConflictException extends LexRuntimeV2ServiceException_1.LexRuntimeV2Servi
26
22
  });
27
23
  Object.setPrototypeOf(this, ConflictException.prototype);
28
24
  }
29
- }
30
- exports.ConflictException = ConflictException;
31
- class InternalServerException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
25
+ };
26
+ exports.InternalServerException = class InternalServerException extends __BaseException {
32
27
  name = "InternalServerException";
33
28
  $fault = "server";
34
29
  constructor(opts) {
@@ -39,9 +34,8 @@ class InternalServerException extends LexRuntimeV2ServiceException_1.LexRuntimeV
39
34
  });
40
35
  Object.setPrototypeOf(this, InternalServerException.prototype);
41
36
  }
42
- }
43
- exports.InternalServerException = InternalServerException;
44
- class ResourceNotFoundException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
37
+ };
38
+ exports.ResourceNotFoundException = class ResourceNotFoundException extends __BaseException {
45
39
  name = "ResourceNotFoundException";
46
40
  $fault = "client";
47
41
  constructor(opts) {
@@ -52,9 +46,8 @@ class ResourceNotFoundException extends LexRuntimeV2ServiceException_1.LexRuntim
52
46
  });
53
47
  Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
54
48
  }
55
- }
56
- exports.ResourceNotFoundException = ResourceNotFoundException;
57
- class ThrottlingException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
49
+ };
50
+ exports.ThrottlingException = class ThrottlingException extends __BaseException {
58
51
  name = "ThrottlingException";
59
52
  $fault = "client";
60
53
  constructor(opts) {
@@ -65,9 +58,8 @@ class ThrottlingException extends LexRuntimeV2ServiceException_1.LexRuntimeV2Ser
65
58
  });
66
59
  Object.setPrototypeOf(this, ThrottlingException.prototype);
67
60
  }
68
- }
69
- exports.ThrottlingException = ThrottlingException;
70
- class ValidationException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
61
+ };
62
+ exports.ValidationException = class ValidationException extends __BaseException {
71
63
  name = "ValidationException";
72
64
  $fault = "client";
73
65
  constructor(opts) {
@@ -78,9 +70,8 @@ class ValidationException extends LexRuntimeV2ServiceException_1.LexRuntimeV2Ser
78
70
  });
79
71
  Object.setPrototypeOf(this, ValidationException.prototype);
80
72
  }
81
- }
82
- exports.ValidationException = ValidationException;
83
- class BadGatewayException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
73
+ };
74
+ exports.BadGatewayException = class BadGatewayException extends __BaseException {
84
75
  name = "BadGatewayException";
85
76
  $fault = "server";
86
77
  constructor(opts) {
@@ -91,9 +82,8 @@ class BadGatewayException extends LexRuntimeV2ServiceException_1.LexRuntimeV2Ser
91
82
  });
92
83
  Object.setPrototypeOf(this, BadGatewayException.prototype);
93
84
  }
94
- }
95
- exports.BadGatewayException = BadGatewayException;
96
- class DependencyFailedException extends LexRuntimeV2ServiceException_1.LexRuntimeV2ServiceException {
85
+ };
86
+ exports.DependencyFailedException = class DependencyFailedException extends __BaseException {
97
87
  name = "DependencyFailedException";
98
88
  $fault = "client";
99
89
  constructor(opts) {
@@ -104,5 +94,4 @@ class DependencyFailedException extends LexRuntimeV2ServiceException_1.LexRuntim
104
94
  });
105
95
  Object.setPrototypeOf(this, DependencyFailedException.prototype);
106
96
  }
107
- }
108
- exports.DependencyFailedException = DependencyFailedException;
97
+ };
@@ -1,41 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntimeConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
- const sha256_browser_1 = require("@aws-crypto/sha256-browser");
7
- const client_1 = require("@aws-sdk/core/client");
8
- const client_2 = require("@smithy/core/client");
9
- const config_1 = require("@smithy/core/config");
10
- const event_streams_1 = require("@smithy/core/event-streams");
11
- const retry_1 = require("@smithy/core/retry");
12
- const serde_1 = require("@smithy/core/serde");
13
- const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
14
- const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
1
+ const packageInfo = require("../package.json");
2
+ const { Sha256 } = require("@aws-crypto/sha256-browser");
3
+ const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
4
+ const { invalidFunction, invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
5
+ const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
6
+ const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
7
+ const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
8
+ const { calculateBodyLength } = require("@smithy/core/serde");
9
+ const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
10
+ const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
15
11
  const getRuntimeConfig = (config) => {
16
- const defaultsMode = (0, config_1.resolveDefaultsModeConfig)(config);
17
- const defaultConfigProvider = () => defaultsMode().then(client_2.loadConfigsForDefaultMode);
18
- const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
12
+ const defaultsMode = resolveDefaultsModeConfig(config);
13
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
14
+ const clientSharedValues = getSharedRuntimeConfig(config);
19
15
  return {
20
16
  ...clientSharedValues,
21
17
  ...config,
22
18
  runtime: "browser",
23
19
  defaultsMode,
24
- bodyLengthChecker: config?.bodyLengthChecker ?? serde_1.calculateBodyLength,
20
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
25
21
  credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
26
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, client_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
22
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
27
23
  eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? (() => ({
28
- handle: (0, client_2.invalidFunction)("event stream request is not supported in browser."),
24
+ handle: invalidFunction("event stream request is not supported in browser."),
29
25
  })),
30
- eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? event_streams_1.eventStreamSerdeProvider,
31
- maxAttempts: config?.maxAttempts ?? retry_1.DEFAULT_MAX_ATTEMPTS,
32
- region: config?.region ?? (0, client_2.invalidProvider)("Region is missing"),
33
- requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
34
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || retry_1.DEFAULT_RETRY_MODE),
35
- sha256: config?.sha256 ?? sha256_browser_1.Sha256,
36
- streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
37
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
38
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_1.DEFAULT_USE_FIPS_ENDPOINT)),
26
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
27
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
28
+ region: config?.region ?? invalidProvider("Region is missing"),
29
+ requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
30
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
31
+ sha256: config?.sha256 ?? Sha256,
32
+ streamCollector: config?.streamCollector ?? streamCollector,
33
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
34
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
39
35
  };
40
36
  };
41
37
  exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,25 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntimeConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
- const client_1 = require("@aws-sdk/core/client");
7
- const httpAuthSchemes_1 = require("@aws-sdk/core/httpAuthSchemes");
8
- const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
9
- const eventstream_handler_node_1 = require("@aws-sdk/eventstream-handler-node");
10
- const client_2 = require("@smithy/core/client");
11
- const config_1 = require("@smithy/core/config");
12
- const event_streams_1 = require("@smithy/core/event-streams");
13
- const retry_1 = require("@smithy/core/retry");
14
- const serde_1 = require("@smithy/core/serde");
15
- const node_http_handler_1 = require("@smithy/node-http-handler");
16
- const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
1
+ const packageInfo = require("../package.json");
2
+ const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
3
+ const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
4
+ const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
5
+ const { eventStreamPayloadHandlerProvider } = require("@aws-sdk/eventstream-handler-node");
6
+ const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
7
+ const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
8
+ const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
9
+ const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
10
+ const { calculateBodyLength, Hash } = require("@smithy/core/serde");
11
+ const { NodeHttp2Handler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
12
+ const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
17
13
  const getRuntimeConfig = (config) => {
18
- (0, client_2.emitWarningIfUnsupportedVersion)(process.version);
19
- const defaultsMode = (0, config_1.resolveDefaultsModeConfig)(config);
20
- const defaultConfigProvider = () => defaultsMode().then(client_2.loadConfigsForDefaultMode);
21
- const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
22
- (0, client_1.emitWarningIfUnsupportedVersion)(process.version);
14
+ emitWarningIfUnsupportedVersion(process.version);
15
+ const defaultsMode = resolveDefaultsModeConfig(config);
16
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
17
+ const clientSharedValues = getSharedRuntimeConfig(config);
18
+ awsCheckVersion(process.version);
23
19
  const loaderConfig = {
24
20
  profile: config?.profile,
25
21
  logger: clientSharedValues.logger,
@@ -29,28 +25,28 @@ const getRuntimeConfig = (config) => {
29
25
  ...config,
30
26
  runtime: "node",
31
27
  defaultsMode,
32
- authSchemePreference: config?.authSchemePreference ?? (0, config_1.loadConfig)(httpAuthSchemes_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
33
- bodyLengthChecker: config?.bodyLengthChecker ?? serde_1.calculateBodyLength,
34
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
35
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, client_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
36
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventstream_handler_node_1.eventStreamPayloadHandlerProvider,
37
- eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? event_streams_1.eventStreamSerdeProvider,
38
- maxAttempts: config?.maxAttempts ?? (0, config_1.loadConfig)(retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
39
- region: config?.region ?? (0, config_1.loadConfig)(config_1.NODE_REGION_CONFIG_OPTIONS, { ...config_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
40
- requestHandler: node_http_handler_1.NodeHttp2Handler.create(config?.requestHandler ?? (async () => ({
28
+ authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
29
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
30
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
31
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
32
+ eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
33
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
34
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
35
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
36
+ requestHandler: RequestHandler.create(config?.requestHandler ?? (async () => ({
41
37
  ...await defaultConfigProvider(),
42
38
  disableConcurrentStreams: true
43
39
  }))),
44
40
  retryMode: config?.retryMode ??
45
- (0, config_1.loadConfig)({
46
- ...retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
47
- default: async () => (await defaultConfigProvider()).retryMode || retry_1.DEFAULT_RETRY_MODE,
41
+ loadNodeConfig({
42
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
43
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
48
44
  }, config),
49
- sha256: config?.sha256 ?? serde_1.Hash.bind(null, "sha256"),
50
- streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
51
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, config_1.loadConfig)(config_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
52
- useFipsEndpoint: config?.useFipsEndpoint ?? (0, config_1.loadConfig)(config_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
53
- userAgentAppId: config?.userAgentAppId ?? (0, config_1.loadConfig)(client_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
45
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
46
+ streamCollector: config?.streamCollector ?? streamCollector,
47
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
48
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
49
+ userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
54
50
  };
55
51
  };
56
52
  exports.getRuntimeConfig = getRuntimeConfig;