From c72e8d09634d985e5cd84ed1725b00a97536f4e3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 3 Nov 2026 03:49:35 +0000 Subject: [PATCH] chore: Update dist --- THIRD-PARTY | 4 +- dist/index.js | 488 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 315 insertions(+), 177 deletions(-) diff --git a/THIRD-PARTY b/THIRD-PARTY index 7850c3a0..8f5bb9f1 100644 --- a/THIRD-PARTY +++ b/THIRD-PARTY @@ -433,7 +433,7 @@ Apache License The following npm packages may be included in this product: - @aws-sdk/signature-v4-multi-region@3.996.49 - - @smithy/core@3.36.2 + - @smithy/core@3.38.1 - @smithy/types@4.19.0 These packages each contain the following license: @@ -1050,7 +1050,7 @@ The following npm packages may be included in this product: - @aws-sdk/xml-builder@3.972.41 - @smithy/credential-provider-imds@4.5.2 - @smithy/fetch-http-handler@5.8.0 - - @smithy/node-http-handler@4.12.1 + - @smithy/node-http-handler@4.14.1 - @smithy/signature-v4@5.7.4 These packages each contain the following license: diff --git a/dist/index.js b/dist/index.js index eced07e3..817db041 100644 --- a/dist/index.js +++ b/dist/index.js @@ -19379,8 +19379,9 @@ var init_MiddlewareStack = __esm({ const aliases = getAllAliases(name, _aliases); if (aliases.length > 0) { if (aliases.some((alias) => entriesNameSet.has(alias))) { - if (!override) + if (!override) { throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + } for (const alias of aliases) { const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a5) => a5 === alias)); if (toOverrideIndex === -1) { @@ -19408,8 +19409,9 @@ var init_MiddlewareStack = __esm({ const aliases = getAllAliases(name, _aliases); if (aliases.length > 0) { if (aliases.some((alias) => entriesNameSet.has(alias))) { - if (!override) + if (!override) { throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + } for (const alias of aliases) { const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a5) => a5 === alias)); if (toOverrideIndex === -1) { @@ -19433,10 +19435,11 @@ var init_MiddlewareStack = __esm({ plugin.applyToStack(stack); }, remove: (toRemove) => { - if (typeof toRemove === "string") + if (typeof toRemove === "string") { return removeByName(toRemove); - else + } else { return removeByReference(toRemove); + } }, removeByTag: (toRemove) => { let isRemoved = false; @@ -19470,8 +19473,9 @@ var init_MiddlewareStack = __esm({ }); }, identifyOnResolve(toggle) { - if (typeof toggle === "boolean") + if (typeof toggle === "boolean") { identifyOnResolve = toggle; + } return identifyOnResolve; }, resolve: (handler, context) => { @@ -19690,8 +19694,9 @@ var init_httpResponse = __esm({ this.body = options.body; } static isInstance(response) { - if (!response) + if (!response) { return false; + } const resp = response; return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } @@ -19734,8 +19739,9 @@ var normalizeProvider; var init_normalizeProvider = __esm({ "node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js"() { normalizeProvider = (input) => { - if (typeof input === "function") + if (typeof input === "function") { return input; + } const promisified = Promise.resolve(input); return () => promisified; }; @@ -19807,8 +19813,9 @@ var init_toEndpointV1 = __esm({ if (endpoint.headers) { v1Endpoint.headers = {}; for (const name in endpoint.headers) { - if (!hasOwn(endpoint.headers, name)) + if (!hasOwn(endpoint.headers, name)) { continue; + } v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", "); } } @@ -20967,15 +20974,21 @@ function schemaLogFilter(schema, data2) { return SENSITIVE_STRING; } if (ns.isListSchema()) { - const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive; - if (isSensitive) { + const valueSchema = ns.getValueSchema(); + if (valueSchema.getMergedTraits().sensitive) { return SENSITIVE_STRING; } + if (Array.isArray(data2)) { + return data2.map((value) => schemaLogFilter(valueSchema, value)); + } } else if (ns.isMapSchema()) { - const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive; - if (isSensitive) { + const valueSchema = ns.getValueSchema(); + if (ns.getKeySchema().getMergedTraits().sensitive || valueSchema.getMergedTraits().sensitive) { return SENSITIVE_STRING; } + if (typeof data2 === "object") { + return Object.fromEntries(Object.entries(data2).map(([key, value]) => [key, schemaLogFilter(valueSchema, value)])); + } } else if (ns.isStructSchema() && typeof data2 === "object") { const object = data2; const newObject = {}; @@ -21174,8 +21187,9 @@ var init_create_aggregated_client = __esm({ if (typeof optionsOrCb === "function") { this.send(command6, optionsOrCb); } else if (typeof cb === "function") { - if (typeof optionsOrCb !== "object") + if (typeof optionsOrCb !== "object") { throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + } this.send(command6, optionsOrCb || {}, cb); } else { return this.send(command6, optionsOrCb); @@ -21233,14 +21247,16 @@ var init_exceptions = __esm({ this.$metadata = options.$metadata; } static isInstance(value) { - if (!value) + if (!value) { return false; + } const candidate = value; return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"); } static [Symbol.hasInstance](instance) { - if (!instance) + if (!instance) { return false; + } const candidate = instance; if (this === _ServiceException) { return _ServiceException.isInstance(instance); @@ -21385,8 +21401,9 @@ var init_checksum = __esm({ getChecksumConfiguration = (runtimeConfig) => { const checksumAlgorithms = []; for (const id in import_types3.AlgorithmId) { - if (!hasOwn(import_types3.AlgorithmId, id)) + if (!hasOwn(import_types3.AlgorithmId, id)) { continue; + } const algorithmId = import_types3.AlgorithmId[id]; if (runtimeConfig[algorithmId] === void 0) { continue; @@ -21486,8 +21503,9 @@ var init_get_value_from_text_node = __esm({ getValueFromTextNode = (obj) => { const textNodeName = "#text"; for (const key in obj) { - if (!hasOwn(obj, key)) + if (!hasOwn(obj, key)) { continue; + } if (obj[key][textNodeName] !== void 0) { obj[key] = obj[key][textNodeName]; } else if (typeof obj[key] === "object" && obj[key] !== null) { @@ -21547,8 +21565,9 @@ function map2(arg0, arg1, arg2) { } } for (const key in instructions) { - if (!hasOwn(instructions, key)) + if (!hasOwn(instructions, key)) { continue; + } if (!Array.isArray(instructions[key])) { target[key] = instructions[key]; continue; @@ -21571,8 +21590,9 @@ var init_object_mapping = __esm({ take = (source, instructions) => { const out = {}; for (const key in instructions) { - if (!hasOwn(instructions, key)) + if (!hasOwn(instructions, key)) { continue; + } applyInstruction(out, source, instructions, key); } return out; @@ -21662,8 +21682,9 @@ var init_serde_json = __esm({ if (typeof obj === "object") { const target = {}; for (const key in obj) { - if (!hasOwn(obj, key)) + if (!hasOwn(obj, key)) { continue; + } if (obj[key] == null) { continue; } @@ -22066,8 +22087,9 @@ var init_parse_utils = __esm({ const asObject = expectObject(value); const setKeys = []; for (const k5 in asObject) { - if (!hasOwn(asObject, k5)) + if (!hasOwn(asObject, k5)) { continue; + } if (asObject[k5] != null) { setKeys.push(k5); } @@ -22927,12 +22949,15 @@ var booleanSelector; var init_booleanSelector = __esm({ "node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js"() { booleanSelector = (obj, key, type) => { - if (!(key in obj)) + if (!(key in obj)) { return void 0; - if (obj[key] === "true") + } + if (obj[key] === "true") { return true; - if (obj[key] === "false") + } + if (obj[key] === "false") { return false; + } throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); }; } @@ -22943,8 +22968,9 @@ var numberSelector; var init_numberSelector = __esm({ "node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js"() { numberSelector = (obj, key, type) => { - if (!(key in obj)) + if (!(key in obj)) { return void 0; + } const numberValue = parseInt(obj[key], 10); if (Number.isNaN(numberValue)) { throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); @@ -22980,15 +23006,19 @@ var init_getHomeDir = __esm({ }; getHomeDir = () => { const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${import_node_path.sep}` } = process.env; - if (HOME) + if (HOME) { return HOME; - if (USERPROFILE) + } + if (USERPROFILE) { return USERPROFILE; - if (HOMEPATH) + } + if (HOMEPATH) { return `${HOMEDRIVE}${HOMEPATH}`; + } const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) + if (!homeDirCache[homeDirCacheKey]) { homeDirCache[homeDirCacheKey] = (0, import_node_os.homedir)(); + } return homeDirCache[homeDirCacheKey]; }; } @@ -23921,11 +23951,13 @@ var init_getEndpointUrlConfig = __esm({ environmentVariableSelector: (env2) => { const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); const serviceEndpointUrl = env2[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; - if (serviceEndpointUrl) + if (serviceEndpointUrl) { return serviceEndpointUrl; + } const endpointUrl = env2[ENV_ENDPOINT_URL]; - if (endpointUrl) + if (endpointUrl) { return endpointUrl; + } return void 0; }, configFileSelector: (profile, config) => { @@ -23937,12 +23969,14 @@ var init_getEndpointUrlConfig = __esm({ const servicesSection = config[servicesSectionKey]; const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl2) + if (endpointUrl2) { return endpointUrl2; + } } const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) + if (endpointUrl) { return endpointUrl; + } return void 0; }, default: void 0 @@ -25076,8 +25110,9 @@ var init_resolveEndpoint = __esm({ const { parameters, rules } = ruleSetObject; options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); for (const paramKey in parameters) { - if (!hasOwn(parameters, paramKey)) + if (!hasOwn(parameters, paramKey)) { continue; + } const parameter = parameters[paramKey]; const endpointParam = endpointParams[paramKey]; if (endpointParam == null && parameter.default != null) { @@ -26092,6 +26127,15 @@ var init_splitStream = __esm({ } }); +// node_modules/@smithy/core/dist-es/submodules/serde/writeKey.js +function writeKey(obj) { + Object.defineProperty(obj, "__proto__", { value: void 0, writable: true, enumerable: true, configurable: true }); +} +var init_writeKey = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/writeKey.js"() { + } +}); + // node_modules/@smithy/core/dist-es/submodules/serde/index.js var serde_exports = {}; __export(serde_exports, { @@ -26167,7 +26211,8 @@ __export(serde_exports, { toHex: () => toHex, toUint8Array: () => toUint8Array, toUtf8: () => toUtf8, - v4: () => v4 + v4: () => v4, + writeKey: () => writeKey }); var import_node_crypto3, Uint8ArrayBlobAdapter, _getRandomValues, v4, generateIdempotencyToken; var init_serde = __esm({ @@ -26208,6 +26253,7 @@ var init_serde = __esm({ init_stream_type_check(); init_stream_collector(); init_transport(); + init_writeKey(); Uint8ArrayBlobAdapter = class extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) { }; _getRandomValues = import_node_crypto3.getRandomValues; @@ -26987,8 +27033,9 @@ function negate(bytes) { } for (let i5 = 7; i5 > -1; i5--) { bytes[i5]++; - if (bytes[i5] !== 0) + if (bytes[i5] !== 0) { break; + } } } var Int64; @@ -27048,8 +27095,9 @@ var init_HeaderMarshaller = __esm({ format(headers) { const chunks = []; for (const headerName in headers) { - if (!hasOwn(headers, headerName)) + if (!hasOwn(headers, headerName)) { continue; + } const bytes = this.fromUtf8(headerName); if (bytes.byteLength > 255) { throw new Error(`@smithy/core/event-streams - header name exceeds 255 bytes: ${bytes.byteLength}`); @@ -27408,8 +27456,9 @@ var init_SmithyMessageDecoderStream = __esm({ async *asyncIterator() { for await (const message of this.options.messageStream) { const deserialized = await this.options.deserializer(message); - if (deserialized === void 0) + if (deserialized === void 0) { continue; + } yield deserialized; } } @@ -27517,8 +27566,9 @@ function getUnmarshalledStream(source, options) { for await (const chunk of source) { const message = options.eventStreamCodec.decode(chunk); const type = await messageUnmarshaller(message); - if (type === void 0) + if (type === void 0) { continue; + } yield type; } } @@ -27546,8 +27596,9 @@ function getMessageUnmarshaller(deserializer, toUtf83) { [message.headers[":event-type"].value]: message }; const deserialized = await deserializer(event); - if (deserialized.$unknown) + if (deserialized.$unknown) { return; + } return deserialized; } else { throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`); @@ -27658,8 +27709,9 @@ var init_utils2 = __esm({ try { while (true) { const { done, value } = await reader.read(); - if (done) + if (done) { return; + } yield value; } } finally { @@ -27751,8 +27803,9 @@ var init_EventStreamSerde = __esm({ } let unionMember = ""; for (const key in event) { - if (!hasOwn(event, key)) + if (!hasOwn(event, key)) { continue; + } if (key !== "__type") { unionMember = key; break; @@ -27780,8 +27833,9 @@ var init_EventStreamSerde = __esm({ const asyncIterable = marshaller.deserialize(response.body, async (event) => { let unionMember = ""; for (const key in event) { - if (!hasOwn(event, key)) + if (!hasOwn(event, key)) { continue; + } if (key !== "__type") { unionMember = key; break; @@ -27849,8 +27903,9 @@ var init_EventStreamSerde = __esm({ throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given."); } for (const key in firstEvent.value) { - if (!hasOwn(firstEvent.value, key)) + if (!hasOwn(firstEvent.value, key)) { continue; + } initialResponseContainer[key] = firstEvent.value[key]; } } @@ -28059,8 +28114,9 @@ var init_HttpProtocol = __esm({ } if (endpoint.headers) { for (const name in endpoint.headers) { - if (!hasOwn(endpoint.headers, name)) + if (!hasOwn(endpoint.headers, name)) { continue; + } request.headers[name] = endpoint.headers[name].join(", "); } } @@ -28075,8 +28131,9 @@ var init_HttpProtocol = __esm({ }; if (endpoint.headers) { for (const name in endpoint.headers) { - if (!hasOwn(endpoint.headers, name)) + if (!hasOwn(endpoint.headers, name)) { continue; + } request.headers[name] = endpoint.headers[name]; } } @@ -28305,8 +28362,9 @@ var init_HttpBindingProtocol = __esm({ headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); } else if (typeof memberTraits.httpPrefixHeaders === "string") { for (const key in inputMemberValue) { - if (!hasOwn(inputMemberValue, key)) + if (!hasOwn(inputMemberValue, key)) { continue; + } const val = inputMemberValue[key]; const amalgam = memberTraits.httpPrefixHeaders + key; serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); @@ -28350,8 +28408,9 @@ var init_HttpBindingProtocol = __esm({ const traits = ns.getMergedTraits(); if (traits.httpQueryParams) { for (const key in data2) { - if (!hasOwn(data2, key)) + if (!hasOwn(data2, key)) { continue; + } if (!(key in query)) { const val = data2[key]; const valueSchema = ns.getValueSchema(); @@ -28394,8 +28453,9 @@ var init_HttpBindingProtocol = __esm({ throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); } for (const header in response.headers) { - if (!hasOwn(response.headers, header)) + if (!hasOwn(response.headers, header)) { continue; + } const value = response.headers[header]; delete response.headers[header]; response.headers[header.toLowerCase()] = value; @@ -28474,8 +28534,9 @@ var init_HttpBindingProtocol = __esm({ } else if (memberTraits.httpPrefixHeaders !== void 0) { dataObject[memberName] = {}; for (const header in response.headers) { - if (!hasOwn(response.headers, header)) + if (!hasOwn(response.headers, header)) { continue; + } if (header.startsWith(memberTraits.httpPrefixHeaders)) { const value = response.headers[header]; const valueSchema = memberSchema.getValueSchema(); @@ -28560,7 +28621,7 @@ var init_RpcProtocol = __esm({ const deserializer = this.deserializer; const ns = NormalizedSchema.of(operationSchema.output); const dataObject = {}; - if (response.statusCode >= 300) { + if (this.isErrorResponse(response.statusCode)) { const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(15, bytes)); @@ -28569,8 +28630,9 @@ var init_RpcProtocol = __esm({ throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw."); } for (const header in response.headers) { - if (!hasOwn(response.headers, header)) + if (!hasOwn(response.headers, header)) { continue; + } const value = response.headers[header]; delete response.headers[header]; response.headers[header.toLowerCase()] = value; @@ -28591,6 +28653,49 @@ var init_RpcProtocol = __esm({ dataObject.$metadata = this.deserializeMetadata(response); return dataObject; } + isErrorResponse(statusCode) { + return statusCode >= 300; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js +var AbstractRpcV2Protocol; +var init_AbstractRpcV2Protocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js"() { + init_schema(); + init_transport(); + init_RpcProtocol(); + AbstractRpcV2Protocol = class extends RpcProtocol { + constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }) { + super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + Object.assign(request.headers, { + "content-type": this.getDefaultContentType(), + "smithy-protocol": this.getSmithyProtocolHeaderValue(), + accept: this.getDefaultContentType() + }); + if (deref(operationSchema.input) === "unit") { + delete request.body; + delete request.headers["content-type"]; + } else { + this.applyEmptyBody(request); + } + const { service, operation: operation2 } = getSmithyContext(context); + const path4 = `/service/${service}/operation/${operation2}`; + if (request.path.endsWith("/")) { + request.path += path4.slice(1); + } else { + request.path += path4; + } + return request; + } + isErrorResponse(statusCode) { + return statusCode !== 200; + } }; } }); @@ -29030,6 +29135,9 @@ var init_httpExtensionConfiguration = __esm({ if (runtimeConfig.logger && runtimeConfig.logger.constructor?.name !== "NoOpLogger") { runtimeConfig.requestHandler?.updateHttpClientConfig?.(/* @__PURE__ */ Symbol.for("logger"), runtimeConfig.logger); } + if (runtimeConfig.defaultSocketTimeout) { + runtimeConfig.requestHandler?.updateHttpClientConfig?.(/* @__PURE__ */ Symbol.for("@smithy/defaultSocketTimeout"), runtimeConfig.defaultSocketTimeout); + } return { setHttpHandler(handler) { runtimeConfig.requestHandler = handler; @@ -29494,15 +29602,6 @@ var init_parseJsonBody = __esm({ } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js -function writeKey(obj) { - Object.defineProperty(obj, "__proto__", { value: void 0, writable: true, enumerable: true, configurable: true }); -} -var init_writeKey = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js"() { - } -}); - // node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js var JsonShapeDeserializer2; var init_JsonShapeDeserializer2 = __esm({ @@ -29516,7 +29615,6 @@ var init_JsonShapeDeserializer2 = __esm({ init_jsonReviver(); init_needsReviver(); init_parseJsonBody(); - init_writeKey(); init_transport(); JsonShapeDeserializer2 = class extends SerdeContextConfig { settings; @@ -29567,8 +29665,9 @@ var init_JsonShapeDeserializer2 = __esm({ const map3 = value; if (this.needsTransform(mapMember)) { for (const k5 in map3) { - if (!hasOwn(map3, k5)) + if (!hasOwn(map3, k5)) { continue; + } if (k5 === "__proto__") { writeKey(map3); } @@ -29639,8 +29738,9 @@ var init_JsonShapeDeserializer2 = __esm({ } else { const doc = value; for (const k5 in doc) { - if (!hasOwn(doc, k5)) + if (!hasOwn(doc, k5)) { continue; + } if (k5 === "__proto__") { writeKey(doc); } @@ -29686,8 +29786,9 @@ var init_JsonShapeDeserializer2 = __esm({ unionSerde.writeUnknown(); } else if (hasType) { for (const k5 in record) { - if (!hasOwn(record, k5)) + if (!hasOwn(record, k5)) { continue; + } const v = record[k5]; const t = jsonName ? nameMap[k5] ?? k5 : k5; if (!(t in out)) { @@ -30232,8 +30333,9 @@ var init_JsonShapeSerializer2 = __esm({ const out = []; for (let i5 = 0; i5 < value.length; ++i5) { const v = value[i5]; - if (v == null && !sparse) + if (v == null && !sparse) { continue; + } if (Number.isNaN(v) || v === Infinity || v === -Infinity) { out.push(String(v)); } else { @@ -30272,8 +30374,9 @@ var init_JsonShapeSerializer2 = __esm({ if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) { let modifications; for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } const v = value[k5]; if (Number.isNaN(v) || v === Infinity || v === -Infinity) { (modifications ??= {})[k5] = v; @@ -30296,8 +30399,9 @@ var init_JsonShapeSerializer2 = __esm({ this.json[this.i++] = OPEN_BRACE; let first = true; for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } const v = value[k5]; if (isDocument ? v === void 0 : v == null && !sparse) { continue; @@ -30374,12 +30478,11 @@ var init_JsonCodec2 = __esm({ var SmithyRpcV2JsonProtocol; var init_SmithyRpcV2JsonProtocol = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js"() { - init_RpcProtocol(); + init_AbstractRpcV2Protocol(); init_schema(); - init_transport(); init_JsonCodec2(); init_parseJsonBody(); - SmithyRpcV2JsonProtocol = class extends RpcProtocol { + SmithyRpcV2JsonProtocol = class extends AbstractRpcV2Protocol { codec = new JsonCodec2({ timestampFormat: { useTrait: false, @@ -30390,39 +30493,19 @@ var init_SmithyRpcV2JsonProtocol = __esm({ }); serializer = this.codec.createSerializer(); deserializer = this.codec.createDeserializer(); - constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }) { - super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); - } getShapeId() { return "smithy.protocols#rpcv2Json"; } getPayloadCodec() { return this.codec; } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - Object.assign(request.headers, { - "content-type": this.getDefaultContentType(), - "smithy-protocol": "rpc-v2-json", - accept: this.getDefaultContentType() - }); - if (deref(operationSchema.input) === "unit") { - delete request.body; - delete request.headers["content-type"]; - } else if (!request.body) { + getSmithyProtocolHeaderValue() { + return "rpc-v2-json"; + } + applyEmptyBody(request) { + if (!request.body) { request.body = "{}"; } - const { service, operation: operation2 } = getSmithyContext(context); - const path4 = `/service/${service}/operation/${operation2}`; - if (request.path.endsWith("/")) { - request.path += path4.slice(1); - } else { - request.path += path4; - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); } async handleError(operationSchema, context, response, dataObject, metadata) { const errorName = loadSmithyRpcV2JsonErrorCode(response, dataObject) ?? "Unknown"; @@ -30490,7 +30573,6 @@ var init_JsonShapeDeserializer = __esm({ init_jsonReviver(); init_needsReviver(); init_parseJsonBody(); - init_writeKey(); JsonShapeDeserializer = class extends SerdeContextConfig { settings; constructor(settings) { @@ -30538,8 +30620,9 @@ var init_JsonShapeDeserializer = __esm({ unionSerde.writeUnknown(); } else if (typeof record.__type === "string") { for (const k5 in record) { - if (!hasOwn(record, k5)) + if (!hasOwn(record, k5)) { continue; + } const v = record[k5]; const t = jsonName ? nameMap[k5] ?? k5 : k5; if (!(t in out)) { @@ -30561,8 +30644,9 @@ var init_JsonShapeDeserializer = __esm({ const mapMember = ns.getValueSchema(); const out = {}; for (const _k in value) { - if (!hasOwn(value, _k)) + if (!hasOwn(value, _k)) { continue; + } if (_k === "__proto__") { writeKey(out); } @@ -30624,8 +30708,9 @@ var init_JsonShapeDeserializer = __esm({ if (isObject) { const out = Array.isArray(value) ? [] : {}; for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } if (k5 === "__proto__") { writeKey(out); } @@ -30709,7 +30794,6 @@ var init_JsonShapeSerializer = __esm({ init_serde(); init_ConfigurableSerdeContext(); init_jsonReplacer(); - init_writeKey(); init_transport(); JsonShapeSerializer = class extends SerdeContextConfig { settings; @@ -30779,8 +30863,9 @@ var init_JsonShapeSerializer = __esm({ } } else if (typeof record.__type === "string") { for (const k5 in record) { - if (!hasOwn(record, k5)) + if (!hasOwn(record, k5)) { continue; + } const v = record[k5]; const targetKey = jsonName ? nameMap[k5] ?? k5 : k5; if (!(targetKey in out)) { @@ -30806,8 +30891,9 @@ var init_JsonShapeSerializer = __esm({ const out = {}; const sparse = !!ns.getMergedTraits().sparse; for (const _k in value) { - if (!hasOwn(value, _k)) + if (!hasOwn(value, _k)) { continue; + } const _v = value[_k]; if (sparse || _v != null) { if (_k === "__proto__") { @@ -30880,8 +30966,9 @@ var init_JsonShapeSerializer = __esm({ } const out = Array.isArray(value) ? [] : {}; for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } const v = value[k5]; if (k5 === "__proto__") { writeKey(out); @@ -30934,6 +31021,7 @@ var init_JsonCodec = __esm({ // node_modules/@smithy/core/dist-es/submodules/protocols/index.js var protocols_exports = {}; __export(protocols_exports, { + AbstractRpcV2Protocol: () => AbstractRpcV2Protocol, Field: () => Field, Fields: () => Fields, FromStringShapeDeserializer: () => FromStringShapeDeserializer, @@ -30983,6 +31071,7 @@ var init_protocols = __esm({ init_HttpBindingProtocol(); init_HttpProtocol(); init_RpcProtocol(); + init_AbstractRpcV2Protocol(); init_requestBuilder(); init_resolve_path(); init_FromStringShapeDeserializer(); @@ -31112,8 +31201,9 @@ function parseRetryAfterHeader(response, logger2) { return; } for (const header in response.headers) { - if (!hasOwn(response.headers, header)) + if (!hasOwn(response.headers, header)) { continue; + } const h5 = header.toLowerCase(); if (h5 === "retry-after") { const retryAfter = response.headers[header]; @@ -31164,12 +31254,15 @@ var asSdkError; var init_util = __esm({ "node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js"() { asSdkError = (error3) => { - if (error3 instanceof Error) + if (error3 instanceof Error) { return error3; - if (error3 instanceof Object) + } + if (error3 instanceof Object) { return Object.assign(new Error(), error3); - if (typeof error3 === "string") + } + if (typeof error3 === "string") { return new Error(error3); + } return new Error(`AWS SDK error wrapper for ${error3}`); }; } @@ -31267,12 +31360,15 @@ var init_retryMiddleware = __esm({ return errorInfo; }; getRetryErrorType = (error3) => { - if (isThrottlingError(error3)) + if (isThrottlingError(error3)) { return "THROTTLING"; - if (isTransientError(error3)) + } + if (isTransientError(error3)) { return "TRANSIENT"; - if (isServerError(error3)) + } + if (isServerError(error3)) { return "SERVER_ERROR"; + } return "CLIENT_ERROR"; }; retryMiddlewareOptions = { @@ -31803,15 +31899,18 @@ var init_StandardRetryStrategy2 = __esm({ } }; getDelayFromRetryAfterHeader = (response) => { - if (!HttpResponse.isInstance(response)) + if (!HttpResponse.isInstance(response)) { return; + } const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) + if (!retryAfterHeaderName) { return; + } const retryAfter = response.headers[retryAfterHeaderName]; const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) + if (!Number.isNaN(retryAfterSeconds)) { return Math.min(retryAfterSeconds * 1e3, 2e4); + } const retryAfterDate = new Date(retryAfter); return Math.min(retryAfterDate.getTime() - Date.now(), 2e4); }; @@ -31861,8 +31960,9 @@ var init_configurations = __esm({ NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { environmentVariableSelector: (env2) => { const value = env2[ENV_MAX_ATTEMPTS]; - if (!value) + if (!value) { return void 0; + } const maxAttempt = parseInt(value); if (Number.isNaN(maxAttempt)) { throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); @@ -31871,8 +31971,9 @@ var init_configurations = __esm({ }, configFileSelector: (profile) => { const value = profile[CONFIG_MAX_ATTEMPTS]; - if (!value) + if (!value) { return void 0; + } const maxAttempt = parseInt(value); if (Number.isNaN(maxAttempt)) { throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); @@ -32553,8 +32654,9 @@ var normalizeProvider2; var init_normalizeProvider2 = __esm({ "node_modules/@smithy/core/dist-es/normalizeProvider.js"() { normalizeProvider2 = (input) => { - if (typeof input === "function") + if (typeof input === "function") { return input; + } const promisified = Promise.resolve(input); return () => promisified; }; @@ -32633,8 +32735,9 @@ var init_DefaultIdentityProviderConfig = __esm({ authSchemes = /* @__PURE__ */ new Map(); constructor(config) { for (const key in config) { - if (!hasOwn(config, key)) + if (!hasOwn(config, key)) { continue; + } const value = config[key]; if (value !== void 0) { this.authSchemes.set(key, value); @@ -36156,8 +36259,9 @@ var require_dist_cjs6 = __commonJS({ var getTransformedHeaders = (headers) => { const transformedHeaders = {}; for (const name in headers) { - if (!hasOwn2(headers, name)) + if (!hasOwn2(headers, name)) { continue; + } const headerValues = headers[name]; transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; } @@ -36239,13 +36343,25 @@ var require_dist_cjs6 = __commonJS({ } return timing.setTimeout(registerListener, deferTimeMs); }; + var resolveDefaultSocketTimeout = (config) => { + const value = config?.defaultSocketTimeout; + return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0; + }; var DEFER_EVENT_LISTENER_TIME = 3e3; - var setSocketTimeout = (request, reject, timeoutInMs = 0) => { + var setSocketTimeout = (request, reject, timeoutInMs = 0, destroyResponseBodyOnTimeout = false) => { + let response; + if (destroyResponseBodyOnTimeout) { + request.once("response", (res) => response = res); + } const registerTimeout = (offset) => { const timeout = timeoutInMs - offset; const onTimeout = () => { + const error3 = Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (${destroyResponseBodyOnTimeout ? "service default socket timeout" : "configured by client requestHandler"}).`), { name: "TimeoutError" }); + if (destroyResponseBodyOnTimeout) { + response?.destroy(error3); + } request.destroy(); - reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + reject(error3); }; if (request.socket) { request.socket.setTimeout(timeout, onTimeout); @@ -36258,7 +36374,12 @@ var require_dist_cjs6 = __commonJS({ registerTimeout(0); return 0; } - return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); + const deferralId = timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); + if (destroyResponseBodyOnTimeout) { + request.once("close", () => timing.clearTimeout(deferralId)); + return 0; + } + return deferralId; }; var MIN_WAIT_TIME = 6e3; async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { @@ -36343,8 +36464,9 @@ var require_dist_cjs6 = __commonJS({ } if (sockets && requests) { for (const origin in sockets) { - if (!hasOwn2(sockets, origin)) + if (!hasOwn2(sockets, origin)) { continue; + } const socketsInUse = sockets[origin]?.length ?? 0; const requestsEnqueued = requests[origin]?.length ?? 0; if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { @@ -36486,7 +36608,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout); requestTimeoutId = setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, logger2 ?? console); - socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout); + const defaultSocketTimeout = config.socketTimeout === void 0 ? resolveDefaultSocketTimeout(config) : void 0; + if (defaultSocketTimeout) { + socketTimeoutId = setSocketTimeout(req, reject, defaultSocketTimeout, true); + } else { + socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout); + } const httpAgent = nodeHttpsOptions.agent; if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { keepAliveTimeoutId = setSocketKeepAlive(req, { @@ -36503,11 +36630,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config) => { - if (key === /* @__PURE__ */ Symbol.for("logger")) { - return { - ...config, - logger: config.logger ?? value - }; + switch (key) { + case /* @__PURE__ */ Symbol.for("logger"): + key = "logger"; + value = config.logger ?? value; + break; + case /* @__PURE__ */ Symbol.for("@smithy/defaultSocketTimeout"): + key = "defaultSocketTimeout"; + value = resolveDefaultSocketTimeout(config) ?? value; + break; } return { ...config, @@ -36522,13 +36653,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger: logger2 } = options || {}; const keepAlive = true; const maxSockets = 50; + let httpAgentPromise; return { connectionTimeout, requestTimeout, socketTimeout, + defaultSocketTimeout: resolveDefaultSocketTimeout(options), socketAcquisitionWarningTimeout, throwOnRequestTimeout, - httpAgentProvider: async () => { + httpAgentProvider: () => httpAgentPromise ??= (async () => { const node_http = require("node:http"); const { Agent: Agent7, request } = node_http.default ?? node_http; hRequest = request; @@ -36538,7 +36671,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf return httpAgent; } return new hAgent({ keepAlive, maxSockets, ...httpAgent }); - }, + })(), httpsAgent: (() => { if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") { this.externalAgent = true; @@ -36803,7 +36936,8 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf } async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) { if (!this.config) { - this.config = await this.configProvider; + const config = await this.configProvider; + this.config = { ...config, defaultSocketTimeout: resolveDefaultSocketTimeout(config) }; const { disableConcurrentStreams: disableConcurrentStreams2, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config; this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams2 ?? false); if (maxConcurrentStreams) { @@ -36813,9 +36947,10 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions); } } - const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config; + const { requestTimeout: configRequestTimeout, disableConcurrentStreams, sessionTimeout } = this.config; const useIsolatedSession = disableConcurrentStreams || isEventStream; const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + const defaultSocketTimeout = effectiveRequestTimeout === void 0 && sessionTimeout === void 0 ? this.config.defaultSocketTimeout : void 0; return new Promise((_resolve, _reject) => { let fulfilled = false; let writeRequestBodyPromise = void 0; @@ -36875,6 +37010,18 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf timeoutError.name = "TimeoutError"; rejectWithDestroy(timeoutError); }); + } else if (defaultSocketTimeout) { + clientHttp2Stream.setTimeout(defaultSocketTimeout, () => { + const timeoutError = new Error(`Stream timed out because of no activity for ${defaultSocketTimeout} ms`); + timeoutError.name = "TimeoutError"; + fulfilled = true; + reject(timeoutError); + clientHttp2Stream.destroy(timeoutError); + if (useIsolatedSession) { + ref.destroy(); + } + }); + clientHttp2Stream.once("response", () => clientHttp2Stream.setTimeout(defaultSocketTimeout)); } if (abortSignal) { const onAbort = () => { @@ -36932,6 +37079,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config) => { + switch (key) { + case /* @__PURE__ */ Symbol.for("@smithy/defaultSocketTimeout"): + key = "defaultSocketTimeout"; + value = resolveDefaultSocketTimeout(config) ?? value; + break; + } return { ...config, [key]: value @@ -37576,8 +37729,9 @@ function writeStruct(ns, value, serdeContext) { } if (typeof value.__type === "string") { for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } if (!memberNames.includes(k5)) { writeString(k5); writeUntypedValue(value[k5]); @@ -37639,8 +37793,9 @@ function writeMap(ns, value, isDocument, serdeContext) { const valueSchema = ns.getValueSchema(); const keys = []; for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } const v = value[k5]; if (isDocument ? v !== void 0 : v != null || sparse) { keys.push(k5); @@ -38049,8 +38204,9 @@ function readStruct(ns, count, startPos) { if (isUnion) { let resultEmpty = true; for (const _ in result) { - if (!hasOwn(result, _)) + if (!hasOwn(result, _)) { continue; + } resultEmpty = false; break; } @@ -38213,8 +38369,9 @@ function readMapIndefinite(ns) { if (isUnion) { let resultEmpty = true; for (const _ in result) { - if (!hasOwn(result, _)) + if (!hasOwn(result, _)) { continue; + } resultEmpty = false; break; } @@ -38510,8 +38667,9 @@ function transformObject(ns, value) { if (ns.isMapSchema()) { const targetSchema = ns.getValueSchema(); for (const key in value) { - if (!hasOwn(value, key)) + if (!hasOwn(value, key)) { continue; + } newObject[key] = transformObject(targetSchema, value[key]); } } else if (ns.isStructSchema()) { @@ -38520,8 +38678,9 @@ function transformObject(ns, value) { if (isUnion) { keys = /* @__PURE__ */ new Set(); for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } if (k5 !== "__type") { keys.add(k5); } @@ -38538,8 +38697,9 @@ function transformObject(ns, value) { if (isUnion && keys?.size === 1) { let newObjectEmpty = true; for (const _ in newObject) { - if (!hasOwn(newObject, _)) + if (!hasOwn(newObject, _)) { continue; + } newObjectEmpty = false; break; } @@ -38549,8 +38709,9 @@ function transformObject(ns, value) { } } else if (typeof value.__type === "string") { for (const k5 in value) { - if (!hasOwn(value, k5)) + if (!hasOwn(value, k5)) { continue; + } if (!(k5 in newObject)) { newObject[k5] = value[k5]; } @@ -38624,52 +38785,29 @@ var init_SmithyRpcV2CborProtocol = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js"() { init_protocols(); init_schema(); - init_transport(); init_CborCodec(); init_parseCborBody(); - SmithyRpcV2CborProtocol = class extends RpcProtocol { + SmithyRpcV2CborProtocol = class extends AbstractRpcV2Protocol { codec = new CborCodec(); serializer = this.codec.createSerializer(); deserializer = this.codec.createDeserializer(); - constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }) { - super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); - } getShapeId() { return "smithy.protocols#rpcv2Cbor"; } getPayloadCodec() { return this.codec; } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - Object.assign(request.headers, { - "content-type": this.getDefaultContentType(), - "smithy-protocol": "rpc-v2-cbor", - accept: this.getDefaultContentType() - }); - if (deref(operationSchema.input) === "unit") { - delete request.body; - delete request.headers["content-type"]; - } else { - if (!request.body) { - this.serializer.write(15, {}); - request.body = this.serializer.flush(); - } - if (request.body instanceof Uint8Array) { - request.headers["content-length"] = String(request.body.byteLength); - } - } - const { service, operation: operation2 } = getSmithyContext(context); - const path4 = `/service/${service}/operation/${operation2}`; - if (request.path.endsWith("/")) { - request.path += path4.slice(1); - } else { - request.path += path4; - } - return request; + getSmithyProtocolHeaderValue() { + return "rpc-v2-cbor"; } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); + applyEmptyBody(request) { + if (!request.body) { + this.serializer.write(15, {}); + request.body = this.serializer.flush(); + } + if (request.body instanceof Uint8Array) { + request.headers["content-length"] = String(request.body.byteLength); + } } async handleError(operationSchema, context, response, dataObject, metadata) { const errorIdentifier = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";