@aws-sdk/client-lex-runtime-service 3.476.0 → 3.477.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/protocols/Aws_restJson1.js +134 -135
- package/dist-es/protocols/Aws_restJson1.js +135 -136
- package/package.json +5 -4
|
@@ -1,103 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.de_PutSessionCommand = exports.de_PostTextCommand = exports.de_PostContentCommand = exports.de_GetSessionCommand = exports.de_DeleteSessionCommand = exports.se_PutSessionCommand = exports.se_PostTextCommand = exports.se_PostContentCommand = exports.se_GetSessionCommand = exports.se_DeleteSessionCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@smithy/core");
|
|
5
5
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
6
|
const LexRuntimeServiceServiceException_1 = require("../models/LexRuntimeServiceServiceException");
|
|
7
7
|
const models_0_1 = require("../models/models_0");
|
|
8
8
|
const se_DeleteSessionCommand = async (input, context) => {
|
|
9
|
-
const
|
|
9
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
10
10
|
const headers = {};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
11
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
12
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
13
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
14
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
16
15
|
let body;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
hostname,
|
|
20
|
-
port,
|
|
21
|
-
method: "DELETE",
|
|
22
|
-
headers,
|
|
23
|
-
path: resolvedPath,
|
|
24
|
-
body,
|
|
25
|
-
});
|
|
16
|
+
b.m("DELETE").h(headers).b(body);
|
|
17
|
+
return b.build();
|
|
26
18
|
};
|
|
27
19
|
exports.se_DeleteSessionCommand = se_DeleteSessionCommand;
|
|
28
20
|
const se_GetSessionCommand = async (input, context) => {
|
|
29
|
-
const
|
|
21
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
30
22
|
const headers = {};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
23
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
24
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
25
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
26
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
36
27
|
const query = (0, smithy_client_1.map)({
|
|
37
|
-
|
|
28
|
+
[_cLF]: [, input[_cLF]],
|
|
38
29
|
});
|
|
39
30
|
let body;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
hostname,
|
|
43
|
-
port,
|
|
44
|
-
method: "GET",
|
|
45
|
-
headers,
|
|
46
|
-
path: resolvedPath,
|
|
47
|
-
query,
|
|
48
|
-
body,
|
|
49
|
-
});
|
|
31
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
32
|
+
return b.build();
|
|
50
33
|
};
|
|
51
34
|
exports.se_GetSessionCommand = se_GetSessionCommand;
|
|
52
35
|
const se_PostContentCommand = async (input, context) => {
|
|
53
|
-
const
|
|
36
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
54
37
|
const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
|
|
55
38
|
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
() => isSerializableHeaderValue(input
|
|
59
|
-
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input
|
|
39
|
+
[_ct]: input[_cT] || "application/octet-stream",
|
|
40
|
+
[_xalsa]: [
|
|
41
|
+
() => isSerializableHeaderValue(input[_sA]),
|
|
42
|
+
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input[_sA]))),
|
|
60
43
|
],
|
|
61
|
-
|
|
62
|
-
() => isSerializableHeaderValue(input
|
|
63
|
-
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input
|
|
44
|
+
[_xalra]: [
|
|
45
|
+
() => isSerializableHeaderValue(input[_rA]),
|
|
46
|
+
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input[_rA]))),
|
|
64
47
|
],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
() => isSerializableHeaderValue(input
|
|
68
|
-
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input
|
|
48
|
+
[_a]: input[_a],
|
|
49
|
+
[_xalac]: [
|
|
50
|
+
() => isSerializableHeaderValue(input[_aC]),
|
|
51
|
+
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input[_aC]))),
|
|
69
52
|
],
|
|
70
53
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
54
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/content");
|
|
55
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
56
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
57
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
76
58
|
let body;
|
|
77
59
|
if (input.inputStream !== undefined) {
|
|
78
60
|
body = input.inputStream;
|
|
79
61
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
hostname,
|
|
83
|
-
port,
|
|
84
|
-
method: "POST",
|
|
85
|
-
headers,
|
|
86
|
-
path: resolvedPath,
|
|
87
|
-
body,
|
|
88
|
-
});
|
|
62
|
+
b.m("POST").h(headers).b(body);
|
|
63
|
+
return b.build();
|
|
89
64
|
};
|
|
90
65
|
exports.se_PostContentCommand = se_PostContentCommand;
|
|
91
66
|
const se_PostTextCommand = async (input, context) => {
|
|
92
|
-
const
|
|
67
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
93
68
|
const headers = {
|
|
94
69
|
"content-type": "application/json",
|
|
95
70
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
71
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/text");
|
|
72
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
73
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
74
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
101
75
|
let body;
|
|
102
76
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
103
77
|
activeContexts: (_) => (0, smithy_client_1._json)(_),
|
|
@@ -105,28 +79,20 @@ const se_PostTextCommand = async (input, context) => {
|
|
|
105
79
|
requestAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
106
80
|
sessionAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
107
81
|
}));
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
hostname,
|
|
111
|
-
port,
|
|
112
|
-
method: "POST",
|
|
113
|
-
headers,
|
|
114
|
-
path: resolvedPath,
|
|
115
|
-
body,
|
|
116
|
-
});
|
|
82
|
+
b.m("POST").h(headers).b(body);
|
|
83
|
+
return b.build();
|
|
117
84
|
};
|
|
118
85
|
exports.se_PostTextCommand = se_PostTextCommand;
|
|
119
86
|
const se_PutSessionCommand = async (input, context) => {
|
|
120
|
-
const
|
|
87
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
121
88
|
const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
|
|
122
89
|
"content-type": "application/json",
|
|
123
|
-
|
|
90
|
+
[_a]: input[_a],
|
|
124
91
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
92
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
93
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
94
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
95
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
130
96
|
let body;
|
|
131
97
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
132
98
|
activeContexts: (_) => (0, smithy_client_1._json)(_),
|
|
@@ -134,15 +100,8 @@ const se_PutSessionCommand = async (input, context) => {
|
|
|
134
100
|
recentIntentSummaryView: (_) => (0, smithy_client_1._json)(_),
|
|
135
101
|
sessionAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
136
102
|
}));
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
hostname,
|
|
140
|
-
port,
|
|
141
|
-
method: "POST",
|
|
142
|
-
headers,
|
|
143
|
-
path: resolvedPath,
|
|
144
|
-
body,
|
|
145
|
-
});
|
|
103
|
+
b.m("POST").h(headers).b(body);
|
|
104
|
+
return b.build();
|
|
146
105
|
};
|
|
147
106
|
exports.se_PutSessionCommand = se_PutSessionCommand;
|
|
148
107
|
const de_DeleteSessionCommand = async (output, context) => {
|
|
@@ -247,37 +206,37 @@ const de_PostContentCommand = async (output, context) => {
|
|
|
247
206
|
}
|
|
248
207
|
const contents = (0, smithy_client_1.map)({
|
|
249
208
|
$metadata: deserializeMetadata(output),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
() => void 0 !== output.headers[
|
|
254
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
209
|
+
[_cT]: [, output.headers[_ct]],
|
|
210
|
+
[_iN]: [, output.headers[_xalin]],
|
|
211
|
+
[_nIC]: [
|
|
212
|
+
() => void 0 !== output.headers[_xalnic],
|
|
213
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalnic])).toString("utf8")),
|
|
255
214
|
],
|
|
256
|
-
|
|
257
|
-
() => void 0 !== output.headers[
|
|
258
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
215
|
+
[_aI]: [
|
|
216
|
+
() => void 0 !== output.headers[_xalai],
|
|
217
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalai])).toString("utf8")),
|
|
259
218
|
],
|
|
260
|
-
|
|
261
|
-
() => void 0 !== output.headers[
|
|
262
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
219
|
+
[_s]: [
|
|
220
|
+
() => void 0 !== output.headers[_xals],
|
|
221
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")),
|
|
263
222
|
],
|
|
264
|
-
|
|
265
|
-
() => void 0 !== output.headers[
|
|
266
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
223
|
+
[_sA]: [
|
|
224
|
+
() => void 0 !== output.headers[_xalsa],
|
|
225
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")),
|
|
267
226
|
],
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
() => void 0 !== output.headers[
|
|
280
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
227
|
+
[_sR]: [, output.headers[_xals_]],
|
|
228
|
+
[_m]: [, output.headers[_xalm]],
|
|
229
|
+
[_eM]: [, output.headers[_xalem]],
|
|
230
|
+
[_mF]: [, output.headers[_xalmf]],
|
|
231
|
+
[_dS]: [, output.headers[_xalds]],
|
|
232
|
+
[_sTE]: [, output.headers[_xalste]],
|
|
233
|
+
[_iT]: [, output.headers[_xalit]],
|
|
234
|
+
[_eIT]: [, output.headers[_xaleit]],
|
|
235
|
+
[_bV]: [, output.headers[_xalbv]],
|
|
236
|
+
[_sI]: [, output.headers[_xalsi]],
|
|
237
|
+
[_aC]: [
|
|
238
|
+
() => void 0 !== output.headers[_xalac],
|
|
239
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")),
|
|
281
240
|
],
|
|
282
241
|
});
|
|
283
242
|
const data = output.body;
|
|
@@ -409,25 +368,25 @@ const de_PutSessionCommand = async (output, context) => {
|
|
|
409
368
|
}
|
|
410
369
|
const contents = (0, smithy_client_1.map)({
|
|
411
370
|
$metadata: deserializeMetadata(output),
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
() => void 0 !== output.headers[
|
|
416
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
371
|
+
[_cT]: [, output.headers[_ct]],
|
|
372
|
+
[_iN]: [, output.headers[_xalin]],
|
|
373
|
+
[_s]: [
|
|
374
|
+
() => void 0 !== output.headers[_xals],
|
|
375
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")),
|
|
417
376
|
],
|
|
418
|
-
|
|
419
|
-
() => void 0 !== output.headers[
|
|
420
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
377
|
+
[_sA]: [
|
|
378
|
+
() => void 0 !== output.headers[_xalsa],
|
|
379
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")),
|
|
421
380
|
],
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
() => void 0 !== output.headers[
|
|
430
|
-
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
381
|
+
[_m]: [, output.headers[_xalm]],
|
|
382
|
+
[_eM]: [, output.headers[_xalem]],
|
|
383
|
+
[_mF]: [, output.headers[_xalmf]],
|
|
384
|
+
[_dS]: [, output.headers[_xalds]],
|
|
385
|
+
[_sTE]: [, output.headers[_xalste]],
|
|
386
|
+
[_sI]: [, output.headers[_xalsi]],
|
|
387
|
+
[_aC]: [
|
|
388
|
+
() => void 0 !== output.headers[_xalac],
|
|
389
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")),
|
|
431
390
|
],
|
|
432
391
|
});
|
|
433
392
|
const data = output.body;
|
|
@@ -544,7 +503,7 @@ const de_InternalFailureExceptionRes = async (parsedOutput, context) => {
|
|
|
544
503
|
};
|
|
545
504
|
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
546
505
|
const contents = (0, smithy_client_1.map)({
|
|
547
|
-
|
|
506
|
+
[_rAS]: [, parsedOutput.headers[_ra]],
|
|
548
507
|
});
|
|
549
508
|
const data = parsedOutput.body;
|
|
550
509
|
const doc = (0, smithy_client_1.take)(data, {
|
|
@@ -654,6 +613,46 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
|
654
613
|
value !== "" &&
|
|
655
614
|
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
656
615
|
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
616
|
+
const _a = "accept";
|
|
617
|
+
const _aC = "activeContexts";
|
|
618
|
+
const _aI = "alternativeIntents";
|
|
619
|
+
const _bV = "botVersion";
|
|
620
|
+
const _cLF = "checkpointLabelFilter";
|
|
621
|
+
const _cT = "contentType";
|
|
622
|
+
const _ct = "content-type";
|
|
623
|
+
const _dS = "dialogState";
|
|
624
|
+
const _eIT = "encodedInputTranscript";
|
|
625
|
+
const _eM = "encodedMessage";
|
|
626
|
+
const _iN = "intentName";
|
|
627
|
+
const _iT = "inputTranscript";
|
|
628
|
+
const _m = "message";
|
|
629
|
+
const _mF = "messageFormat";
|
|
630
|
+
const _nIC = "nluIntentConfidence";
|
|
631
|
+
const _rA = "requestAttributes";
|
|
632
|
+
const _rAS = "retryAfterSeconds";
|
|
633
|
+
const _ra = "retry-after";
|
|
634
|
+
const _s = "slots";
|
|
635
|
+
const _sA = "sessionAttributes";
|
|
636
|
+
const _sI = "sessionId";
|
|
637
|
+
const _sR = "sentimentResponse";
|
|
638
|
+
const _sTE = "slotToElicit";
|
|
639
|
+
const _xalac = "x-amz-lex-active-contexts";
|
|
640
|
+
const _xalai = "x-amz-lex-alternative-intents";
|
|
641
|
+
const _xalbv = "x-amz-lex-bot-version";
|
|
642
|
+
const _xalds = "x-amz-lex-dialog-state";
|
|
643
|
+
const _xaleit = "x-amz-lex-encoded-input-transcript";
|
|
644
|
+
const _xalem = "x-amz-lex-encoded-message";
|
|
645
|
+
const _xalin = "x-amz-lex-intent-name";
|
|
646
|
+
const _xalit = "x-amz-lex-input-transcript";
|
|
647
|
+
const _xalm = "x-amz-lex-message";
|
|
648
|
+
const _xalmf = "x-amz-lex-message-format";
|
|
649
|
+
const _xalnic = "x-amz-lex-nlu-intent-confidence";
|
|
650
|
+
const _xalra = "x-amz-lex-request-attributes";
|
|
651
|
+
const _xals = "x-amz-lex-slots";
|
|
652
|
+
const _xals_ = "x-amz-lex-sentiment";
|
|
653
|
+
const _xalsa = "x-amz-lex-session-attributes";
|
|
654
|
+
const _xalsi = "x-amz-lex-session-id";
|
|
655
|
+
const _xalste = "x-amz-lex-slot-to-elicit";
|
|
657
656
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
658
657
|
if (encoded.length) {
|
|
659
658
|
return JSON.parse(encoded);
|
|
@@ -1,97 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map,
|
|
1
|
+
import { requestBuilder as rb } from "@smithy/core";
|
|
2
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
3
|
import { LexRuntimeServiceServiceException as __BaseException } from "../models/LexRuntimeServiceServiceException";
|
|
4
4
|
import { BadGatewayException, BadRequestException, ConflictException, DependencyFailedException, InternalFailureException, LimitExceededException, LoopDetectedException, NotAcceptableException, NotFoundException, RequestTimeoutException, UnsupportedMediaTypeException, } from "../models/models_0";
|
|
5
5
|
export const se_DeleteSessionCommand = async (input, context) => {
|
|
6
|
-
const
|
|
6
|
+
const b = rb(input, context);
|
|
7
7
|
const headers = {};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
8
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
9
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
10
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
11
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
13
12
|
let body;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hostname,
|
|
17
|
-
port,
|
|
18
|
-
method: "DELETE",
|
|
19
|
-
headers,
|
|
20
|
-
path: resolvedPath,
|
|
21
|
-
body,
|
|
22
|
-
});
|
|
13
|
+
b.m("DELETE").h(headers).b(body);
|
|
14
|
+
return b.build();
|
|
23
15
|
};
|
|
24
16
|
export const se_GetSessionCommand = async (input, context) => {
|
|
25
|
-
const
|
|
17
|
+
const b = rb(input, context);
|
|
26
18
|
const headers = {};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
19
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
20
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
21
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
22
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
32
23
|
const query = map({
|
|
33
|
-
|
|
24
|
+
[_cLF]: [, input[_cLF]],
|
|
34
25
|
});
|
|
35
26
|
let body;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
hostname,
|
|
39
|
-
port,
|
|
40
|
-
method: "GET",
|
|
41
|
-
headers,
|
|
42
|
-
path: resolvedPath,
|
|
43
|
-
query,
|
|
44
|
-
body,
|
|
45
|
-
});
|
|
27
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
28
|
+
return b.build();
|
|
46
29
|
};
|
|
47
30
|
export const se_PostContentCommand = async (input, context) => {
|
|
48
|
-
const
|
|
31
|
+
const b = rb(input, context);
|
|
49
32
|
const headers = map({}, isSerializableHeaderValue, {
|
|
50
33
|
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
() => isSerializableHeaderValue(input
|
|
54
|
-
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input
|
|
34
|
+
[_ct]: input[_cT] || "application/octet-stream",
|
|
35
|
+
[_xalsa]: [
|
|
36
|
+
() => isSerializableHeaderValue(input[_sA]),
|
|
37
|
+
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_sA]))),
|
|
55
38
|
],
|
|
56
|
-
|
|
57
|
-
() => isSerializableHeaderValue(input
|
|
58
|
-
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input
|
|
39
|
+
[_xalra]: [
|
|
40
|
+
() => isSerializableHeaderValue(input[_rA]),
|
|
41
|
+
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_rA]))),
|
|
59
42
|
],
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
() => isSerializableHeaderValue(input
|
|
63
|
-
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input
|
|
43
|
+
[_a]: input[_a],
|
|
44
|
+
[_xalac]: [
|
|
45
|
+
() => isSerializableHeaderValue(input[_aC]),
|
|
46
|
+
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_aC]))),
|
|
64
47
|
],
|
|
65
48
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
49
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/content");
|
|
50
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
51
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
52
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
71
53
|
let body;
|
|
72
54
|
if (input.inputStream !== undefined) {
|
|
73
55
|
body = input.inputStream;
|
|
74
56
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
hostname,
|
|
78
|
-
port,
|
|
79
|
-
method: "POST",
|
|
80
|
-
headers,
|
|
81
|
-
path: resolvedPath,
|
|
82
|
-
body,
|
|
83
|
-
});
|
|
57
|
+
b.m("POST").h(headers).b(body);
|
|
58
|
+
return b.build();
|
|
84
59
|
};
|
|
85
60
|
export const se_PostTextCommand = async (input, context) => {
|
|
86
|
-
const
|
|
61
|
+
const b = rb(input, context);
|
|
87
62
|
const headers = {
|
|
88
63
|
"content-type": "application/json",
|
|
89
64
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
65
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/text");
|
|
66
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
67
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
68
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
95
69
|
let body;
|
|
96
70
|
body = JSON.stringify(take(input, {
|
|
97
71
|
activeContexts: (_) => _json(_),
|
|
@@ -99,27 +73,19 @@ export const se_PostTextCommand = async (input, context) => {
|
|
|
99
73
|
requestAttributes: (_) => _json(_),
|
|
100
74
|
sessionAttributes: (_) => _json(_),
|
|
101
75
|
}));
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
hostname,
|
|
105
|
-
port,
|
|
106
|
-
method: "POST",
|
|
107
|
-
headers,
|
|
108
|
-
path: resolvedPath,
|
|
109
|
-
body,
|
|
110
|
-
});
|
|
76
|
+
b.m("POST").h(headers).b(body);
|
|
77
|
+
return b.build();
|
|
111
78
|
};
|
|
112
79
|
export const se_PutSessionCommand = async (input, context) => {
|
|
113
|
-
const
|
|
80
|
+
const b = rb(input, context);
|
|
114
81
|
const headers = map({}, isSerializableHeaderValue, {
|
|
115
82
|
"content-type": "application/json",
|
|
116
|
-
|
|
83
|
+
[_a]: input[_a],
|
|
117
84
|
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
85
|
+
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session");
|
|
86
|
+
b.p("botName", () => input.botName, "{botName}", false);
|
|
87
|
+
b.p("botAlias", () => input.botAlias, "{botAlias}", false);
|
|
88
|
+
b.p("userId", () => input.userId, "{userId}", false);
|
|
123
89
|
let body;
|
|
124
90
|
body = JSON.stringify(take(input, {
|
|
125
91
|
activeContexts: (_) => _json(_),
|
|
@@ -127,15 +93,8 @@ export const se_PutSessionCommand = async (input, context) => {
|
|
|
127
93
|
recentIntentSummaryView: (_) => _json(_),
|
|
128
94
|
sessionAttributes: (_) => _json(_),
|
|
129
95
|
}));
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
hostname,
|
|
133
|
-
port,
|
|
134
|
-
method: "POST",
|
|
135
|
-
headers,
|
|
136
|
-
path: resolvedPath,
|
|
137
|
-
body,
|
|
138
|
-
});
|
|
96
|
+
b.m("POST").h(headers).b(body);
|
|
97
|
+
return b.build();
|
|
139
98
|
};
|
|
140
99
|
export const de_DeleteSessionCommand = async (output, context) => {
|
|
141
100
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -237,37 +196,37 @@ export const de_PostContentCommand = async (output, context) => {
|
|
|
237
196
|
}
|
|
238
197
|
const contents = map({
|
|
239
198
|
$metadata: deserializeMetadata(output),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
() => void 0 !== output.headers[
|
|
244
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
199
|
+
[_cT]: [, output.headers[_ct]],
|
|
200
|
+
[_iN]: [, output.headers[_xalin]],
|
|
201
|
+
[_nIC]: [
|
|
202
|
+
() => void 0 !== output.headers[_xalnic],
|
|
203
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalnic])).toString("utf8")),
|
|
245
204
|
],
|
|
246
|
-
|
|
247
|
-
() => void 0 !== output.headers[
|
|
248
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
205
|
+
[_aI]: [
|
|
206
|
+
() => void 0 !== output.headers[_xalai],
|
|
207
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalai])).toString("utf8")),
|
|
249
208
|
],
|
|
250
|
-
|
|
251
|
-
() => void 0 !== output.headers[
|
|
252
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
209
|
+
[_s]: [
|
|
210
|
+
() => void 0 !== output.headers[_xals],
|
|
211
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")),
|
|
253
212
|
],
|
|
254
|
-
|
|
255
|
-
() => void 0 !== output.headers[
|
|
256
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
213
|
+
[_sA]: [
|
|
214
|
+
() => void 0 !== output.headers[_xalsa],
|
|
215
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")),
|
|
257
216
|
],
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
() => void 0 !== output.headers[
|
|
270
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
217
|
+
[_sR]: [, output.headers[_xals_]],
|
|
218
|
+
[_m]: [, output.headers[_xalm]],
|
|
219
|
+
[_eM]: [, output.headers[_xalem]],
|
|
220
|
+
[_mF]: [, output.headers[_xalmf]],
|
|
221
|
+
[_dS]: [, output.headers[_xalds]],
|
|
222
|
+
[_sTE]: [, output.headers[_xalste]],
|
|
223
|
+
[_iT]: [, output.headers[_xalit]],
|
|
224
|
+
[_eIT]: [, output.headers[_xaleit]],
|
|
225
|
+
[_bV]: [, output.headers[_xalbv]],
|
|
226
|
+
[_sI]: [, output.headers[_xalsi]],
|
|
227
|
+
[_aC]: [
|
|
228
|
+
() => void 0 !== output.headers[_xalac],
|
|
229
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")),
|
|
271
230
|
],
|
|
272
231
|
});
|
|
273
232
|
const data = output.body;
|
|
@@ -397,25 +356,25 @@ export const de_PutSessionCommand = async (output, context) => {
|
|
|
397
356
|
}
|
|
398
357
|
const contents = map({
|
|
399
358
|
$metadata: deserializeMetadata(output),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
() => void 0 !== output.headers[
|
|
404
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
359
|
+
[_cT]: [, output.headers[_ct]],
|
|
360
|
+
[_iN]: [, output.headers[_xalin]],
|
|
361
|
+
[_s]: [
|
|
362
|
+
() => void 0 !== output.headers[_xals],
|
|
363
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")),
|
|
405
364
|
],
|
|
406
|
-
|
|
407
|
-
() => void 0 !== output.headers[
|
|
408
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
365
|
+
[_sA]: [
|
|
366
|
+
() => void 0 !== output.headers[_xalsa],
|
|
367
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")),
|
|
409
368
|
],
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
() => void 0 !== output.headers[
|
|
418
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[
|
|
369
|
+
[_m]: [, output.headers[_xalm]],
|
|
370
|
+
[_eM]: [, output.headers[_xalem]],
|
|
371
|
+
[_mF]: [, output.headers[_xalmf]],
|
|
372
|
+
[_dS]: [, output.headers[_xalds]],
|
|
373
|
+
[_sTE]: [, output.headers[_xalste]],
|
|
374
|
+
[_sI]: [, output.headers[_xalsi]],
|
|
375
|
+
[_aC]: [
|
|
376
|
+
() => void 0 !== output.headers[_xalac],
|
|
377
|
+
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")),
|
|
419
378
|
],
|
|
420
379
|
});
|
|
421
380
|
const data = output.body;
|
|
@@ -531,7 +490,7 @@ const de_InternalFailureExceptionRes = async (parsedOutput, context) => {
|
|
|
531
490
|
};
|
|
532
491
|
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
533
492
|
const contents = map({
|
|
534
|
-
|
|
493
|
+
[_rAS]: [, parsedOutput.headers[_ra]],
|
|
535
494
|
});
|
|
536
495
|
const data = parsedOutput.body;
|
|
537
496
|
const doc = take(data, {
|
|
@@ -641,6 +600,46 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
|
641
600
|
value !== "" &&
|
|
642
601
|
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
643
602
|
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
603
|
+
const _a = "accept";
|
|
604
|
+
const _aC = "activeContexts";
|
|
605
|
+
const _aI = "alternativeIntents";
|
|
606
|
+
const _bV = "botVersion";
|
|
607
|
+
const _cLF = "checkpointLabelFilter";
|
|
608
|
+
const _cT = "contentType";
|
|
609
|
+
const _ct = "content-type";
|
|
610
|
+
const _dS = "dialogState";
|
|
611
|
+
const _eIT = "encodedInputTranscript";
|
|
612
|
+
const _eM = "encodedMessage";
|
|
613
|
+
const _iN = "intentName";
|
|
614
|
+
const _iT = "inputTranscript";
|
|
615
|
+
const _m = "message";
|
|
616
|
+
const _mF = "messageFormat";
|
|
617
|
+
const _nIC = "nluIntentConfidence";
|
|
618
|
+
const _rA = "requestAttributes";
|
|
619
|
+
const _rAS = "retryAfterSeconds";
|
|
620
|
+
const _ra = "retry-after";
|
|
621
|
+
const _s = "slots";
|
|
622
|
+
const _sA = "sessionAttributes";
|
|
623
|
+
const _sI = "sessionId";
|
|
624
|
+
const _sR = "sentimentResponse";
|
|
625
|
+
const _sTE = "slotToElicit";
|
|
626
|
+
const _xalac = "x-amz-lex-active-contexts";
|
|
627
|
+
const _xalai = "x-amz-lex-alternative-intents";
|
|
628
|
+
const _xalbv = "x-amz-lex-bot-version";
|
|
629
|
+
const _xalds = "x-amz-lex-dialog-state";
|
|
630
|
+
const _xaleit = "x-amz-lex-encoded-input-transcript";
|
|
631
|
+
const _xalem = "x-amz-lex-encoded-message";
|
|
632
|
+
const _xalin = "x-amz-lex-intent-name";
|
|
633
|
+
const _xalit = "x-amz-lex-input-transcript";
|
|
634
|
+
const _xalm = "x-amz-lex-message";
|
|
635
|
+
const _xalmf = "x-amz-lex-message-format";
|
|
636
|
+
const _xalnic = "x-amz-lex-nlu-intent-confidence";
|
|
637
|
+
const _xalra = "x-amz-lex-request-attributes";
|
|
638
|
+
const _xals = "x-amz-lex-slots";
|
|
639
|
+
const _xals_ = "x-amz-lex-sentiment";
|
|
640
|
+
const _xalsa = "x-amz-lex-session-attributes";
|
|
641
|
+
const _xalsi = "x-amz-lex-session-id";
|
|
642
|
+
const _xalste = "x-amz-lex-slot-to-elicit";
|
|
644
643
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
645
644
|
if (encoded.length) {
|
|
646
645
|
return JSON.parse(encoded);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-lex-runtime-service",
|
|
3
3
|
"description": "AWS SDK for JavaScript Lex Runtime Service Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.477.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
24
24
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
25
|
-
"@aws-sdk/client-sts": "3.
|
|
26
|
-
"@aws-sdk/core": "3.
|
|
27
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
25
|
+
"@aws-sdk/client-sts": "3.477.0",
|
|
26
|
+
"@aws-sdk/core": "3.477.0",
|
|
27
|
+
"@aws-sdk/credential-provider-node": "3.477.0",
|
|
28
28
|
"@aws-sdk/middleware-host-header": "3.468.0",
|
|
29
29
|
"@aws-sdk/middleware-logger": "3.468.0",
|
|
30
30
|
"@aws-sdk/middleware-recursion-detection": "3.468.0",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@aws-sdk/util-user-agent-browser": "3.468.0",
|
|
37
37
|
"@aws-sdk/util-user-agent-node": "3.470.0",
|
|
38
38
|
"@smithy/config-resolver": "^2.0.21",
|
|
39
|
+
"@smithy/core": "^1.2.0",
|
|
39
40
|
"@smithy/fetch-http-handler": "^2.3.1",
|
|
40
41
|
"@smithy/hash-node": "^2.0.17",
|
|
41
42
|
"@smithy/invalid-dependency": "^2.0.15",
|