@aws-sdk/client-lex-runtime-service
Advanced tools
Comparing version 3.476.0 to 3.477.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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; | ||
const protocol_http_1 = require("@smithy/protocol-http"); | ||
const core_1 = require("@smithy/core"); | ||
const smithy_client_1 = require("@smithy/smithy-client"); | ||
@@ -9,69 +9,51 @@ const LexRuntimeServiceServiceException_1 = require("../models/LexRuntimeServiceServiceException"); | ||
const se_DeleteSessionCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = (0, core_1.requestBuilder)(input, context); | ||
const headers = {}; | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/session"; | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
return new protocol_http_1.HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "DELETE", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("DELETE").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
exports.se_DeleteSessionCommand = se_DeleteSessionCommand; | ||
const se_GetSessionCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = (0, core_1.requestBuilder)(input, context); | ||
const headers = {}; | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/session"; | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
const query = (0, smithy_client_1.map)({ | ||
checkpointLabelFilter: [, input.checkpointLabelFilter], | ||
[_cLF]: [, input[_cLF]], | ||
}); | ||
let body; | ||
return new protocol_http_1.HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "GET", | ||
headers, | ||
path: resolvedPath, | ||
query, | ||
body, | ||
}); | ||
b.m("GET").h(headers).q(query).b(body); | ||
return b.build(); | ||
}; | ||
exports.se_GetSessionCommand = se_GetSessionCommand; | ||
const se_PostContentCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = (0, core_1.requestBuilder)(input, context); | ||
const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { | ||
"x-amz-content-sha256": "UNSIGNED-PAYLOAD", | ||
"content-type": input.contentType || "application/octet-stream", | ||
"x-amz-lex-session-attributes": [ | ||
() => isSerializableHeaderValue(input.sessionAttributes), | ||
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.sessionAttributes))), | ||
[_ct]: input[_cT] || "application/octet-stream", | ||
[_xalsa]: [ | ||
() => isSerializableHeaderValue(input[_sA]), | ||
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input[_sA]))), | ||
], | ||
"x-amz-lex-request-attributes": [ | ||
() => isSerializableHeaderValue(input.requestAttributes), | ||
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.requestAttributes))), | ||
[_xalra]: [ | ||
() => isSerializableHeaderValue(input[_rA]), | ||
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input[_rA]))), | ||
], | ||
accept: input.accept, | ||
"x-amz-lex-active-contexts": [ | ||
() => isSerializableHeaderValue(input.activeContexts), | ||
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.activeContexts))), | ||
[_a]: input[_a], | ||
[_xalac]: [ | ||
() => isSerializableHeaderValue(input[_aC]), | ||
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input[_aC]))), | ||
], | ||
}); | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/content"; | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/content"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
@@ -81,23 +63,15 @@ if (input.inputStream !== undefined) { | ||
} | ||
return new protocol_http_1.HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "POST", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("POST").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
exports.se_PostContentCommand = se_PostContentCommand; | ||
const se_PostTextCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = (0, core_1.requestBuilder)(input, context); | ||
const headers = { | ||
"content-type": "application/json", | ||
}; | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/text"; | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/text"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
@@ -110,24 +84,16 @@ body = JSON.stringify((0, smithy_client_1.take)(input, { | ||
})); | ||
return new protocol_http_1.HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "POST", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("POST").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
exports.se_PostTextCommand = se_PostTextCommand; | ||
const se_PutSessionCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = (0, core_1.requestBuilder)(input, context); | ||
const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { | ||
"content-type": "application/json", | ||
accept: input.accept, | ||
[_a]: input[_a], | ||
}); | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/session"; | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
@@ -140,11 +106,4 @@ body = JSON.stringify((0, smithy_client_1.take)(input, { | ||
})); | ||
return new protocol_http_1.HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "POST", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("POST").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
@@ -254,33 +213,33 @@ exports.se_PutSessionCommand = se_PutSessionCommand; | ||
$metadata: deserializeMetadata(output), | ||
contentType: [, output.headers["content-type"]], | ||
intentName: [, output.headers["x-amz-lex-intent-name"]], | ||
nluIntentConfidence: [ | ||
() => void 0 !== output.headers["x-amz-lex-nlu-intent-confidence"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8")), | ||
[_cT]: [, output.headers[_ct]], | ||
[_iN]: [, output.headers[_xalin]], | ||
[_nIC]: [ | ||
() => void 0 !== output.headers[_xalnic], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalnic])).toString("utf8")), | ||
], | ||
alternativeIntents: [ | ||
() => void 0 !== output.headers["x-amz-lex-alternative-intents"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8")), | ||
[_aI]: [ | ||
() => void 0 !== output.headers[_xalai], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalai])).toString("utf8")), | ||
], | ||
slots: [ | ||
() => void 0 !== output.headers["x-amz-lex-slots"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")), | ||
[_s]: [ | ||
() => void 0 !== output.headers[_xals], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")), | ||
], | ||
sessionAttributes: [ | ||
() => void 0 !== output.headers["x-amz-lex-session-attributes"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")), | ||
[_sA]: [ | ||
() => void 0 !== output.headers[_xalsa], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")), | ||
], | ||
sentimentResponse: [, output.headers["x-amz-lex-sentiment"]], | ||
message: [, output.headers["x-amz-lex-message"]], | ||
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]], | ||
messageFormat: [, output.headers["x-amz-lex-message-format"]], | ||
dialogState: [, output.headers["x-amz-lex-dialog-state"]], | ||
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]], | ||
inputTranscript: [, output.headers["x-amz-lex-input-transcript"]], | ||
encodedInputTranscript: [, output.headers["x-amz-lex-encoded-input-transcript"]], | ||
botVersion: [, output.headers["x-amz-lex-bot-version"]], | ||
sessionId: [, output.headers["x-amz-lex-session-id"]], | ||
activeContexts: [ | ||
() => void 0 !== output.headers["x-amz-lex-active-contexts"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")), | ||
[_sR]: [, output.headers[_xals_]], | ||
[_m]: [, output.headers[_xalm]], | ||
[_eM]: [, output.headers[_xalem]], | ||
[_mF]: [, output.headers[_xalmf]], | ||
[_dS]: [, output.headers[_xalds]], | ||
[_sTE]: [, output.headers[_xalste]], | ||
[_iT]: [, output.headers[_xalit]], | ||
[_eIT]: [, output.headers[_xaleit]], | ||
[_bV]: [, output.headers[_xalbv]], | ||
[_sI]: [, output.headers[_xalsi]], | ||
[_aC]: [ | ||
() => void 0 !== output.headers[_xalac], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")), | ||
], | ||
@@ -417,21 +376,21 @@ }); | ||
$metadata: deserializeMetadata(output), | ||
contentType: [, output.headers["content-type"]], | ||
intentName: [, output.headers["x-amz-lex-intent-name"]], | ||
slots: [ | ||
() => void 0 !== output.headers["x-amz-lex-slots"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")), | ||
[_cT]: [, output.headers[_ct]], | ||
[_iN]: [, output.headers[_xalin]], | ||
[_s]: [ | ||
() => void 0 !== output.headers[_xals], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")), | ||
], | ||
sessionAttributes: [ | ||
() => void 0 !== output.headers["x-amz-lex-session-attributes"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")), | ||
[_sA]: [ | ||
() => void 0 !== output.headers[_xalsa], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")), | ||
], | ||
message: [, output.headers["x-amz-lex-message"]], | ||
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]], | ||
messageFormat: [, output.headers["x-amz-lex-message-format"]], | ||
dialogState: [, output.headers["x-amz-lex-dialog-state"]], | ||
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]], | ||
sessionId: [, output.headers["x-amz-lex-session-id"]], | ||
activeContexts: [ | ||
() => void 0 !== output.headers["x-amz-lex-active-contexts"], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")), | ||
[_m]: [, output.headers[_xalm]], | ||
[_eM]: [, output.headers[_xalem]], | ||
[_mF]: [, output.headers[_xalmf]], | ||
[_dS]: [, output.headers[_xalds]], | ||
[_sTE]: [, output.headers[_xalste]], | ||
[_sI]: [, output.headers[_xalsi]], | ||
[_aC]: [ | ||
() => void 0 !== output.headers[_xalac], | ||
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")), | ||
], | ||
@@ -553,3 +512,3 @@ }); | ||
const contents = (0, smithy_client_1.map)({ | ||
retryAfterSeconds: [, parsedOutput.headers["retry-after"]], | ||
[_rAS]: [, parsedOutput.headers[_ra]], | ||
}); | ||
@@ -664,2 +623,42 @@ const data = parsedOutput.body; | ||
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); | ||
const _a = "accept"; | ||
const _aC = "activeContexts"; | ||
const _aI = "alternativeIntents"; | ||
const _bV = "botVersion"; | ||
const _cLF = "checkpointLabelFilter"; | ||
const _cT = "contentType"; | ||
const _ct = "content-type"; | ||
const _dS = "dialogState"; | ||
const _eIT = "encodedInputTranscript"; | ||
const _eM = "encodedMessage"; | ||
const _iN = "intentName"; | ||
const _iT = "inputTranscript"; | ||
const _m = "message"; | ||
const _mF = "messageFormat"; | ||
const _nIC = "nluIntentConfidence"; | ||
const _rA = "requestAttributes"; | ||
const _rAS = "retryAfterSeconds"; | ||
const _ra = "retry-after"; | ||
const _s = "slots"; | ||
const _sA = "sessionAttributes"; | ||
const _sI = "sessionId"; | ||
const _sR = "sentimentResponse"; | ||
const _sTE = "slotToElicit"; | ||
const _xalac = "x-amz-lex-active-contexts"; | ||
const _xalai = "x-amz-lex-alternative-intents"; | ||
const _xalbv = "x-amz-lex-bot-version"; | ||
const _xalds = "x-amz-lex-dialog-state"; | ||
const _xaleit = "x-amz-lex-encoded-input-transcript"; | ||
const _xalem = "x-amz-lex-encoded-message"; | ||
const _xalin = "x-amz-lex-intent-name"; | ||
const _xalit = "x-amz-lex-input-transcript"; | ||
const _xalm = "x-amz-lex-message"; | ||
const _xalmf = "x-amz-lex-message-format"; | ||
const _xalnic = "x-amz-lex-nlu-intent-confidence"; | ||
const _xalra = "x-amz-lex-request-attributes"; | ||
const _xals = "x-amz-lex-slots"; | ||
const _xals_ = "x-amz-lex-sentiment"; | ||
const _xalsa = "x-amz-lex-session-attributes"; | ||
const _xalsi = "x-amz-lex-session-id"; | ||
const _xalste = "x-amz-lex-slot-to-elicit"; | ||
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { | ||
@@ -666,0 +665,0 @@ if (encoded.length) { |
@@ -1,71 +0,53 @@ | ||
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http"; | ||
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client"; | ||
import { requestBuilder as rb } from "@smithy/core"; | ||
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"; | ||
import { LexRuntimeServiceServiceException as __BaseException } from "../models/LexRuntimeServiceServiceException"; | ||
import { BadGatewayException, BadRequestException, ConflictException, DependencyFailedException, InternalFailureException, LimitExceededException, LoopDetectedException, NotAcceptableException, NotFoundException, RequestTimeoutException, UnsupportedMediaTypeException, } from "../models/models_0"; | ||
export const se_DeleteSessionCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = rb(input, context); | ||
const headers = {}; | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/session"; | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
return new __HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "DELETE", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("DELETE").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
export const se_GetSessionCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = rb(input, context); | ||
const headers = {}; | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/session"; | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
const query = map({ | ||
checkpointLabelFilter: [, input.checkpointLabelFilter], | ||
[_cLF]: [, input[_cLF]], | ||
}); | ||
let body; | ||
return new __HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "GET", | ||
headers, | ||
path: resolvedPath, | ||
query, | ||
body, | ||
}); | ||
b.m("GET").h(headers).q(query).b(body); | ||
return b.build(); | ||
}; | ||
export const se_PostContentCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = rb(input, context); | ||
const headers = map({}, isSerializableHeaderValue, { | ||
"x-amz-content-sha256": "UNSIGNED-PAYLOAD", | ||
"content-type": input.contentType || "application/octet-stream", | ||
"x-amz-lex-session-attributes": [ | ||
() => isSerializableHeaderValue(input.sessionAttributes), | ||
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes))), | ||
[_ct]: input[_cT] || "application/octet-stream", | ||
[_xalsa]: [ | ||
() => isSerializableHeaderValue(input[_sA]), | ||
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_sA]))), | ||
], | ||
"x-amz-lex-request-attributes": [ | ||
() => isSerializableHeaderValue(input.requestAttributes), | ||
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.requestAttributes))), | ||
[_xalra]: [ | ||
() => isSerializableHeaderValue(input[_rA]), | ||
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_rA]))), | ||
], | ||
accept: input.accept, | ||
"x-amz-lex-active-contexts": [ | ||
() => isSerializableHeaderValue(input.activeContexts), | ||
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.activeContexts))), | ||
[_a]: input[_a], | ||
[_xalac]: [ | ||
() => isSerializableHeaderValue(input[_aC]), | ||
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_aC]))), | ||
], | ||
}); | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/content"; | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/content"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
@@ -75,22 +57,14 @@ if (input.inputStream !== undefined) { | ||
} | ||
return new __HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "POST", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("POST").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
export const se_PostTextCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = rb(input, context); | ||
const headers = { | ||
"content-type": "application/json", | ||
}; | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/text"; | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/text"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
@@ -103,23 +77,15 @@ body = JSON.stringify(take(input, { | ||
})); | ||
return new __HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "POST", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("POST").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
export const se_PutSessionCommand = async (input, context) => { | ||
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); | ||
const b = rb(input, context); | ||
const headers = map({}, isSerializableHeaderValue, { | ||
"content-type": "application/json", | ||
accept: input.accept, | ||
[_a]: input[_a], | ||
}); | ||
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + | ||
"/bot/{botName}/alias/{botAlias}/user/{userId}/session"; | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botName", () => input.botName, "{botName}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false); | ||
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId, "{userId}", false); | ||
b.bp("/bot/{botName}/alias/{botAlias}/user/{userId}/session"); | ||
b.p("botName", () => input.botName, "{botName}", false); | ||
b.p("botAlias", () => input.botAlias, "{botAlias}", false); | ||
b.p("userId", () => input.userId, "{userId}", false); | ||
let body; | ||
@@ -132,11 +98,4 @@ body = JSON.stringify(take(input, { | ||
})); | ||
return new __HttpRequest({ | ||
protocol, | ||
hostname, | ||
port, | ||
method: "POST", | ||
headers, | ||
path: resolvedPath, | ||
body, | ||
}); | ||
b.m("POST").h(headers).b(body); | ||
return b.build(); | ||
}; | ||
@@ -243,33 +202,33 @@ export const de_DeleteSessionCommand = async (output, context) => { | ||
$metadata: deserializeMetadata(output), | ||
contentType: [, output.headers["content-type"]], | ||
intentName: [, output.headers["x-amz-lex-intent-name"]], | ||
nluIntentConfidence: [ | ||
() => void 0 !== output.headers["x-amz-lex-nlu-intent-confidence"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8")), | ||
[_cT]: [, output.headers[_ct]], | ||
[_iN]: [, output.headers[_xalin]], | ||
[_nIC]: [ | ||
() => void 0 !== output.headers[_xalnic], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalnic])).toString("utf8")), | ||
], | ||
alternativeIntents: [ | ||
() => void 0 !== output.headers["x-amz-lex-alternative-intents"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8")), | ||
[_aI]: [ | ||
() => void 0 !== output.headers[_xalai], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalai])).toString("utf8")), | ||
], | ||
slots: [ | ||
() => void 0 !== output.headers["x-amz-lex-slots"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")), | ||
[_s]: [ | ||
() => void 0 !== output.headers[_xals], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")), | ||
], | ||
sessionAttributes: [ | ||
() => void 0 !== output.headers["x-amz-lex-session-attributes"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")), | ||
[_sA]: [ | ||
() => void 0 !== output.headers[_xalsa], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")), | ||
], | ||
sentimentResponse: [, output.headers["x-amz-lex-sentiment"]], | ||
message: [, output.headers["x-amz-lex-message"]], | ||
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]], | ||
messageFormat: [, output.headers["x-amz-lex-message-format"]], | ||
dialogState: [, output.headers["x-amz-lex-dialog-state"]], | ||
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]], | ||
inputTranscript: [, output.headers["x-amz-lex-input-transcript"]], | ||
encodedInputTranscript: [, output.headers["x-amz-lex-encoded-input-transcript"]], | ||
botVersion: [, output.headers["x-amz-lex-bot-version"]], | ||
sessionId: [, output.headers["x-amz-lex-session-id"]], | ||
activeContexts: [ | ||
() => void 0 !== output.headers["x-amz-lex-active-contexts"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")), | ||
[_sR]: [, output.headers[_xals_]], | ||
[_m]: [, output.headers[_xalm]], | ||
[_eM]: [, output.headers[_xalem]], | ||
[_mF]: [, output.headers[_xalmf]], | ||
[_dS]: [, output.headers[_xalds]], | ||
[_sTE]: [, output.headers[_xalste]], | ||
[_iT]: [, output.headers[_xalit]], | ||
[_eIT]: [, output.headers[_xaleit]], | ||
[_bV]: [, output.headers[_xalbv]], | ||
[_sI]: [, output.headers[_xalsi]], | ||
[_aC]: [ | ||
() => void 0 !== output.headers[_xalac], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")), | ||
], | ||
@@ -404,21 +363,21 @@ }); | ||
$metadata: deserializeMetadata(output), | ||
contentType: [, output.headers["content-type"]], | ||
intentName: [, output.headers["x-amz-lex-intent-name"]], | ||
slots: [ | ||
() => void 0 !== output.headers["x-amz-lex-slots"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")), | ||
[_cT]: [, output.headers[_ct]], | ||
[_iN]: [, output.headers[_xalin]], | ||
[_s]: [ | ||
() => void 0 !== output.headers[_xals], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xals])).toString("utf8")), | ||
], | ||
sessionAttributes: [ | ||
() => void 0 !== output.headers["x-amz-lex-session-attributes"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")), | ||
[_sA]: [ | ||
() => void 0 !== output.headers[_xalsa], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalsa])).toString("utf8")), | ||
], | ||
message: [, output.headers["x-amz-lex-message"]], | ||
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]], | ||
messageFormat: [, output.headers["x-amz-lex-message-format"]], | ||
dialogState: [, output.headers["x-amz-lex-dialog-state"]], | ||
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]], | ||
sessionId: [, output.headers["x-amz-lex-session-id"]], | ||
activeContexts: [ | ||
() => void 0 !== output.headers["x-amz-lex-active-contexts"], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")), | ||
[_m]: [, output.headers[_xalm]], | ||
[_eM]: [, output.headers[_xalem]], | ||
[_mF]: [, output.headers[_xalmf]], | ||
[_dS]: [, output.headers[_xalds]], | ||
[_sTE]: [, output.headers[_xalste]], | ||
[_sI]: [, output.headers[_xalsi]], | ||
[_aC]: [ | ||
() => void 0 !== output.headers[_xalac], | ||
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers[_xalac])).toString("utf8")), | ||
], | ||
@@ -539,3 +498,3 @@ }); | ||
const contents = map({ | ||
retryAfterSeconds: [, parsedOutput.headers["retry-after"]], | ||
[_rAS]: [, parsedOutput.headers[_ra]], | ||
}); | ||
@@ -650,2 +609,42 @@ const data = parsedOutput.body; | ||
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); | ||
const _a = "accept"; | ||
const _aC = "activeContexts"; | ||
const _aI = "alternativeIntents"; | ||
const _bV = "botVersion"; | ||
const _cLF = "checkpointLabelFilter"; | ||
const _cT = "contentType"; | ||
const _ct = "content-type"; | ||
const _dS = "dialogState"; | ||
const _eIT = "encodedInputTranscript"; | ||
const _eM = "encodedMessage"; | ||
const _iN = "intentName"; | ||
const _iT = "inputTranscript"; | ||
const _m = "message"; | ||
const _mF = "messageFormat"; | ||
const _nIC = "nluIntentConfidence"; | ||
const _rA = "requestAttributes"; | ||
const _rAS = "retryAfterSeconds"; | ||
const _ra = "retry-after"; | ||
const _s = "slots"; | ||
const _sA = "sessionAttributes"; | ||
const _sI = "sessionId"; | ||
const _sR = "sentimentResponse"; | ||
const _sTE = "slotToElicit"; | ||
const _xalac = "x-amz-lex-active-contexts"; | ||
const _xalai = "x-amz-lex-alternative-intents"; | ||
const _xalbv = "x-amz-lex-bot-version"; | ||
const _xalds = "x-amz-lex-dialog-state"; | ||
const _xaleit = "x-amz-lex-encoded-input-transcript"; | ||
const _xalem = "x-amz-lex-encoded-message"; | ||
const _xalin = "x-amz-lex-intent-name"; | ||
const _xalit = "x-amz-lex-input-transcript"; | ||
const _xalm = "x-amz-lex-message"; | ||
const _xalmf = "x-amz-lex-message-format"; | ||
const _xalnic = "x-amz-lex-nlu-intent-confidence"; | ||
const _xalra = "x-amz-lex-request-attributes"; | ||
const _xals = "x-amz-lex-slots"; | ||
const _xals_ = "x-amz-lex-sentiment"; | ||
const _xalsa = "x-amz-lex-session-attributes"; | ||
const _xalsi = "x-amz-lex-session-id"; | ||
const _xalste = "x-amz-lex-slot-to-elicit"; | ||
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { | ||
@@ -652,0 +651,0 @@ if (encoded.length) { |
{ | ||
"name": "@aws-sdk/client-lex-runtime-service", | ||
"description": "AWS SDK for JavaScript Lex Runtime Service Client for Node.js, Browser and React Native", | ||
"version": "3.476.0", | ||
"version": "3.477.0", | ||
"scripts": { | ||
@@ -25,5 +25,5 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"@aws-crypto/sha256-js": "3.0.0", | ||
"@aws-sdk/client-sts": "3.476.0", | ||
"@aws-sdk/core": "3.476.0", | ||
"@aws-sdk/credential-provider-node": "3.476.0", | ||
"@aws-sdk/client-sts": "3.477.0", | ||
"@aws-sdk/core": "3.477.0", | ||
"@aws-sdk/credential-provider-node": "3.477.0", | ||
"@aws-sdk/middleware-host-header": "3.468.0", | ||
@@ -40,2 +40,3 @@ "@aws-sdk/middleware-logger": "3.468.0", | ||
"@smithy/config-resolver": "^2.0.21", | ||
"@smithy/core": "^1.2.0", | ||
"@smithy/fetch-http-handler": "^2.3.1", | ||
@@ -42,0 +43,0 @@ "@smithy/hash-node": "^2.0.17", |
344962
41
7433
+ Added@smithy/core@^1.2.0
+ Added@aws-sdk/client-sso@3.477.0(transitive)
+ Added@aws-sdk/client-sts@3.477.0(transitive)
+ Added@aws-sdk/core@3.477.0(transitive)
+ Added@aws-sdk/credential-provider-ini@3.477.0(transitive)
+ Added@aws-sdk/credential-provider-node@3.477.0(transitive)
+ Added@aws-sdk/credential-provider-sso@3.477.0(transitive)
- Removed@aws-sdk/client-sso@3.476.0(transitive)
- Removed@aws-sdk/client-sts@3.476.0(transitive)
- Removed@aws-sdk/core@3.476.0(transitive)
- Removed@aws-sdk/credential-provider-ini@3.476.0(transitive)
- Removed@aws-sdk/credential-provider-node@3.476.0(transitive)
- Removed@aws-sdk/credential-provider-sso@3.476.0(transitive)
Updated@aws-sdk/client-sts@3.477.0
Updated@aws-sdk/core@3.477.0