@aws-sdk/client-lex-runtime-service 3.490.0 → 3.495.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/dist-cjs/LexRuntimeService.js +1 -21
- package/dist-cjs/LexRuntimeServiceClient.js +1 -43
- package/dist-cjs/commands/DeleteSessionCommand.js +1 -28
- package/dist-cjs/commands/GetSessionCommand.js +1 -29
- package/dist-cjs/commands/PostContentCommand.js +1 -29
- package/dist-cjs/commands/PostTextCommand.js +1 -29
- package/dist-cjs/commands/PutSessionCommand.js +1 -29
- package/dist-cjs/commands/index.js +1 -8
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +1288 -10
- package/dist-cjs/models/LexRuntimeServiceServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -268
- package/dist-cjs/protocols/Aws_restJson1.js +1 -695
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +41 -41
package/dist-cjs/index.js
CHANGED
|
@@ -1,11 +1,1289 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
ActiveContextFilterSensitiveLog: () => ActiveContextFilterSensitiveLog,
|
|
25
|
+
BadGatewayException: () => BadGatewayException,
|
|
26
|
+
BadRequestException: () => BadRequestException,
|
|
27
|
+
ConfirmationStatus: () => ConfirmationStatus,
|
|
28
|
+
ConflictException: () => ConflictException,
|
|
29
|
+
ContentType: () => ContentType,
|
|
30
|
+
DeleteSessionCommand: () => DeleteSessionCommand,
|
|
31
|
+
DependencyFailedException: () => DependencyFailedException,
|
|
32
|
+
DialogActionFilterSensitiveLog: () => DialogActionFilterSensitiveLog,
|
|
33
|
+
DialogActionType: () => DialogActionType,
|
|
34
|
+
DialogState: () => DialogState,
|
|
35
|
+
FulfillmentState: () => FulfillmentState,
|
|
36
|
+
GetSessionCommand: () => GetSessionCommand,
|
|
37
|
+
GetSessionResponseFilterSensitiveLog: () => GetSessionResponseFilterSensitiveLog,
|
|
38
|
+
IntentSummaryFilterSensitiveLog: () => IntentSummaryFilterSensitiveLog,
|
|
39
|
+
InternalFailureException: () => InternalFailureException,
|
|
40
|
+
LexRuntimeService: () => LexRuntimeService,
|
|
41
|
+
LexRuntimeServiceClient: () => LexRuntimeServiceClient,
|
|
42
|
+
LexRuntimeServiceServiceException: () => LexRuntimeServiceServiceException,
|
|
43
|
+
LimitExceededException: () => LimitExceededException,
|
|
44
|
+
LoopDetectedException: () => LoopDetectedException,
|
|
45
|
+
MessageFormatType: () => MessageFormatType,
|
|
46
|
+
NotAcceptableException: () => NotAcceptableException,
|
|
47
|
+
NotFoundException: () => NotFoundException,
|
|
48
|
+
PostContentCommand: () => PostContentCommand,
|
|
49
|
+
PostContentRequestFilterSensitiveLog: () => PostContentRequestFilterSensitiveLog,
|
|
50
|
+
PostContentResponseFilterSensitiveLog: () => PostContentResponseFilterSensitiveLog,
|
|
51
|
+
PostTextCommand: () => PostTextCommand,
|
|
52
|
+
PostTextRequestFilterSensitiveLog: () => PostTextRequestFilterSensitiveLog,
|
|
53
|
+
PostTextResponseFilterSensitiveLog: () => PostTextResponseFilterSensitiveLog,
|
|
54
|
+
PredictedIntentFilterSensitiveLog: () => PredictedIntentFilterSensitiveLog,
|
|
55
|
+
PutSessionCommand: () => PutSessionCommand,
|
|
56
|
+
PutSessionRequestFilterSensitiveLog: () => PutSessionRequestFilterSensitiveLog,
|
|
57
|
+
PutSessionResponseFilterSensitiveLog: () => PutSessionResponseFilterSensitiveLog,
|
|
58
|
+
RequestTimeoutException: () => RequestTimeoutException,
|
|
59
|
+
UnsupportedMediaTypeException: () => UnsupportedMediaTypeException,
|
|
60
|
+
__Client: () => import_smithy_client.Client
|
|
61
|
+
});
|
|
62
|
+
module.exports = __toCommonJS(src_exports);
|
|
63
|
+
|
|
64
|
+
// src/LexRuntimeServiceClient.ts
|
|
65
|
+
var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
|
|
66
|
+
var import_middleware_logger = require("@aws-sdk/middleware-logger");
|
|
67
|
+
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
|
|
68
|
+
var import_middleware_signing = require("@aws-sdk/middleware-signing");
|
|
69
|
+
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
|
|
70
|
+
var import_config_resolver = require("@smithy/config-resolver");
|
|
71
|
+
var import_middleware_content_length = require("@smithy/middleware-content-length");
|
|
72
|
+
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
|
|
73
|
+
var import_middleware_retry = require("@smithy/middleware-retry");
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// src/endpoint/EndpointParameters.ts
|
|
77
|
+
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
|
|
78
|
+
return {
|
|
79
|
+
...options,
|
|
80
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
81
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
82
|
+
defaultSigningName: "lex"
|
|
83
|
+
};
|
|
84
|
+
}, "resolveClientEndpointParameters");
|
|
85
|
+
var commonParams = {
|
|
86
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
87
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
88
|
+
Region: { type: "builtInParams", name: "region" },
|
|
89
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/LexRuntimeServiceClient.ts
|
|
93
|
+
var import_runtimeConfig = require("././runtimeConfig");
|
|
94
|
+
|
|
95
|
+
// src/runtimeExtensions.ts
|
|
96
|
+
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
|
|
97
|
+
var import_protocol_http = require("@smithy/protocol-http");
|
|
98
|
+
var import_smithy_client = require("@smithy/smithy-client");
|
|
99
|
+
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
|
|
100
|
+
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
|
|
101
|
+
const extensionConfiguration = {
|
|
102
|
+
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
|
|
103
|
+
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
104
|
+
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
|
|
105
|
+
};
|
|
106
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
107
|
+
return {
|
|
108
|
+
...runtimeConfig,
|
|
109
|
+
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
110
|
+
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
111
|
+
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
|
|
112
|
+
};
|
|
113
|
+
}, "resolveRuntimeExtensions");
|
|
114
|
+
|
|
115
|
+
// src/LexRuntimeServiceClient.ts
|
|
116
|
+
var _LexRuntimeServiceClient = class _LexRuntimeServiceClient extends import_smithy_client.Client {
|
|
117
|
+
constructor(...[configuration]) {
|
|
118
|
+
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
|
|
119
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
120
|
+
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
|
|
121
|
+
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
|
|
122
|
+
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
|
|
123
|
+
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
|
|
124
|
+
const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
|
|
125
|
+
const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
|
|
126
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
|
|
127
|
+
super(_config_8);
|
|
128
|
+
this.config = _config_8;
|
|
129
|
+
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
|
|
130
|
+
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
|
|
131
|
+
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
|
|
132
|
+
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
|
|
133
|
+
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
|
|
134
|
+
this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
|
|
135
|
+
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
139
|
+
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
140
|
+
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
141
|
+
*/
|
|
142
|
+
destroy() {
|
|
143
|
+
super.destroy();
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
__name(_LexRuntimeServiceClient, "LexRuntimeServiceClient");
|
|
147
|
+
var LexRuntimeServiceClient = _LexRuntimeServiceClient;
|
|
148
|
+
|
|
149
|
+
// src/LexRuntimeService.ts
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
// src/commands/DeleteSessionCommand.ts
|
|
153
|
+
|
|
154
|
+
var import_middleware_serde = require("@smithy/middleware-serde");
|
|
155
|
+
|
|
156
|
+
var import_types = require("@smithy/types");
|
|
157
|
+
|
|
158
|
+
// src/protocols/Aws_restJson1.ts
|
|
159
|
+
var import_core = require("@smithy/core");
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
// src/models/LexRuntimeServiceServiceException.ts
|
|
163
|
+
|
|
164
|
+
var _LexRuntimeServiceServiceException = class _LexRuntimeServiceServiceException extends import_smithy_client.ServiceException {
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
constructor(options) {
|
|
169
|
+
super(options);
|
|
170
|
+
Object.setPrototypeOf(this, _LexRuntimeServiceServiceException.prototype);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
__name(_LexRuntimeServiceServiceException, "LexRuntimeServiceServiceException");
|
|
174
|
+
var LexRuntimeServiceServiceException = _LexRuntimeServiceServiceException;
|
|
175
|
+
|
|
176
|
+
// src/models/models_0.ts
|
|
177
|
+
|
|
178
|
+
var _BadRequestException = class _BadRequestException extends LexRuntimeServiceServiceException {
|
|
179
|
+
/**
|
|
180
|
+
* @internal
|
|
181
|
+
*/
|
|
182
|
+
constructor(opts) {
|
|
183
|
+
super({
|
|
184
|
+
name: "BadRequestException",
|
|
185
|
+
$fault: "client",
|
|
186
|
+
...opts
|
|
187
|
+
});
|
|
188
|
+
this.name = "BadRequestException";
|
|
189
|
+
this.$fault = "client";
|
|
190
|
+
Object.setPrototypeOf(this, _BadRequestException.prototype);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
__name(_BadRequestException, "BadRequestException");
|
|
194
|
+
var BadRequestException = _BadRequestException;
|
|
195
|
+
var _ConflictException = class _ConflictException extends LexRuntimeServiceServiceException {
|
|
196
|
+
/**
|
|
197
|
+
* @internal
|
|
198
|
+
*/
|
|
199
|
+
constructor(opts) {
|
|
200
|
+
super({
|
|
201
|
+
name: "ConflictException",
|
|
202
|
+
$fault: "client",
|
|
203
|
+
...opts
|
|
204
|
+
});
|
|
205
|
+
this.name = "ConflictException";
|
|
206
|
+
this.$fault = "client";
|
|
207
|
+
Object.setPrototypeOf(this, _ConflictException.prototype);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
__name(_ConflictException, "ConflictException");
|
|
211
|
+
var ConflictException = _ConflictException;
|
|
212
|
+
var _InternalFailureException = class _InternalFailureException extends LexRuntimeServiceServiceException {
|
|
213
|
+
/**
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
constructor(opts) {
|
|
217
|
+
super({
|
|
218
|
+
name: "InternalFailureException",
|
|
219
|
+
$fault: "server",
|
|
220
|
+
...opts
|
|
221
|
+
});
|
|
222
|
+
this.name = "InternalFailureException";
|
|
223
|
+
this.$fault = "server";
|
|
224
|
+
Object.setPrototypeOf(this, _InternalFailureException.prototype);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
__name(_InternalFailureException, "InternalFailureException");
|
|
228
|
+
var InternalFailureException = _InternalFailureException;
|
|
229
|
+
var _LimitExceededException = class _LimitExceededException extends LexRuntimeServiceServiceException {
|
|
230
|
+
/**
|
|
231
|
+
* @internal
|
|
232
|
+
*/
|
|
233
|
+
constructor(opts) {
|
|
234
|
+
super({
|
|
235
|
+
name: "LimitExceededException",
|
|
236
|
+
$fault: "client",
|
|
237
|
+
...opts
|
|
238
|
+
});
|
|
239
|
+
this.name = "LimitExceededException";
|
|
240
|
+
this.$fault = "client";
|
|
241
|
+
Object.setPrototypeOf(this, _LimitExceededException.prototype);
|
|
242
|
+
this.retryAfterSeconds = opts.retryAfterSeconds;
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
__name(_LimitExceededException, "LimitExceededException");
|
|
246
|
+
var LimitExceededException = _LimitExceededException;
|
|
247
|
+
var _NotFoundException = class _NotFoundException extends LexRuntimeServiceServiceException {
|
|
248
|
+
/**
|
|
249
|
+
* @internal
|
|
250
|
+
*/
|
|
251
|
+
constructor(opts) {
|
|
252
|
+
super({
|
|
253
|
+
name: "NotFoundException",
|
|
254
|
+
$fault: "client",
|
|
255
|
+
...opts
|
|
256
|
+
});
|
|
257
|
+
this.name = "NotFoundException";
|
|
258
|
+
this.$fault = "client";
|
|
259
|
+
Object.setPrototypeOf(this, _NotFoundException.prototype);
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
__name(_NotFoundException, "NotFoundException");
|
|
263
|
+
var NotFoundException = _NotFoundException;
|
|
264
|
+
var FulfillmentState = {
|
|
265
|
+
FAILED: "Failed",
|
|
266
|
+
FULFILLED: "Fulfilled",
|
|
267
|
+
READY_FOR_FULFILLMENT: "ReadyForFulfillment"
|
|
268
|
+
};
|
|
269
|
+
var MessageFormatType = {
|
|
270
|
+
COMPOSITE: "Composite",
|
|
271
|
+
CUSTOM_PAYLOAD: "CustomPayload",
|
|
272
|
+
PLAIN_TEXT: "PlainText",
|
|
273
|
+
SSML: "SSML"
|
|
274
|
+
};
|
|
275
|
+
var DialogActionType = {
|
|
276
|
+
CLOSE: "Close",
|
|
277
|
+
CONFIRM_INTENT: "ConfirmIntent",
|
|
278
|
+
DELEGATE: "Delegate",
|
|
279
|
+
ELICIT_INTENT: "ElicitIntent",
|
|
280
|
+
ELICIT_SLOT: "ElicitSlot"
|
|
281
|
+
};
|
|
282
|
+
var ConfirmationStatus = {
|
|
283
|
+
CONFIRMED: "Confirmed",
|
|
284
|
+
DENIED: "Denied",
|
|
285
|
+
NONE: "None"
|
|
286
|
+
};
|
|
287
|
+
var _BadGatewayException = class _BadGatewayException extends LexRuntimeServiceServiceException {
|
|
288
|
+
/**
|
|
289
|
+
* @internal
|
|
290
|
+
*/
|
|
291
|
+
constructor(opts) {
|
|
292
|
+
super({
|
|
293
|
+
name: "BadGatewayException",
|
|
294
|
+
$fault: "server",
|
|
295
|
+
...opts
|
|
296
|
+
});
|
|
297
|
+
this.name = "BadGatewayException";
|
|
298
|
+
this.$fault = "server";
|
|
299
|
+
Object.setPrototypeOf(this, _BadGatewayException.prototype);
|
|
300
|
+
this.Message = opts.Message;
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
__name(_BadGatewayException, "BadGatewayException");
|
|
304
|
+
var BadGatewayException = _BadGatewayException;
|
|
305
|
+
var _DependencyFailedException = class _DependencyFailedException extends LexRuntimeServiceServiceException {
|
|
306
|
+
/**
|
|
307
|
+
* @internal
|
|
308
|
+
*/
|
|
309
|
+
constructor(opts) {
|
|
310
|
+
super({
|
|
311
|
+
name: "DependencyFailedException",
|
|
312
|
+
$fault: "client",
|
|
313
|
+
...opts
|
|
314
|
+
});
|
|
315
|
+
this.name = "DependencyFailedException";
|
|
316
|
+
this.$fault = "client";
|
|
317
|
+
Object.setPrototypeOf(this, _DependencyFailedException.prototype);
|
|
318
|
+
this.Message = opts.Message;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
__name(_DependencyFailedException, "DependencyFailedException");
|
|
322
|
+
var DependencyFailedException = _DependencyFailedException;
|
|
323
|
+
var _LoopDetectedException = class _LoopDetectedException extends LexRuntimeServiceServiceException {
|
|
324
|
+
/**
|
|
325
|
+
* @internal
|
|
326
|
+
*/
|
|
327
|
+
constructor(opts) {
|
|
328
|
+
super({
|
|
329
|
+
name: "LoopDetectedException",
|
|
330
|
+
$fault: "server",
|
|
331
|
+
...opts
|
|
332
|
+
});
|
|
333
|
+
this.name = "LoopDetectedException";
|
|
334
|
+
this.$fault = "server";
|
|
335
|
+
Object.setPrototypeOf(this, _LoopDetectedException.prototype);
|
|
336
|
+
this.Message = opts.Message;
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
__name(_LoopDetectedException, "LoopDetectedException");
|
|
340
|
+
var LoopDetectedException = _LoopDetectedException;
|
|
341
|
+
var _NotAcceptableException = class _NotAcceptableException extends LexRuntimeServiceServiceException {
|
|
342
|
+
/**
|
|
343
|
+
* @internal
|
|
344
|
+
*/
|
|
345
|
+
constructor(opts) {
|
|
346
|
+
super({
|
|
347
|
+
name: "NotAcceptableException",
|
|
348
|
+
$fault: "client",
|
|
349
|
+
...opts
|
|
350
|
+
});
|
|
351
|
+
this.name = "NotAcceptableException";
|
|
352
|
+
this.$fault = "client";
|
|
353
|
+
Object.setPrototypeOf(this, _NotAcceptableException.prototype);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
__name(_NotAcceptableException, "NotAcceptableException");
|
|
357
|
+
var NotAcceptableException = _NotAcceptableException;
|
|
358
|
+
var DialogState = {
|
|
359
|
+
CONFIRM_INTENT: "ConfirmIntent",
|
|
360
|
+
ELICIT_INTENT: "ElicitIntent",
|
|
361
|
+
ELICIT_SLOT: "ElicitSlot",
|
|
362
|
+
FAILED: "Failed",
|
|
363
|
+
FULFILLED: "Fulfilled",
|
|
364
|
+
READY_FOR_FULFILLMENT: "ReadyForFulfillment"
|
|
365
|
+
};
|
|
366
|
+
var _RequestTimeoutException = class _RequestTimeoutException extends LexRuntimeServiceServiceException {
|
|
367
|
+
/**
|
|
368
|
+
* @internal
|
|
369
|
+
*/
|
|
370
|
+
constructor(opts) {
|
|
371
|
+
super({
|
|
372
|
+
name: "RequestTimeoutException",
|
|
373
|
+
$fault: "client",
|
|
374
|
+
...opts
|
|
375
|
+
});
|
|
376
|
+
this.name = "RequestTimeoutException";
|
|
377
|
+
this.$fault = "client";
|
|
378
|
+
Object.setPrototypeOf(this, _RequestTimeoutException.prototype);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
__name(_RequestTimeoutException, "RequestTimeoutException");
|
|
382
|
+
var RequestTimeoutException = _RequestTimeoutException;
|
|
383
|
+
var _UnsupportedMediaTypeException = class _UnsupportedMediaTypeException extends LexRuntimeServiceServiceException {
|
|
384
|
+
/**
|
|
385
|
+
* @internal
|
|
386
|
+
*/
|
|
387
|
+
constructor(opts) {
|
|
388
|
+
super({
|
|
389
|
+
name: "UnsupportedMediaTypeException",
|
|
390
|
+
$fault: "client",
|
|
391
|
+
...opts
|
|
392
|
+
});
|
|
393
|
+
this.name = "UnsupportedMediaTypeException";
|
|
394
|
+
this.$fault = "client";
|
|
395
|
+
Object.setPrototypeOf(this, _UnsupportedMediaTypeException.prototype);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
__name(_UnsupportedMediaTypeException, "UnsupportedMediaTypeException");
|
|
399
|
+
var UnsupportedMediaTypeException = _UnsupportedMediaTypeException;
|
|
400
|
+
var ContentType = {
|
|
401
|
+
GENERIC: "application/vnd.amazonaws.card.generic"
|
|
402
|
+
};
|
|
403
|
+
var ActiveContextFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
404
|
+
...obj,
|
|
405
|
+
...obj.parameters && { parameters: import_smithy_client.SENSITIVE_STRING }
|
|
406
|
+
}), "ActiveContextFilterSensitiveLog");
|
|
407
|
+
var DialogActionFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
408
|
+
...obj,
|
|
409
|
+
...obj.slots && { slots: import_smithy_client.SENSITIVE_STRING },
|
|
410
|
+
...obj.message && { message: import_smithy_client.SENSITIVE_STRING }
|
|
411
|
+
}), "DialogActionFilterSensitiveLog");
|
|
412
|
+
var IntentSummaryFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
413
|
+
...obj,
|
|
414
|
+
...obj.slots && { slots: import_smithy_client.SENSITIVE_STRING }
|
|
415
|
+
}), "IntentSummaryFilterSensitiveLog");
|
|
416
|
+
var GetSessionResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
417
|
+
...obj,
|
|
418
|
+
...obj.recentIntentSummaryView && {
|
|
419
|
+
recentIntentSummaryView: obj.recentIntentSummaryView.map((item) => IntentSummaryFilterSensitiveLog(item))
|
|
420
|
+
},
|
|
421
|
+
...obj.sessionAttributes && { sessionAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
422
|
+
...obj.dialogAction && { dialogAction: DialogActionFilterSensitiveLog(obj.dialogAction) },
|
|
423
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
424
|
+
}), "GetSessionResponseFilterSensitiveLog");
|
|
425
|
+
var PostContentRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
426
|
+
...obj,
|
|
427
|
+
...obj.sessionAttributes && { sessionAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
428
|
+
...obj.requestAttributes && { requestAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
429
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
430
|
+
}), "PostContentRequestFilterSensitiveLog");
|
|
431
|
+
var PostContentResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
432
|
+
...obj,
|
|
433
|
+
...obj.message && { message: import_smithy_client.SENSITIVE_STRING },
|
|
434
|
+
...obj.encodedMessage && { encodedMessage: import_smithy_client.SENSITIVE_STRING },
|
|
435
|
+
...obj.encodedInputTranscript && { encodedInputTranscript: import_smithy_client.SENSITIVE_STRING },
|
|
436
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
437
|
+
}), "PostContentResponseFilterSensitiveLog");
|
|
438
|
+
var PostTextRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
439
|
+
...obj,
|
|
440
|
+
...obj.sessionAttributes && { sessionAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
441
|
+
...obj.requestAttributes && { requestAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
442
|
+
...obj.inputText && { inputText: import_smithy_client.SENSITIVE_STRING },
|
|
443
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
444
|
+
}), "PostTextRequestFilterSensitiveLog");
|
|
445
|
+
var PredictedIntentFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
446
|
+
...obj,
|
|
447
|
+
...obj.slots && { slots: import_smithy_client.SENSITIVE_STRING }
|
|
448
|
+
}), "PredictedIntentFilterSensitiveLog");
|
|
449
|
+
var PostTextResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
450
|
+
...obj,
|
|
451
|
+
...obj.alternativeIntents && {
|
|
452
|
+
alternativeIntents: obj.alternativeIntents.map((item) => PredictedIntentFilterSensitiveLog(item))
|
|
453
|
+
},
|
|
454
|
+
...obj.slots && { slots: import_smithy_client.SENSITIVE_STRING },
|
|
455
|
+
...obj.sessionAttributes && { sessionAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
456
|
+
...obj.message && { message: import_smithy_client.SENSITIVE_STRING },
|
|
457
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
458
|
+
}), "PostTextResponseFilterSensitiveLog");
|
|
459
|
+
var PutSessionRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
460
|
+
...obj,
|
|
461
|
+
...obj.sessionAttributes && { sessionAttributes: import_smithy_client.SENSITIVE_STRING },
|
|
462
|
+
...obj.dialogAction && { dialogAction: DialogActionFilterSensitiveLog(obj.dialogAction) },
|
|
463
|
+
...obj.recentIntentSummaryView && {
|
|
464
|
+
recentIntentSummaryView: obj.recentIntentSummaryView.map((item) => IntentSummaryFilterSensitiveLog(item))
|
|
465
|
+
},
|
|
466
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
467
|
+
}), "PutSessionRequestFilterSensitiveLog");
|
|
468
|
+
var PutSessionResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
469
|
+
...obj,
|
|
470
|
+
...obj.message && { message: import_smithy_client.SENSITIVE_STRING },
|
|
471
|
+
...obj.encodedMessage && { encodedMessage: import_smithy_client.SENSITIVE_STRING },
|
|
472
|
+
...obj.activeContexts && { activeContexts: import_smithy_client.SENSITIVE_STRING }
|
|
473
|
+
}), "PutSessionResponseFilterSensitiveLog");
|
|
474
|
+
|
|
475
|
+
// src/protocols/Aws_restJson1.ts
|
|
476
|
+
var se_DeleteSessionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
477
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
478
|
+
const headers = {};
|
|
479
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
480
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
481
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
482
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
483
|
+
let body;
|
|
484
|
+
b.m("DELETE").h(headers).b(body);
|
|
485
|
+
return b.build();
|
|
486
|
+
}, "se_DeleteSessionCommand");
|
|
487
|
+
var se_GetSessionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
488
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
489
|
+
const headers = {};
|
|
490
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
491
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
492
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
493
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
494
|
+
const query = (0, import_smithy_client.map)({
|
|
495
|
+
[_cLF]: [, input[_cLF]]
|
|
496
|
+
});
|
|
497
|
+
let body;
|
|
498
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
499
|
+
return b.build();
|
|
500
|
+
}, "se_GetSessionCommand");
|
|
501
|
+
var se_PostContentCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
502
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
503
|
+
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
504
|
+
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
505
|
+
[_ct]: input[_cT] || "application/octet-stream",
|
|
506
|
+
[_xalsa]: [
|
|
507
|
+
() => isSerializableHeaderValue(input[_sA]),
|
|
508
|
+
() => context.base64Encoder(Buffer.from(import_smithy_client.LazyJsonString.fromObject(input[_sA])))
|
|
509
|
+
],
|
|
510
|
+
[_xalra]: [
|
|
511
|
+
() => isSerializableHeaderValue(input[_rA]),
|
|
512
|
+
() => context.base64Encoder(Buffer.from(import_smithy_client.LazyJsonString.fromObject(input[_rA])))
|
|
513
|
+
],
|
|
514
|
+
[_a]: input[_a],
|
|
515
|
+
[_xalac]: [
|
|
516
|
+
() => isSerializableHeaderValue(input[_aC]),
|
|
517
|
+
() => context.base64Encoder(Buffer.from(import_smithy_client.LazyJsonString.fromObject(input[_aC])))
|
|
518
|
+
]
|
|
519
|
+
});
|
|
520
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/content");
|
|
521
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
522
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
523
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
524
|
+
let body;
|
|
525
|
+
if (input.inputStream !== void 0) {
|
|
526
|
+
body = input.inputStream;
|
|
527
|
+
}
|
|
528
|
+
b.m("POST").h(headers).b(body);
|
|
529
|
+
return b.build();
|
|
530
|
+
}, "se_PostContentCommand");
|
|
531
|
+
var se_PostTextCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
532
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
533
|
+
const headers = {
|
|
534
|
+
"content-type": "application/json"
|
|
535
|
+
};
|
|
536
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/text");
|
|
537
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
538
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
539
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
540
|
+
let body;
|
|
541
|
+
body = JSON.stringify(
|
|
542
|
+
(0, import_smithy_client.take)(input, {
|
|
543
|
+
activeContexts: (_) => (0, import_smithy_client._json)(_),
|
|
544
|
+
inputText: [],
|
|
545
|
+
requestAttributes: (_) => (0, import_smithy_client._json)(_),
|
|
546
|
+
sessionAttributes: (_) => (0, import_smithy_client._json)(_)
|
|
547
|
+
})
|
|
548
|
+
);
|
|
549
|
+
b.m("POST").h(headers).b(body);
|
|
550
|
+
return b.build();
|
|
551
|
+
}, "se_PostTextCommand");
|
|
552
|
+
var se_PutSessionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
553
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
554
|
+
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
555
|
+
"content-type": "application/json",
|
|
556
|
+
[_a]: input[_a]
|
|
557
|
+
});
|
|
558
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
559
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
560
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
561
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
562
|
+
let body;
|
|
563
|
+
body = JSON.stringify(
|
|
564
|
+
(0, import_smithy_client.take)(input, {
|
|
565
|
+
activeContexts: (_) => (0, import_smithy_client._json)(_),
|
|
566
|
+
dialogAction: (_) => (0, import_smithy_client._json)(_),
|
|
567
|
+
recentIntentSummaryView: (_) => (0, import_smithy_client._json)(_),
|
|
568
|
+
sessionAttributes: (_) => (0, import_smithy_client._json)(_)
|
|
569
|
+
})
|
|
570
|
+
);
|
|
571
|
+
b.m("POST").h(headers).b(body);
|
|
572
|
+
return b.build();
|
|
573
|
+
}, "se_PutSessionCommand");
|
|
574
|
+
var de_DeleteSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
575
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
576
|
+
return de_DeleteSessionCommandError(output, context);
|
|
577
|
+
}
|
|
578
|
+
const contents = (0, import_smithy_client.map)({
|
|
579
|
+
$metadata: deserializeMetadata(output)
|
|
580
|
+
});
|
|
581
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
582
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
583
|
+
botAlias: import_smithy_client.expectString,
|
|
584
|
+
botName: import_smithy_client.expectString,
|
|
585
|
+
sessionId: import_smithy_client.expectString,
|
|
586
|
+
userId: import_smithy_client.expectString
|
|
587
|
+
});
|
|
588
|
+
Object.assign(contents, doc);
|
|
589
|
+
return contents;
|
|
590
|
+
}, "de_DeleteSessionCommand");
|
|
591
|
+
var de_DeleteSessionCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
592
|
+
const parsedOutput = {
|
|
593
|
+
...output,
|
|
594
|
+
body: await parseErrorBody(output.body, context)
|
|
595
|
+
};
|
|
596
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
597
|
+
switch (errorCode) {
|
|
598
|
+
case "BadRequestException":
|
|
599
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
600
|
+
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
601
|
+
case "ConflictException":
|
|
602
|
+
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
603
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
604
|
+
case "InternalFailureException":
|
|
605
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
606
|
+
throw await de_InternalFailureExceptionRes(parsedOutput, context);
|
|
607
|
+
case "LimitExceededException":
|
|
608
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
609
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
610
|
+
case "NotFoundException":
|
|
611
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
612
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
613
|
+
default:
|
|
614
|
+
const parsedBody = parsedOutput.body;
|
|
615
|
+
return throwDefaultError({
|
|
616
|
+
output,
|
|
617
|
+
parsedBody,
|
|
618
|
+
errorCode
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}, "de_DeleteSessionCommandError");
|
|
622
|
+
var de_GetSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
623
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
624
|
+
return de_GetSessionCommandError(output, context);
|
|
625
|
+
}
|
|
626
|
+
const contents = (0, import_smithy_client.map)({
|
|
627
|
+
$metadata: deserializeMetadata(output)
|
|
628
|
+
});
|
|
629
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
630
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
631
|
+
activeContexts: import_smithy_client._json,
|
|
632
|
+
dialogAction: import_smithy_client._json,
|
|
633
|
+
recentIntentSummaryView: import_smithy_client._json,
|
|
634
|
+
sessionAttributes: import_smithy_client._json,
|
|
635
|
+
sessionId: import_smithy_client.expectString
|
|
636
|
+
});
|
|
637
|
+
Object.assign(contents, doc);
|
|
638
|
+
return contents;
|
|
639
|
+
}, "de_GetSessionCommand");
|
|
640
|
+
var de_GetSessionCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
641
|
+
const parsedOutput = {
|
|
642
|
+
...output,
|
|
643
|
+
body: await parseErrorBody(output.body, context)
|
|
644
|
+
};
|
|
645
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
646
|
+
switch (errorCode) {
|
|
647
|
+
case "BadRequestException":
|
|
648
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
649
|
+
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
650
|
+
case "InternalFailureException":
|
|
651
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
652
|
+
throw await de_InternalFailureExceptionRes(parsedOutput, context);
|
|
653
|
+
case "LimitExceededException":
|
|
654
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
655
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
656
|
+
case "NotFoundException":
|
|
657
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
658
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
659
|
+
default:
|
|
660
|
+
const parsedBody = parsedOutput.body;
|
|
661
|
+
return throwDefaultError({
|
|
662
|
+
output,
|
|
663
|
+
parsedBody,
|
|
664
|
+
errorCode
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
}, "de_GetSessionCommandError");
|
|
668
|
+
var de_PostContentCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
669
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
670
|
+
return de_PostContentCommandError(output, context);
|
|
671
|
+
}
|
|
672
|
+
const contents = (0, import_smithy_client.map)({
|
|
673
|
+
$metadata: deserializeMetadata(output),
|
|
674
|
+
[_cT]: [, output.headers[_ct]],
|
|
675
|
+
[_iN]: [, output.headers[_xalin]],
|
|
676
|
+
[_nIC]: [
|
|
677
|
+
() => void 0 !== output.headers[_xalnic],
|
|
678
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalnic])).toString("utf8"))
|
|
679
|
+
],
|
|
680
|
+
[_aI]: [
|
|
681
|
+
() => void 0 !== output.headers[_xalai],
|
|
682
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalai])).toString("utf8"))
|
|
683
|
+
],
|
|
684
|
+
[_s]: [
|
|
685
|
+
() => void 0 !== output.headers[_xals],
|
|
686
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8"))
|
|
687
|
+
],
|
|
688
|
+
[_sA]: [
|
|
689
|
+
() => void 0 !== output.headers[_xalsa],
|
|
690
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8"))
|
|
691
|
+
],
|
|
692
|
+
[_sR]: [, output.headers[_xals_]],
|
|
693
|
+
[_m]: [, output.headers[_xalm]],
|
|
694
|
+
[_eM]: [, output.headers[_xalem]],
|
|
695
|
+
[_mF]: [, output.headers[_xalmf]],
|
|
696
|
+
[_dS]: [, output.headers[_xalds]],
|
|
697
|
+
[_sTE]: [, output.headers[_xalste]],
|
|
698
|
+
[_iT]: [, output.headers[_xalit]],
|
|
699
|
+
[_eIT]: [, output.headers[_xaleit]],
|
|
700
|
+
[_bV]: [, output.headers[_xalbv]],
|
|
701
|
+
[_sI]: [, output.headers[_xalsi]],
|
|
702
|
+
[_aC]: [
|
|
703
|
+
() => void 0 !== output.headers[_xalac],
|
|
704
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8"))
|
|
705
|
+
]
|
|
706
|
+
});
|
|
707
|
+
const data = output.body;
|
|
708
|
+
context.sdkStreamMixin(data);
|
|
709
|
+
contents.audioStream = data;
|
|
710
|
+
return contents;
|
|
711
|
+
}, "de_PostContentCommand");
|
|
712
|
+
var de_PostContentCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
713
|
+
const parsedOutput = {
|
|
714
|
+
...output,
|
|
715
|
+
body: await parseErrorBody(output.body, context)
|
|
716
|
+
};
|
|
717
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
718
|
+
switch (errorCode) {
|
|
719
|
+
case "BadGatewayException":
|
|
720
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException":
|
|
721
|
+
throw await de_BadGatewayExceptionRes(parsedOutput, context);
|
|
722
|
+
case "BadRequestException":
|
|
723
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
724
|
+
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
725
|
+
case "ConflictException":
|
|
726
|
+
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
727
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
728
|
+
case "DependencyFailedException":
|
|
729
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException":
|
|
730
|
+
throw await de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
731
|
+
case "InternalFailureException":
|
|
732
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
733
|
+
throw await de_InternalFailureExceptionRes(parsedOutput, context);
|
|
734
|
+
case "LimitExceededException":
|
|
735
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
736
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
737
|
+
case "LoopDetectedException":
|
|
738
|
+
case "com.amazonaws.lexruntimeservice#LoopDetectedException":
|
|
739
|
+
throw await de_LoopDetectedExceptionRes(parsedOutput, context);
|
|
740
|
+
case "NotAcceptableException":
|
|
741
|
+
case "com.amazonaws.lexruntimeservice#NotAcceptableException":
|
|
742
|
+
throw await de_NotAcceptableExceptionRes(parsedOutput, context);
|
|
743
|
+
case "NotFoundException":
|
|
744
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
745
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
746
|
+
case "RequestTimeoutException":
|
|
747
|
+
case "com.amazonaws.lexruntimeservice#RequestTimeoutException":
|
|
748
|
+
throw await de_RequestTimeoutExceptionRes(parsedOutput, context);
|
|
749
|
+
case "UnsupportedMediaTypeException":
|
|
750
|
+
case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException":
|
|
751
|
+
throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context);
|
|
752
|
+
default:
|
|
753
|
+
const parsedBody = parsedOutput.body;
|
|
754
|
+
return throwDefaultError({
|
|
755
|
+
output,
|
|
756
|
+
parsedBody,
|
|
757
|
+
errorCode
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
}, "de_PostContentCommandError");
|
|
761
|
+
var de_PostTextCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
762
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
763
|
+
return de_PostTextCommandError(output, context);
|
|
764
|
+
}
|
|
765
|
+
const contents = (0, import_smithy_client.map)({
|
|
766
|
+
$metadata: deserializeMetadata(output)
|
|
767
|
+
});
|
|
768
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
769
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
770
|
+
activeContexts: import_smithy_client._json,
|
|
771
|
+
alternativeIntents: (_) => de_IntentList(_, context),
|
|
772
|
+
botVersion: import_smithy_client.expectString,
|
|
773
|
+
dialogState: import_smithy_client.expectString,
|
|
774
|
+
intentName: import_smithy_client.expectString,
|
|
775
|
+
message: import_smithy_client.expectString,
|
|
776
|
+
messageFormat: import_smithy_client.expectString,
|
|
777
|
+
nluIntentConfidence: (_) => de_IntentConfidence(_, context),
|
|
778
|
+
responseCard: import_smithy_client._json,
|
|
779
|
+
sentimentResponse: import_smithy_client._json,
|
|
780
|
+
sessionAttributes: import_smithy_client._json,
|
|
781
|
+
sessionId: import_smithy_client.expectString,
|
|
782
|
+
slotToElicit: import_smithy_client.expectString,
|
|
783
|
+
slots: import_smithy_client._json
|
|
784
|
+
});
|
|
785
|
+
Object.assign(contents, doc);
|
|
786
|
+
return contents;
|
|
787
|
+
}, "de_PostTextCommand");
|
|
788
|
+
var de_PostTextCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
789
|
+
const parsedOutput = {
|
|
790
|
+
...output,
|
|
791
|
+
body: await parseErrorBody(output.body, context)
|
|
792
|
+
};
|
|
793
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
794
|
+
switch (errorCode) {
|
|
795
|
+
case "BadGatewayException":
|
|
796
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException":
|
|
797
|
+
throw await de_BadGatewayExceptionRes(parsedOutput, context);
|
|
798
|
+
case "BadRequestException":
|
|
799
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
800
|
+
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
801
|
+
case "ConflictException":
|
|
802
|
+
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
803
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
804
|
+
case "DependencyFailedException":
|
|
805
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException":
|
|
806
|
+
throw await de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
807
|
+
case "InternalFailureException":
|
|
808
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
809
|
+
throw await de_InternalFailureExceptionRes(parsedOutput, context);
|
|
810
|
+
case "LimitExceededException":
|
|
811
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
812
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
813
|
+
case "LoopDetectedException":
|
|
814
|
+
case "com.amazonaws.lexruntimeservice#LoopDetectedException":
|
|
815
|
+
throw await de_LoopDetectedExceptionRes(parsedOutput, context);
|
|
816
|
+
case "NotFoundException":
|
|
817
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
818
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
819
|
+
default:
|
|
820
|
+
const parsedBody = parsedOutput.body;
|
|
821
|
+
return throwDefaultError({
|
|
822
|
+
output,
|
|
823
|
+
parsedBody,
|
|
824
|
+
errorCode
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
}, "de_PostTextCommandError");
|
|
828
|
+
var de_PutSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
829
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
830
|
+
return de_PutSessionCommandError(output, context);
|
|
831
|
+
}
|
|
832
|
+
const contents = (0, import_smithy_client.map)({
|
|
833
|
+
$metadata: deserializeMetadata(output),
|
|
834
|
+
[_cT]: [, output.headers[_ct]],
|
|
835
|
+
[_iN]: [, output.headers[_xalin]],
|
|
836
|
+
[_s]: [
|
|
837
|
+
() => void 0 !== output.headers[_xals],
|
|
838
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8"))
|
|
839
|
+
],
|
|
840
|
+
[_sA]: [
|
|
841
|
+
() => void 0 !== output.headers[_xalsa],
|
|
842
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8"))
|
|
843
|
+
],
|
|
844
|
+
[_m]: [, output.headers[_xalm]],
|
|
845
|
+
[_eM]: [, output.headers[_xalem]],
|
|
846
|
+
[_mF]: [, output.headers[_xalmf]],
|
|
847
|
+
[_dS]: [, output.headers[_xalds]],
|
|
848
|
+
[_sTE]: [, output.headers[_xalste]],
|
|
849
|
+
[_sI]: [, output.headers[_xalsi]],
|
|
850
|
+
[_aC]: [
|
|
851
|
+
() => void 0 !== output.headers[_xalac],
|
|
852
|
+
() => new import_smithy_client.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8"))
|
|
853
|
+
]
|
|
854
|
+
});
|
|
855
|
+
const data = output.body;
|
|
856
|
+
context.sdkStreamMixin(data);
|
|
857
|
+
contents.audioStream = data;
|
|
858
|
+
return contents;
|
|
859
|
+
}, "de_PutSessionCommand");
|
|
860
|
+
var de_PutSessionCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
861
|
+
const parsedOutput = {
|
|
862
|
+
...output,
|
|
863
|
+
body: await parseErrorBody(output.body, context)
|
|
864
|
+
};
|
|
865
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
866
|
+
switch (errorCode) {
|
|
867
|
+
case "BadGatewayException":
|
|
868
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException":
|
|
869
|
+
throw await de_BadGatewayExceptionRes(parsedOutput, context);
|
|
870
|
+
case "BadRequestException":
|
|
871
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
872
|
+
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
873
|
+
case "ConflictException":
|
|
874
|
+
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
875
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
876
|
+
case "DependencyFailedException":
|
|
877
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException":
|
|
878
|
+
throw await de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
879
|
+
case "InternalFailureException":
|
|
880
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
881
|
+
throw await de_InternalFailureExceptionRes(parsedOutput, context);
|
|
882
|
+
case "LimitExceededException":
|
|
883
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
884
|
+
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
885
|
+
case "NotAcceptableException":
|
|
886
|
+
case "com.amazonaws.lexruntimeservice#NotAcceptableException":
|
|
887
|
+
throw await de_NotAcceptableExceptionRes(parsedOutput, context);
|
|
888
|
+
case "NotFoundException":
|
|
889
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
890
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
891
|
+
default:
|
|
892
|
+
const parsedBody = parsedOutput.body;
|
|
893
|
+
return throwDefaultError({
|
|
894
|
+
output,
|
|
895
|
+
parsedBody,
|
|
896
|
+
errorCode
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
}, "de_PutSessionCommandError");
|
|
900
|
+
var throwDefaultError = (0, import_smithy_client.withBaseException)(LexRuntimeServiceServiceException);
|
|
901
|
+
var de_BadGatewayExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
902
|
+
const contents = (0, import_smithy_client.map)({});
|
|
903
|
+
const data = parsedOutput.body;
|
|
904
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
905
|
+
Message: import_smithy_client.expectString
|
|
906
|
+
});
|
|
907
|
+
Object.assign(contents, doc);
|
|
908
|
+
const exception = new BadGatewayException({
|
|
909
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
910
|
+
...contents
|
|
911
|
+
});
|
|
912
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
913
|
+
}, "de_BadGatewayExceptionRes");
|
|
914
|
+
var de_BadRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
915
|
+
const contents = (0, import_smithy_client.map)({});
|
|
916
|
+
const data = parsedOutput.body;
|
|
917
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
918
|
+
message: import_smithy_client.expectString
|
|
919
|
+
});
|
|
920
|
+
Object.assign(contents, doc);
|
|
921
|
+
const exception = new BadRequestException({
|
|
922
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
923
|
+
...contents
|
|
924
|
+
});
|
|
925
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
926
|
+
}, "de_BadRequestExceptionRes");
|
|
927
|
+
var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
928
|
+
const contents = (0, import_smithy_client.map)({});
|
|
929
|
+
const data = parsedOutput.body;
|
|
930
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
931
|
+
message: import_smithy_client.expectString
|
|
932
|
+
});
|
|
933
|
+
Object.assign(contents, doc);
|
|
934
|
+
const exception = new ConflictException({
|
|
935
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
936
|
+
...contents
|
|
937
|
+
});
|
|
938
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
939
|
+
}, "de_ConflictExceptionRes");
|
|
940
|
+
var de_DependencyFailedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
941
|
+
const contents = (0, import_smithy_client.map)({});
|
|
942
|
+
const data = parsedOutput.body;
|
|
943
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
944
|
+
Message: import_smithy_client.expectString
|
|
945
|
+
});
|
|
946
|
+
Object.assign(contents, doc);
|
|
947
|
+
const exception = new DependencyFailedException({
|
|
948
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
949
|
+
...contents
|
|
950
|
+
});
|
|
951
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
952
|
+
}, "de_DependencyFailedExceptionRes");
|
|
953
|
+
var de_InternalFailureExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
954
|
+
const contents = (0, import_smithy_client.map)({});
|
|
955
|
+
const data = parsedOutput.body;
|
|
956
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
957
|
+
message: import_smithy_client.expectString
|
|
958
|
+
});
|
|
959
|
+
Object.assign(contents, doc);
|
|
960
|
+
const exception = new InternalFailureException({
|
|
961
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
962
|
+
...contents
|
|
963
|
+
});
|
|
964
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
965
|
+
}, "de_InternalFailureExceptionRes");
|
|
966
|
+
var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
967
|
+
const contents = (0, import_smithy_client.map)({
|
|
968
|
+
[_rAS]: [, parsedOutput.headers[_ra]]
|
|
969
|
+
});
|
|
970
|
+
const data = parsedOutput.body;
|
|
971
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
972
|
+
message: import_smithy_client.expectString
|
|
973
|
+
});
|
|
974
|
+
Object.assign(contents, doc);
|
|
975
|
+
const exception = new LimitExceededException({
|
|
976
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
977
|
+
...contents
|
|
978
|
+
});
|
|
979
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
980
|
+
}, "de_LimitExceededExceptionRes");
|
|
981
|
+
var de_LoopDetectedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
982
|
+
const contents = (0, import_smithy_client.map)({});
|
|
983
|
+
const data = parsedOutput.body;
|
|
984
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
985
|
+
Message: import_smithy_client.expectString
|
|
986
|
+
});
|
|
987
|
+
Object.assign(contents, doc);
|
|
988
|
+
const exception = new LoopDetectedException({
|
|
989
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
990
|
+
...contents
|
|
991
|
+
});
|
|
992
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
993
|
+
}, "de_LoopDetectedExceptionRes");
|
|
994
|
+
var de_NotAcceptableExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
995
|
+
const contents = (0, import_smithy_client.map)({});
|
|
996
|
+
const data = parsedOutput.body;
|
|
997
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
998
|
+
message: import_smithy_client.expectString
|
|
999
|
+
});
|
|
1000
|
+
Object.assign(contents, doc);
|
|
1001
|
+
const exception = new NotAcceptableException({
|
|
1002
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1003
|
+
...contents
|
|
1004
|
+
});
|
|
1005
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
1006
|
+
}, "de_NotAcceptableExceptionRes");
|
|
1007
|
+
var de_NotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
1008
|
+
const contents = (0, import_smithy_client.map)({});
|
|
1009
|
+
const data = parsedOutput.body;
|
|
1010
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
1011
|
+
message: import_smithy_client.expectString
|
|
1012
|
+
});
|
|
1013
|
+
Object.assign(contents, doc);
|
|
1014
|
+
const exception = new NotFoundException({
|
|
1015
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1016
|
+
...contents
|
|
1017
|
+
});
|
|
1018
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
1019
|
+
}, "de_NotFoundExceptionRes");
|
|
1020
|
+
var de_RequestTimeoutExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
1021
|
+
const contents = (0, import_smithy_client.map)({});
|
|
1022
|
+
const data = parsedOutput.body;
|
|
1023
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
1024
|
+
message: import_smithy_client.expectString
|
|
1025
|
+
});
|
|
1026
|
+
Object.assign(contents, doc);
|
|
1027
|
+
const exception = new RequestTimeoutException({
|
|
1028
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1029
|
+
...contents
|
|
1030
|
+
});
|
|
1031
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
1032
|
+
}, "de_RequestTimeoutExceptionRes");
|
|
1033
|
+
var de_UnsupportedMediaTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
1034
|
+
const contents = (0, import_smithy_client.map)({});
|
|
1035
|
+
const data = parsedOutput.body;
|
|
1036
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
1037
|
+
message: import_smithy_client.expectString
|
|
1038
|
+
});
|
|
1039
|
+
Object.assign(contents, doc);
|
|
1040
|
+
const exception = new UnsupportedMediaTypeException({
|
|
1041
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1042
|
+
...contents
|
|
1043
|
+
});
|
|
1044
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
1045
|
+
}, "de_UnsupportedMediaTypeExceptionRes");
|
|
1046
|
+
var de_IntentConfidence = /* @__PURE__ */ __name((output, context) => {
|
|
1047
|
+
return (0, import_smithy_client.take)(output, {
|
|
1048
|
+
score: import_smithy_client.limitedParseDouble
|
|
1049
|
+
});
|
|
1050
|
+
}, "de_IntentConfidence");
|
|
1051
|
+
var de_IntentList = /* @__PURE__ */ __name((output, context) => {
|
|
1052
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1053
|
+
return de_PredictedIntent(entry, context);
|
|
1054
|
+
});
|
|
1055
|
+
return retVal;
|
|
1056
|
+
}, "de_IntentList");
|
|
1057
|
+
var de_PredictedIntent = /* @__PURE__ */ __name((output, context) => {
|
|
1058
|
+
return (0, import_smithy_client.take)(output, {
|
|
1059
|
+
intentName: import_smithy_client.expectString,
|
|
1060
|
+
nluIntentConfidence: (_) => de_IntentConfidence(_, context),
|
|
1061
|
+
slots: import_smithy_client._json
|
|
1062
|
+
});
|
|
1063
|
+
}, "de_PredictedIntent");
|
|
1064
|
+
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
1065
|
+
httpStatusCode: output.statusCode,
|
|
1066
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1067
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1068
|
+
cfId: output.headers["x-amz-cf-id"]
|
|
1069
|
+
}), "deserializeMetadata");
|
|
1070
|
+
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
1071
|
+
var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
|
|
1072
|
+
var _a = "accept";
|
|
1073
|
+
var _aC = "activeContexts";
|
|
1074
|
+
var _aI = "alternativeIntents";
|
|
1075
|
+
var _bV = "botVersion";
|
|
1076
|
+
var _cLF = "checkpointLabelFilter";
|
|
1077
|
+
var _cT = "contentType";
|
|
1078
|
+
var _ct = "content-type";
|
|
1079
|
+
var _dS = "dialogState";
|
|
1080
|
+
var _eIT = "encodedInputTranscript";
|
|
1081
|
+
var _eM = "encodedMessage";
|
|
1082
|
+
var _iN = "intentName";
|
|
1083
|
+
var _iT = "inputTranscript";
|
|
1084
|
+
var _m = "message";
|
|
1085
|
+
var _mF = "messageFormat";
|
|
1086
|
+
var _nIC = "nluIntentConfidence";
|
|
1087
|
+
var _rA = "requestAttributes";
|
|
1088
|
+
var _rAS = "retryAfterSeconds";
|
|
1089
|
+
var _ra = "retry-after";
|
|
1090
|
+
var _s = "slots";
|
|
1091
|
+
var _sA = "sessionAttributes";
|
|
1092
|
+
var _sI = "sessionId";
|
|
1093
|
+
var _sR = "sentimentResponse";
|
|
1094
|
+
var _sTE = "slotToElicit";
|
|
1095
|
+
var _xalac = "x-amz-lex-active-contexts";
|
|
1096
|
+
var _xalai = "x-amz-lex-alternative-intents";
|
|
1097
|
+
var _xalbv = "x-amz-lex-bot-version";
|
|
1098
|
+
var _xalds = "x-amz-lex-dialog-state";
|
|
1099
|
+
var _xaleit = "x-amz-lex-encoded-input-transcript";
|
|
1100
|
+
var _xalem = "x-amz-lex-encoded-message";
|
|
1101
|
+
var _xalin = "x-amz-lex-intent-name";
|
|
1102
|
+
var _xalit = "x-amz-lex-input-transcript";
|
|
1103
|
+
var _xalm = "x-amz-lex-message";
|
|
1104
|
+
var _xalmf = "x-amz-lex-message-format";
|
|
1105
|
+
var _xalnic = "x-amz-lex-nlu-intent-confidence";
|
|
1106
|
+
var _xalra = "x-amz-lex-request-attributes";
|
|
1107
|
+
var _xals = "x-amz-lex-slots";
|
|
1108
|
+
var _xals_ = "x-amz-lex-sentiment";
|
|
1109
|
+
var _xalsa = "x-amz-lex-session-attributes";
|
|
1110
|
+
var _xalsi = "x-amz-lex-session-id";
|
|
1111
|
+
var _xalste = "x-amz-lex-slot-to-elicit";
|
|
1112
|
+
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1113
|
+
if (encoded.length) {
|
|
1114
|
+
return JSON.parse(encoded);
|
|
1115
|
+
}
|
|
1116
|
+
return {};
|
|
1117
|
+
}), "parseBody");
|
|
1118
|
+
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
1119
|
+
const value = await parseBody(errorBody, context);
|
|
1120
|
+
value.message = value.message ?? value.Message;
|
|
1121
|
+
return value;
|
|
1122
|
+
}, "parseErrorBody");
|
|
1123
|
+
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
1124
|
+
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
1125
|
+
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
1126
|
+
let cleanValue = rawValue;
|
|
1127
|
+
if (typeof cleanValue === "number") {
|
|
1128
|
+
cleanValue = cleanValue.toString();
|
|
1129
|
+
}
|
|
1130
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
1131
|
+
cleanValue = cleanValue.split(",")[0];
|
|
1132
|
+
}
|
|
1133
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
1134
|
+
cleanValue = cleanValue.split(":")[0];
|
|
1135
|
+
}
|
|
1136
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
1137
|
+
cleanValue = cleanValue.split("#")[1];
|
|
1138
|
+
}
|
|
1139
|
+
return cleanValue;
|
|
1140
|
+
}, "sanitizeErrorCode");
|
|
1141
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1142
|
+
if (headerKey !== void 0) {
|
|
1143
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1144
|
+
}
|
|
1145
|
+
if (data.code !== void 0) {
|
|
1146
|
+
return sanitizeErrorCode(data.code);
|
|
1147
|
+
}
|
|
1148
|
+
if (data["__type"] !== void 0) {
|
|
1149
|
+
return sanitizeErrorCode(data["__type"]);
|
|
1150
|
+
}
|
|
1151
|
+
}, "loadRestJsonErrorCode");
|
|
1152
|
+
|
|
1153
|
+
// src/commands/DeleteSessionCommand.ts
|
|
1154
|
+
var _DeleteSessionCommand = class _DeleteSessionCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
1155
|
+
...commonParams
|
|
1156
|
+
}).m(function(Command, cs, config, o) {
|
|
1157
|
+
return [
|
|
1158
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
1159
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
1160
|
+
];
|
|
1161
|
+
}).s("AWSDeepSenseRunTimeService", "DeleteSession", {}).n("LexRuntimeServiceClient", "DeleteSessionCommand").f(void 0, void 0).ser(se_DeleteSessionCommand).de(de_DeleteSessionCommand).build() {
|
|
1162
|
+
};
|
|
1163
|
+
__name(_DeleteSessionCommand, "DeleteSessionCommand");
|
|
1164
|
+
var DeleteSessionCommand = _DeleteSessionCommand;
|
|
1165
|
+
|
|
1166
|
+
// src/commands/GetSessionCommand.ts
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
var _GetSessionCommand = class _GetSessionCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
1172
|
+
...commonParams
|
|
1173
|
+
}).m(function(Command, cs, config, o) {
|
|
1174
|
+
return [
|
|
1175
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
1176
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
1177
|
+
];
|
|
1178
|
+
}).s("AWSDeepSenseRunTimeService", "GetSession", {}).n("LexRuntimeServiceClient", "GetSessionCommand").f(void 0, GetSessionResponseFilterSensitiveLog).ser(se_GetSessionCommand).de(de_GetSessionCommand).build() {
|
|
1179
|
+
};
|
|
1180
|
+
__name(_GetSessionCommand, "GetSessionCommand");
|
|
1181
|
+
var GetSessionCommand = _GetSessionCommand;
|
|
1182
|
+
|
|
1183
|
+
// src/commands/PostContentCommand.ts
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
var _PostContentCommand = class _PostContentCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
1189
|
+
...commonParams
|
|
1190
|
+
}).m(function(Command, cs, config, o) {
|
|
1191
|
+
return [
|
|
1192
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
1193
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
1194
|
+
];
|
|
1195
|
+
}).s("AWSDeepSenseRunTimeService", "PostContent", {}).n("LexRuntimeServiceClient", "PostContentCommand").f(PostContentRequestFilterSensitiveLog, PostContentResponseFilterSensitiveLog).ser(se_PostContentCommand).de(de_PostContentCommand).build() {
|
|
1196
|
+
};
|
|
1197
|
+
__name(_PostContentCommand, "PostContentCommand");
|
|
1198
|
+
var PostContentCommand = _PostContentCommand;
|
|
1199
|
+
|
|
1200
|
+
// src/commands/PostTextCommand.ts
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
var _PostTextCommand = class _PostTextCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
1206
|
+
...commonParams
|
|
1207
|
+
}).m(function(Command, cs, config, o) {
|
|
1208
|
+
return [
|
|
1209
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
1210
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
1211
|
+
];
|
|
1212
|
+
}).s("AWSDeepSenseRunTimeService", "PostText", {}).n("LexRuntimeServiceClient", "PostTextCommand").f(PostTextRequestFilterSensitiveLog, PostTextResponseFilterSensitiveLog).ser(se_PostTextCommand).de(de_PostTextCommand).build() {
|
|
1213
|
+
};
|
|
1214
|
+
__name(_PostTextCommand, "PostTextCommand");
|
|
1215
|
+
var PostTextCommand = _PostTextCommand;
|
|
1216
|
+
|
|
1217
|
+
// src/commands/PutSessionCommand.ts
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
var _PutSessionCommand = class _PutSessionCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
1223
|
+
...commonParams
|
|
1224
|
+
}).m(function(Command, cs, config, o) {
|
|
1225
|
+
return [
|
|
1226
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
1227
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
1228
|
+
];
|
|
1229
|
+
}).s("AWSDeepSenseRunTimeService", "PutSession", {}).n("LexRuntimeServiceClient", "PutSessionCommand").f(PutSessionRequestFilterSensitiveLog, PutSessionResponseFilterSensitiveLog).ser(se_PutSessionCommand).de(de_PutSessionCommand).build() {
|
|
1230
|
+
};
|
|
1231
|
+
__name(_PutSessionCommand, "PutSessionCommand");
|
|
1232
|
+
var PutSessionCommand = _PutSessionCommand;
|
|
1233
|
+
|
|
1234
|
+
// src/LexRuntimeService.ts
|
|
1235
|
+
var commands = {
|
|
1236
|
+
DeleteSessionCommand,
|
|
1237
|
+
GetSessionCommand,
|
|
1238
|
+
PostContentCommand,
|
|
1239
|
+
PostTextCommand,
|
|
1240
|
+
PutSessionCommand
|
|
1241
|
+
};
|
|
1242
|
+
var _LexRuntimeService = class _LexRuntimeService extends LexRuntimeServiceClient {
|
|
1243
|
+
};
|
|
1244
|
+
__name(_LexRuntimeService, "LexRuntimeService");
|
|
1245
|
+
var LexRuntimeService = _LexRuntimeService;
|
|
1246
|
+
(0, import_smithy_client.createAggregatedClient)(commands, LexRuntimeService);
|
|
1247
|
+
|
|
1248
|
+
// src/index.ts
|
|
1249
|
+
var import_util_endpoints = require("@aws-sdk/util-endpoints");
|
|
1250
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1251
|
+
0 && (module.exports = {
|
|
1252
|
+
ActiveContextFilterSensitiveLog,
|
|
1253
|
+
BadGatewayException,
|
|
1254
|
+
BadRequestException,
|
|
1255
|
+
ConfirmationStatus,
|
|
1256
|
+
ConflictException,
|
|
1257
|
+
ContentType,
|
|
1258
|
+
DeleteSessionCommand,
|
|
1259
|
+
DependencyFailedException,
|
|
1260
|
+
DialogActionFilterSensitiveLog,
|
|
1261
|
+
DialogActionType,
|
|
1262
|
+
DialogState,
|
|
1263
|
+
FulfillmentState,
|
|
1264
|
+
GetSessionCommand,
|
|
1265
|
+
GetSessionResponseFilterSensitiveLog,
|
|
1266
|
+
IntentSummaryFilterSensitiveLog,
|
|
1267
|
+
InternalFailureException,
|
|
1268
|
+
LexRuntimeService,
|
|
1269
|
+
LexRuntimeServiceClient,
|
|
1270
|
+
LexRuntimeServiceServiceException,
|
|
1271
|
+
LimitExceededException,
|
|
1272
|
+
LoopDetectedException,
|
|
1273
|
+
MessageFormatType,
|
|
1274
|
+
NotAcceptableException,
|
|
1275
|
+
NotFoundException,
|
|
1276
|
+
PostContentCommand,
|
|
1277
|
+
PostContentRequestFilterSensitiveLog,
|
|
1278
|
+
PostContentResponseFilterSensitiveLog,
|
|
1279
|
+
PostTextCommand,
|
|
1280
|
+
PostTextRequestFilterSensitiveLog,
|
|
1281
|
+
PostTextResponseFilterSensitiveLog,
|
|
1282
|
+
PredictedIntentFilterSensitiveLog,
|
|
1283
|
+
PutSessionCommand,
|
|
1284
|
+
PutSessionRequestFilterSensitiveLog,
|
|
1285
|
+
PutSessionResponseFilterSensitiveLog,
|
|
1286
|
+
RequestTimeoutException,
|
|
1287
|
+
UnsupportedMediaTypeException,
|
|
1288
|
+
__Client
|
|
1289
|
+
});
|