@code-yeongyu/senpi 2026.8.20-2 → 2026.8.20

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.
Files changed (505) hide show
  1. package/CHANGELOG.md +0 -16
  2. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +13 -38
  3. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/index.js +1 -1
  4. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js +12 -34
  5. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/commands/ConverseCommand.d.ts +0 -29
  6. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/commands/ConverseStreamCommand.d.ts +0 -15
  7. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/commands/CountTokensCommand.d.ts +0 -14
  8. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/index.d.ts +1 -1
  9. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/models/models_0.d.ts +1 -119
  10. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.browser.d.ts +46 -46
  11. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.d.ts +36 -36
  12. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.native.d.ts +48 -48
  13. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.shared.d.ts +2 -2
  14. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/schemas/schemas_0.d.ts +0 -3
  15. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/index.d.ts +1 -1
  16. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/models/models_0.d.ts +0 -76
  17. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.browser.d.ts +72 -70
  18. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.d.ts +68 -68
  19. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -86
  20. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.shared.d.ts +3 -3
  21. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/schemas/schemas_0.d.ts +0 -3
  22. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +14 -14
  23. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +426 -1343
  24. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +5 -8
  25. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
  26. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +3 -3
  27. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v1/JsonCodec.js → JsonCodec.js} +1 -1
  28. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v1/JsonShapeDeserializer.js → JsonShapeDeserializer.js} +6 -6
  29. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v1/JsonShapeSerializer.js → JsonShapeSerializer.js} +5 -8
  30. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v2/JsonShapeDeserializer2.js → experimental/BufferJsonShapeDeserializer.js} +18 -38
  31. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v2/JsonShapeSerializer2.js → experimental/ByteJsonShapeSerializer.js} +71 -107
  32. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +9 -93
  33. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +54 -54
  34. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +1 -1
  35. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +1 -1
  36. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +1 -1
  37. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +6 -9
  38. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +2 -3
  39. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +2 -3
  40. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +3 -4
  41. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +3 -5
  42. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v1/JsonCodec.d.ts → JsonCodec.d.ts} +8 -4
  43. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v1/JsonShapeDeserializer.d.ts → JsonShapeDeserializer.d.ts} +2 -3
  44. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v1/JsonShapeSerializer.d.ts → JsonShapeSerializer.d.ts} +2 -3
  45. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v2/JsonShapeDeserializer2.d.ts → experimental/BufferJsonShapeDeserializer.d.ts} +3 -4
  46. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v2/JsonShapeSerializer2.d.ts → experimental/ByteJsonShapeSerializer.d.ts} +16 -19
  47. package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +7 -4
  48. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +21 -61
  49. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +27 -13
  50. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +16 -4
  51. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +14 -5
  52. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +5 -16
  53. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +11 -4
  54. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +47 -107
  55. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +39 -112
  56. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +48 -107
  57. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +14 -13
  58. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +35 -25
  59. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +4 -14
  60. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +6 -2
  61. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +5 -2
  62. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -2
  63. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +6 -2
  64. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +10 -2
  65. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +6 -2
  66. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +20 -16
  67. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +44 -21
  68. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -7
  69. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +5 -2
  70. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -18
  71. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +11 -8
  72. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +16 -14
  73. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +4 -1
  74. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +14 -7
  75. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +4 -1
  76. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +7 -6
  77. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +12 -6
  78. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +7 -6
  79. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -2
  80. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -4
  81. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +7 -2
  82. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +38 -28
  83. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -647
  84. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -1
  85. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -29
  86. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -1
  87. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -1
  88. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +1 -6
  89. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -1
  90. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -1
  91. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -1
  92. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +1 -12
  93. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +7 -4
  94. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +14 -7
  95. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +2 -7
  96. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +27 -15
  97. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +18 -10
  98. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +8 -3
  99. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +28 -14
  100. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +6 -2
  101. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +5 -2
  102. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +13 -4
  103. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +10 -9
  104. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +44 -39
  105. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +5 -2
  106. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -1
  107. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -1
  108. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -4
  109. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +7 -23
  110. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +38 -13
  111. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +133 -57
  112. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +11 -32
  113. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +9 -32
  114. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +8 -1
  115. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +6 -1
  116. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +8 -2
  117. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +8 -1
  118. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +26 -6
  119. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -4
  120. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +9 -1
  121. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -5
  122. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +74 -40
  123. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -9
  124. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +25 -36
  125. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +18 -3
  126. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -5
  127. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +22 -30
  128. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +22 -22
  129. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +22 -22
  130. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +29 -50
  131. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +36 -52
  132. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +19 -0
  133. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +13 -0
  134. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +28 -0
  135. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +7 -1
  136. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
  137. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
  138. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +57 -0
  139. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -7
  140. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -7
  141. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -2
  142. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +22 -14
  143. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +27 -18
  144. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +49 -57
  145. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +13 -7
  146. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +16 -21
  147. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -1
  148. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +31 -47
  149. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +14 -17
  150. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +20 -15
  151. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -21
  152. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/parseXmlBody.d.ts +13 -4
  153. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +6 -1
  154. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +3 -3
  155. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +32 -14
  156. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +2 -4
  157. package/node_modules/@aws-sdk/core/package.json +6 -6
  158. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  159. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  160. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/README.md +9 -0
  161. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +840 -0
  162. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  163. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  164. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
  165. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +50 -0
  166. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  167. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +241 -0
  168. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +136 -0
  169. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +46 -0
  170. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +173 -0
  171. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  172. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  173. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  174. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  175. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  176. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
  177. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  178. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  179. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  180. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  181. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  182. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +46 -0
  183. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  184. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
  185. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +46 -0
  186. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +36 -0
  187. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +76 -0
  188. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  189. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  190. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  191. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  192. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  193. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
  194. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +9 -0
  195. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  196. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  197. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  198. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/http2/ClientHttp2SessionRef.d.ts +46 -0
  199. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  200. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +47 -0
  201. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +46 -0
  202. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +36 -0
  203. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +76 -0
  204. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2.d.ts +2 -0
  205. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-https.d.ts +2 -0
  206. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  207. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  208. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  209. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
  210. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +9 -0
  211. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  212. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  213. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +64 -0
  214. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  215. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  216. package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +28 -35
  217. package/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js +28 -35
  218. package/node_modules/@aws-sdk/credential-provider-login/dist-types/LoginCredentialsFetcher.d.ts +0 -1
  219. package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/LoginCredentialsFetcher.d.ts +0 -1
  220. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  221. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  222. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  223. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
  224. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  225. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  226. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
  227. package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
  228. package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
  229. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  230. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  231. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  232. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  233. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  234. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +42 -42
  235. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +42 -42
  236. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +41 -41
  237. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +2 -2
  238. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +43 -43
  239. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +43 -43
  240. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +42 -42
  241. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +2 -2
  242. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +42 -42
  243. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +42 -42
  244. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +41 -41
  245. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +2 -2
  246. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +42 -42
  247. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +42 -42
  248. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +41 -41
  249. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +2 -2
  250. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +44 -44
  251. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +35 -35
  252. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +43 -43
  253. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +2 -2
  254. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +66 -64
  255. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +65 -65
  256. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +70 -68
  257. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +3 -3
  258. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +69 -67
  259. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +66 -66
  260. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +73 -71
  261. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +3 -3
  262. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +66 -64
  263. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +65 -65
  264. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +70 -68
  265. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +3 -3
  266. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +66 -64
  267. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +65 -65
  268. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +70 -68
  269. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +3 -3
  270. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +70 -68
  271. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +68 -68
  272. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +74 -72
  273. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +3 -3
  274. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  275. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/README.md +9 -0
  276. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +840 -0
  277. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  278. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  279. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
  280. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +50 -0
  281. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  282. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +241 -0
  283. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +136 -0
  284. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +46 -0
  285. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +173 -0
  286. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  287. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  288. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  289. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  290. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  291. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
  292. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  293. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  294. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  295. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  296. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  297. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +46 -0
  298. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  299. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
  300. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +46 -0
  301. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +36 -0
  302. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +76 -0
  303. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  304. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  305. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  306. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  307. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  308. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
  309. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +9 -0
  310. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  311. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  312. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  313. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/http2/ClientHttp2SessionRef.d.ts +46 -0
  314. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  315. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +47 -0
  316. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +46 -0
  317. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +36 -0
  318. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +76 -0
  319. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2.d.ts +2 -0
  320. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-https.d.ts +2 -0
  321. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  322. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  323. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  324. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
  325. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +9 -0
  326. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  327. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  328. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +64 -0
  329. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  330. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
  331. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  332. package/node_modules/@aws-sdk/types/package.json +2 -2
  333. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  334. package/node_modules/@bufbuild/protobuf/README.md +15 -12
  335. package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +162 -199
  336. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +153 -321
  337. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +303 -601
  338. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.d.ts +1 -27
  339. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +56 -80
  340. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +80 -3
  341. package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +3 -12
  342. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.d.ts +0 -4
  343. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +127 -365
  344. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +159 -393
  345. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts +1 -3
  346. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +8 -40
  347. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.d.ts +19 -37
  348. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +85 -281
  349. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.d.ts +1 -1
  350. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +1 -4
  351. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.d.ts +2 -19
  352. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +13 -47
  353. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts +4 -4
  354. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +23 -35
  355. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +12 -12
  356. package/node_modules/@bufbuild/protobuf/dist/esm/create.js +162 -199
  357. package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +153 -321
  358. package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +304 -602
  359. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts +1 -27
  360. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +57 -79
  361. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +78 -1
  362. package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +3 -12
  363. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts +0 -4
  364. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +127 -365
  365. package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +159 -393
  366. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts +1 -3
  367. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +8 -40
  368. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +19 -37
  369. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +87 -283
  370. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts +1 -1
  371. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +1 -1
  372. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +2 -19
  373. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +13 -46
  374. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts +4 -4
  375. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +23 -35
  376. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +12 -12
  377. package/node_modules/@bufbuild/protobuf/package.json +2 -2
  378. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -12
  379. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  380. package/node_modules/@earendil-works/pi-agent-core/package.json +6 -6
  381. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  382. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  383. package/node_modules/@earendil-works/pi-ai/package.json +8 -8
  384. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  385. package/node_modules/@earendil-works/pi-telemetry/package.json +2 -2
  386. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  387. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +337 -1560
  388. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +23 -23
  389. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +23 -23
  390. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +13 -17
  391. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +10 -0
  392. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +205 -4
  393. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +2 -1
  394. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +1 -1
  395. package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +1 -5
  396. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +4 -4
  397. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +19 -19
  398. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +4 -3
  399. package/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +4 -6
  400. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +5 -8
  401. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +2 -0
  402. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +2 -0
  403. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +2 -0
  404. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +2 -0
  405. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +2 -0
  406. package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +27 -5
  407. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
  408. package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +1 -5
  409. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +7 -1
  410. package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +1 -2
  411. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
  412. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
  413. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
  414. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
  415. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
  416. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
  417. package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +2 -14
  418. package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +2 -7
  419. package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
  420. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  421. package/node_modules/@smithy/core/dist-types/submodules/serde/parse-utils.d.ts +5 -5
  422. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +27 -5
  423. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
  424. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +1 -5
  425. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +7 -1
  426. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +1 -2
  427. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
  428. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
  429. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
  430. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
  431. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
  432. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
  433. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +2 -14
  434. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +2 -7
  435. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
  436. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +1 -1
  437. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/parse-utils.d.ts +5 -5
  438. package/node_modules/@smithy/core/package.json +11 -4
  439. package/node_modules/@smithy/credential-provider-imds/package.json +12 -4
  440. package/node_modules/@smithy/fetch-http-handler/package.json +13 -5
  441. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +2 -9
  442. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +2 -9
  443. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  444. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
  445. package/node_modules/@smithy/node-http-handler/package.json +13 -5
  446. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +9 -9
  447. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +9 -9
  448. package/node_modules/@smithy/signature-v4/package.json +12 -4
  449. package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +14 -14
  450. package/node_modules/@smithy/types/package.json +39 -29
  451. package/node_modules/@types/node/README.md +1 -1
  452. package/node_modules/@types/node/child_process.d.ts +1 -0
  453. package/node_modules/@types/node/crypto.d.ts +7 -7
  454. package/node_modules/@types/node/dns/promises.d.ts +5 -5
  455. package/node_modules/@types/node/dns.d.ts +5 -5
  456. package/node_modules/@types/node/fs.d.ts +0 -7
  457. package/node_modules/@types/node/http.d.ts +0 -30
  458. package/node_modules/@types/node/http2.d.ts +4 -4
  459. package/node_modules/@types/node/os.d.ts +30 -30
  460. package/node_modules/@types/node/package.json +2 -2
  461. package/node_modules/@types/node/perf_hooks.d.ts +1 -2
  462. package/node_modules/@types/node/process.d.ts +43 -42
  463. package/node_modules/@types/node/quic.d.ts +84 -1049
  464. package/node_modules/@types/node/sqlite.d.ts +1 -14
  465. package/node_modules/@types/node/stream/iter.d.ts +2 -3
  466. package/node_modules/@types/node/test.d.ts +0 -61
  467. package/node_modules/@types/node/v8.d.ts +23 -20
  468. package/package.json +36 -36
  469. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -1
  470. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -1
  471. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -103
  472. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -20
  473. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +0 -7
  474. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
  475. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -51
  476. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -13
  477. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +0 -4
  478. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -11
  479. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
  480. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
  481. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
  482. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
  483. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -9
  484. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
  485. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
  486. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.d.ts +0 -49
  487. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.js +0 -157
  488. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.d.ts +0 -28
  489. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.js +0 -44
  490. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.d.ts +0 -49
  491. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.js +0 -152
  492. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.d.ts +0 -28
  493. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.js +0 -41
  494. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +0 -113
  495. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +0 -103
  496. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +0 -621
  497. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +0 -602
  498. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +0 -13
  499. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +0 -15
  500. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +0 -18
  501. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +0 -35
  502. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +0 -13
  503. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +0 -15
  504. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +0 -18
  505. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +0 -35
@@ -2,7 +2,7 @@ const { SmithyRpcV2CborProtocol, loadSmithyRpcV2CborErrorCode } = require("@smit
2
2
  const { TypeRegistry, NormalizedSchema, deref } = require("@smithy/core/schema");
3
3
  const { decorateServiceException, getValueFromTextNode } = require("@smithy/core/client");
4
4
  const { collectBody, determineTimestampFormat, RpcProtocol, HttpBindingProtocol, HttpInterceptingShapeSerializer, HttpInterceptingShapeDeserializer, FromStringShapeDeserializer, extendedEncodeURIComponent } = require("@smithy/core/protocols");
5
- const { NumericValue, toUtf8, fromBase64, LazyJsonString, parseEpochTimestamp, parseRfc7231DateTime, parseRfc3339DateTimeWithOffset, generateIdempotencyToken, toBase64, dateToUtcString, expectUnion } = require("@smithy/core/serde");
5
+ const { NumericValue, toUtf8, fromBase64, LazyJsonString, parseEpochTimestamp, parseRfc7231DateTime, parseRfc3339DateTimeWithOffset, toBase64, dateToUtcString, generateIdempotencyToken, expectUnion } = require("@smithy/core/serde");
6
6
  const { parseXML, XmlNode, XmlText } = require("@aws-sdk/xml-builder");
7
7
 
8
8
  class ProtocolLib {
@@ -193,6 +193,56 @@ class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
193
193
  }
194
194
  }
195
195
 
196
+ const _toStr = (val) => {
197
+ if (val == null) {
198
+ return val;
199
+ }
200
+ if (typeof val === "number" || typeof val === "bigint") {
201
+ const warning = new Error(`Received number ${val} where a string was expected.`);
202
+ warning.name = "Warning";
203
+ console.warn(warning);
204
+ return String(val);
205
+ }
206
+ if (typeof val === "boolean") {
207
+ const warning = new Error(`Received boolean ${val} where a string was expected.`);
208
+ warning.name = "Warning";
209
+ console.warn(warning);
210
+ return String(val);
211
+ }
212
+ return val;
213
+ };
214
+ const _toBool = (val) => {
215
+ if (val == null) {
216
+ return val;
217
+ }
218
+ if (typeof val === "string") {
219
+ const lowercase = val.toLowerCase();
220
+ if (val !== "" && lowercase !== "false" && lowercase !== "true") {
221
+ const warning = new Error(`Received string "${val}" where a boolean was expected.`);
222
+ warning.name = "Warning";
223
+ console.warn(warning);
224
+ }
225
+ return val !== "" && lowercase !== "false";
226
+ }
227
+ return val;
228
+ };
229
+ const _toNum = (val) => {
230
+ if (val == null) {
231
+ return val;
232
+ }
233
+ if (typeof val === "string") {
234
+ const num = Number(val);
235
+ if (num.toString() !== val) {
236
+ const warning = new Error(`Received string "${val}" where a number was expected.`);
237
+ warning.name = "Warning";
238
+ console.warn(warning);
239
+ return val;
240
+ }
241
+ return num;
242
+ }
243
+ return val;
244
+ };
245
+
196
246
  class SerdeContextConfig {
197
247
  serdeContext;
198
248
  setSerdeContext(serdeContext) {
@@ -227,50 +277,30 @@ class UnionSerde {
227
277
  }
228
278
  }
229
279
 
230
- let canParseBuffer;
231
- function detectBufferParsing() {
232
- if (canParseBuffer === undefined) {
233
- try {
234
- if (typeof Buffer !== "function") {
235
- canParseBuffer = false;
236
- }
237
- else {
238
- const result = JSON.parse(Buffer.from([0x7b, 0x7d]));
239
- canParseBuffer = result !== null && typeof result === "object";
240
- }
241
- }
242
- catch {
243
- canParseBuffer = false;
244
- }
245
- }
246
- return canParseBuffer;
247
- }
248
-
249
280
  function jsonReviver(key, value, context) {
250
281
  if (context?.source) {
251
282
  const numericString = context.source;
252
283
  if (typeof value === "number") {
253
284
  const inSafeRange = value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER;
254
- if (inSafeRange) {
255
- if (isRepresentable(numericString, value)) {
285
+ if (!inSafeRange || numericString !== String(value)) {
286
+ if (inSafeRange && /[eE]/.test(numericString) && String(Number(numericString)) === String(value)) {
256
287
  return value;
257
288
  }
258
- return new NumericValue(numericString, "bigDecimal");
259
- }
260
- else {
261
- if (isFractionalBigNumeric(numericString)) {
289
+ if (isFractionalNumeric(numericString)) {
262
290
  return new NumericValue(numericString, "bigDecimal");
263
291
  }
264
- if (/[eE]/.test(numericString)) {
265
- return expandExponentToBigInt(numericString);
292
+ else {
293
+ if (/[eE]/.test(numericString)) {
294
+ return BigInt(Number(numericString));
295
+ }
296
+ return BigInt(numericString);
266
297
  }
267
- return BigInt(numericString);
268
298
  }
269
299
  }
270
300
  }
271
301
  return value;
272
302
  }
273
- function isFractionalBigNumeric(s) {
303
+ function isFractionalNumeric(s) {
274
304
  const dotIndex = s.indexOf(".");
275
305
  if (dotIndex === -1) {
276
306
  return false;
@@ -283,89 +313,6 @@ function isFractionalBigNumeric(s) {
283
313
  const exp = parseInt(s.slice(eIndex + 1), 10);
284
314
  return exp < fracDigits;
285
315
  }
286
- function isRepresentable(numericString, value) {
287
- if (numericString === String(value)) {
288
- return true;
289
- }
290
- if (Object.is(value, -0)) {
291
- return true;
292
- }
293
- if (/[eE]/.test(numericString)) {
294
- return expandToDecimal(numericString) === expandToDecimal(String(value));
295
- }
296
- const normalized = numericString.replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
297
- const canonical = String(value);
298
- if (normalized === canonical) {
299
- return true;
300
- }
301
- if (/[eE]/.test(canonical)) {
302
- return normalized === expandToDecimal(canonical);
303
- }
304
- return false;
305
- }
306
- function expandToDecimal(s) {
307
- const negative = s.startsWith("-");
308
- const abs = negative ? s.slice(1) : s;
309
- const eIndex = abs.search(/[eE]/);
310
- let result;
311
- if (eIndex === -1) {
312
- result = abs;
313
- }
314
- else {
315
- const exp = parseInt(abs.slice(eIndex + 1), 10);
316
- const mantissa = abs.slice(0, eIndex);
317
- const dotIndex = mantissa.indexOf(".");
318
- let digits;
319
- let intLen;
320
- if (dotIndex === -1) {
321
- digits = mantissa;
322
- intLen = mantissa.length;
323
- }
324
- else {
325
- digits = mantissa.slice(0, dotIndex) + mantissa.slice(dotIndex + 1);
326
- intLen = dotIndex;
327
- }
328
- digits = digits.replace(/0+$/, "") || "0";
329
- const newDotPos = intLen + exp;
330
- if (digits === "0") {
331
- result = "0";
332
- }
333
- else if (newDotPos <= 0) {
334
- result = "0." + "0".repeat(-newDotPos) + digits;
335
- }
336
- else if (newDotPos >= digits.length) {
337
- result = digits + "0".repeat(newDotPos - digits.length);
338
- }
339
- else {
340
- result = digits.slice(0, newDotPos) + "." + digits.slice(newDotPos);
341
- }
342
- }
343
- if (result.includes(".")) {
344
- result = result.replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
345
- }
346
- return (negative ? "-" : "") + result;
347
- }
348
- function expandExponentToBigInt(s) {
349
- const eIndex = s.search(/[eE]/);
350
- const exp = parseInt(s.slice(eIndex + 1), 10);
351
- const negative = s.startsWith("-");
352
- const mantissa = s.slice(negative ? 1 : 0, eIndex);
353
- const dotIndex = mantissa.indexOf(".");
354
- let digits;
355
- let shift;
356
- if (dotIndex === -1) {
357
- digits = mantissa;
358
- shift = exp;
359
- }
360
- else {
361
- digits = mantissa.slice(0, dotIndex) + mantissa.slice(dotIndex + 1);
362
- const fracDigits = mantissa.length - dotIndex - 1;
363
- shift = exp - fracDigits;
364
- }
365
- digits = digits.replace(/0+$/, "") || "0";
366
- const result = BigInt(digits) * 10n ** BigInt(shift + (mantissa.replace(".", "").length - digits.length));
367
- return negative ? -result : result;
368
- }
369
316
 
370
317
  const REVIVER_SYMBOL = Symbol.for("@aws-sdk/reviver");
371
318
  function needsReviver(schema) {
@@ -410,1117 +357,112 @@ function _check(ns, seen) {
410
357
 
411
358
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? toUtf8)(body));
412
359
 
413
- async function parseJsonBody(streamBody, context, schema) {
414
- let parsingInput;
415
- if (detectBufferParsing() && typeof streamBody?.[Symbol.asyncIterator] === "function") {
416
- const buffer = await collectBody(streamBody, context);
417
- if (typeof Buffer === "function") {
418
- if (Buffer.isBuffer(buffer)) {
419
- parsingInput = buffer;
420
- }
421
- else {
422
- parsingInput = Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
423
- }
424
- }
425
- }
426
- if (!parsingInput) {
427
- parsingInput = await collectBodyString(streamBody, context);
428
- }
429
- if (parsingInput.length === 0) {
430
- return {};
431
- }
432
- const reviver = schema && needsReviver(schema) ? jsonReviver : undefined;
433
- try {
434
- return JSON.parse(parsingInput, reviver);
435
- }
436
- catch (e) {
437
- if (e?.name === "SyntaxError") {
438
- Object.defineProperty(e, "$responseBodyText", {
439
- value: typeof parsingInput === "string" ? parsingInput : parsingInput.toString("utf8"),
440
- });
441
- }
442
- throw e;
443
- }
444
- }
445
- const parseJsonErrorBody = async (errorBody, context) => {
446
- const value = await parseJsonBody(errorBody, context);
447
- value.message = value.message ?? value.Message;
448
- return value;
449
- };
450
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
451
- const sanitizeErrorCode = (rawValue) => {
452
- let cleanValue = rawValue;
453
- if (typeof cleanValue === "number") {
454
- cleanValue = cleanValue.toString();
455
- }
456
- if (cleanValue.indexOf(",") >= 0) {
457
- cleanValue = cleanValue.split(",")[0];
458
- }
459
- if (cleanValue.indexOf(":") >= 0) {
460
- cleanValue = cleanValue.split(":")[0];
461
- }
462
- if (cleanValue.indexOf("#") >= 0) {
463
- cleanValue = cleanValue.split("#")[1];
464
- }
465
- return cleanValue;
466
- };
467
- const loadRestJsonErrorCode = (output, data) => {
468
- return loadErrorCode(output, data, ["header", "code", "type"]);
469
- };
470
- const loadJsonRpcErrorCode = (output, data, queryCompat = false) => {
471
- return loadErrorCode(output, data, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
472
- };
473
- const loadErrorCode = ({ headers }, data, order) => {
474
- while (order.length > 0) {
475
- const location = order.shift();
476
- switch (location) {
477
- case "header":
478
- const headerKey = findKey(headers ?? {}, "x-amzn-errortype");
479
- if (headerKey !== undefined) {
480
- return sanitizeErrorCode(headers[headerKey]);
481
- }
482
- break;
483
- case "code":
484
- const codeKey = findKey(data ?? {}, "code");
485
- if (codeKey && data[codeKey] !== undefined) {
486
- return sanitizeErrorCode(data[codeKey]);
487
- }
488
- break;
489
- case "type":
490
- if (data?.__type !== undefined) {
491
- return sanitizeErrorCode(data.__type);
492
- }
493
- break;
494
- }
495
- }
496
- };
497
-
498
- function writeKey(obj) {
499
- Object.defineProperty(obj, "__proto__", { value: undefined, writable: true, enumerable: true, configurable: true });
500
- }
501
-
502
- class JsonShapeDeserializer2 extends SerdeContextConfig {
503
- settings;
504
- constructor(settings) {
505
- super();
506
- this.settings = settings;
507
- }
508
- async read(schema, data) {
509
- const reviver = needsReviver(schema) ? jsonReviver : undefined;
510
- let parsed;
511
- if (typeof data === "string") {
512
- if (data.length === 0) {
513
- return {};
514
- }
515
- parsed = JSON.parse(data, reviver);
516
- }
517
- else if (data instanceof Uint8Array && detectBufferParsing()) {
518
- if (data.byteLength === 0) {
519
- return {};
520
- }
521
- const buf = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
522
- parsed = JSON.parse(buf, reviver);
523
- }
524
- else {
525
- parsed = await parseJsonBody(data, this.serdeContext, schema);
526
- }
527
- return this._read(schema, parsed);
528
- }
529
- readObject(schema, data) {
530
- return this._read(schema, data);
531
- }
532
- _read(schema, value) {
533
- const isObject = value !== null && typeof value === "object";
534
- const ns = NormalizedSchema.of(schema);
535
- if (isObject) {
536
- if (ns.isStructSchema()) {
537
- return this._readStruct(ns, value);
538
- }
539
- if (Array.isArray(value) && ns.isListSchema()) {
540
- const listMember = ns.getValueSchema();
541
- if (this.needsTransform(listMember)) {
542
- for (let i = 0; i < value.length; ++i) {
543
- value[i] = this._read(listMember, value[i]);
544
- }
545
- }
546
- return value;
547
- }
548
- if (ns.isMapSchema()) {
549
- const mapMember = ns.getValueSchema();
550
- const map = value;
551
- if (this.needsTransform(mapMember)) {
552
- for (const k in map) {
553
- if (k === "__proto__") {
554
- writeKey(map);
555
- }
556
- map[k] = this._read(mapMember, map[k]);
557
- }
558
- }
559
- return map;
560
- }
561
- }
562
- if (ns.isBlobSchema() && typeof value === "string") {
563
- return fromBase64(value);
564
- }
565
- const mediaType = ns.getMergedTraits().mediaType;
566
- if (ns.isStringSchema() && typeof value === "string" && mediaType) {
567
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
568
- if (isJson) {
569
- return LazyJsonString.from(value);
570
- }
571
- return value;
572
- }
573
- if (ns.isTimestampSchema() && value != null) {
574
- const format = determineTimestampFormat(ns, this.settings);
575
- switch (format) {
576
- case 5:
577
- return parseRfc3339DateTimeWithOffset(value);
578
- case 6:
579
- return parseRfc7231DateTime(value);
580
- case 7:
581
- return parseEpochTimestamp(value);
582
- default:
583
- console.warn("Missing timestamp format, parsing value with Date constructor:", value);
584
- return new Date(value);
585
- }
586
- }
587
- if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
588
- return BigInt(value);
589
- }
590
- if (ns.isBigDecimalSchema() && value != undefined) {
591
- if (value instanceof NumericValue) {
592
- return value;
593
- }
594
- const untyped = value;
595
- if (untyped.type === "bigDecimal" && "string" in untyped) {
596
- return new NumericValue(untyped.string, untyped.type);
597
- }
598
- return new NumericValue(String(value), "bigDecimal");
599
- }
600
- if (ns.isNumericSchema() && typeof value === "string") {
601
- switch (value) {
602
- case "Infinity":
603
- return Infinity;
604
- case "-Infinity":
605
- return -Infinity;
606
- case "NaN":
607
- return NaN;
608
- }
609
- return value;
610
- }
611
- if (ns.isDocumentSchema()) {
612
- if (isObject) {
613
- if (Array.isArray(value)) {
614
- for (let i = 0; i < value.length; ++i) {
615
- const v = value[i];
616
- if (!(v instanceof NumericValue)) {
617
- value[i] = this._read(ns, v);
618
- }
619
- }
620
- }
621
- else {
622
- const doc = value;
623
- for (const k in doc) {
624
- if (k === "__proto__") {
625
- writeKey(doc);
626
- }
627
- const v = doc[k];
628
- if (!(v instanceof NumericValue)) {
629
- doc[k] = this._read(ns, v);
630
- }
631
- }
632
- }
633
- }
634
- }
635
- return value;
636
- }
637
- _readStruct(ns, record) {
638
- const union = ns.isUnionSchema();
639
- const out = {};
640
- let nameMap;
641
- const hasType = typeof record.__type === "string";
642
- const { jsonName } = this.settings;
643
- if (jsonName && hasType) {
644
- nameMap = {};
645
- }
646
- let unionSerde;
647
- if (union) {
648
- unionSerde = new UnionSerde(record, out);
649
- }
650
- for (const [memberName, memberSchema] of ns.structIterator()) {
651
- let fromKey = memberName;
652
- if (jsonName) {
653
- fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
654
- if (hasType) {
655
- nameMap[fromKey] = memberName;
656
- }
657
- }
658
- if (union) {
659
- unionSerde.mark(fromKey);
660
- }
661
- if (record[fromKey] != null) {
662
- out[memberName] = this._read(memberSchema, record[fromKey]);
663
- }
664
- }
665
- if (union) {
666
- unionSerde.writeUnknown();
667
- }
668
- else if (hasType) {
669
- for (const k in record) {
670
- const v = record[k];
671
- const t = jsonName ? (nameMap[k] ?? k) : k;
672
- if (!(t in out)) {
673
- out[t] = v;
674
- }
675
- }
676
- }
677
- return out;
678
- }
679
- needsTransform(ns) {
680
- if (ns.isBlobSchema() || ns.isTimestampSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
681
- return true;
682
- }
683
- if (ns.isDocumentSchema() || ns.isStructSchema() || ns.isListSchema() || ns.isMapSchema()) {
684
- return true;
685
- }
686
- if (ns.isStringSchema() && ns.getMergedTraits().mediaType) {
687
- return true;
688
- }
689
- return false;
690
- }
691
- }
692
-
693
- class JsonBytesStringAdapter extends Uint8Array {
694
- string = null;
695
- static allocUnsafe(bytes) {
696
- if (typeof Buffer === "function") {
697
- const buffer = Buffer.allocUnsafe(bytes);
698
- return new JsonBytesStringAdapter(buffer.buffer, buffer.byteOffset, buffer.byteLength);
699
- }
700
- return new JsonBytesStringAdapter(bytes);
701
- }
702
- toString() {
703
- return this.s();
704
- }
705
- valueOf() {
706
- return this.s();
707
- }
708
- includes(searchString, position) {
709
- if (typeof searchString === "string") {
710
- return this.s().includes(searchString, position);
711
- }
712
- return Uint8Array.prototype.includes.call(this, searchString, position);
713
- }
714
- indexOf(searchString, position) {
715
- if (typeof searchString === "string") {
716
- return this.s().indexOf(searchString, position);
717
- }
718
- return Uint8Array.prototype.indexOf.call(this, searchString, position);
719
- }
720
- lastIndexOf(searchString, position) {
721
- if (typeof searchString === "string") {
722
- return this.s().lastIndexOf(searchString, position);
723
- }
724
- const fn = Uint8Array.prototype.lastIndexOf;
725
- if (position !== undefined) {
726
- return fn.call(this, searchString, position);
727
- }
728
- return fn.call(this, searchString);
729
- }
730
- startsWith(searchString, position) {
731
- return this.s().startsWith(searchString, position);
732
- }
733
- endsWith(searchString, endPosition) {
734
- return this.s().endsWith(searchString, endPosition);
735
- }
736
- match(regexp) {
737
- return this.s().match(regexp);
738
- }
739
- replace(searchValue, replaceValue) {
740
- return this.s().replace(searchValue, replaceValue);
741
- }
742
- search(regexp) {
743
- return this.s().search(regexp);
744
- }
745
- split(separator, limit) {
746
- return this.s().split(separator, limit);
747
- }
748
- substring(start, end) {
749
- return this.s().substring(start, end);
750
- }
751
- trim() {
752
- return this.s().trim();
753
- }
754
- trimStart() {
755
- return this.s().trimStart();
756
- }
757
- trimEnd() {
758
- return this.s().trimEnd();
759
- }
760
- charAt(pos) {
761
- return this.s().charAt(pos);
762
- }
763
- charCodeAt(index) {
764
- return this.s().charCodeAt(index);
765
- }
766
- padStart(maxLength, fillString) {
767
- return this.s().padStart(maxLength, fillString);
768
- }
769
- padEnd(maxLength, fillString) {
770
- return this.s().padEnd(maxLength, fillString);
771
- }
772
- repeat(count) {
773
- return this.s().repeat(count);
774
- }
775
- toUpperCase() {
776
- return this.s().toUpperCase();
777
- }
778
- toLowerCase() {
779
- return this.s().toLowerCase();
780
- }
781
- s() {
782
- if (this.string == null) {
783
- const n = Date.now();
784
- if (n > warned + 60_000) {
785
- console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. " +
786
- "It has been automatically converted to string. In a future version this will throw an error.");
787
- warned = n;
788
- }
789
- this.string = toUtf8(this);
790
- }
791
- return this.string;
792
- }
793
- }
794
- var warned = 0;
795
-
796
- const encoder = new TextEncoder();
797
- const OPEN_BRACE = 0x7b;
798
- const CLOSE_BRACE = 0x7d;
799
- const OPEN_BRACKET = 0x5b;
800
- const CLOSE_BRACKET = 0x5d;
801
- const QUOTE = 0x22;
802
- const COLON = 0x3a;
803
- const COMMA = 0x2c;
804
- const BACKSLASH = 0x5c;
805
- const TRUE = new Uint8Array([0x74, 0x72, 0x75, 0x65]);
806
- const FALSE = new Uint8Array([0x66, 0x61, 0x6c, 0x73, 0x65]);
807
- const NULL = new Uint8Array([0x6e, 0x75, 0x6c, 0x6c]);
808
- const ESCAPE_TABLE = new Array(128).fill(null);
809
- ESCAPE_TABLE[0x08] = "b";
810
- ESCAPE_TABLE[0x09] = "t";
811
- ESCAPE_TABLE[0x0a] = "n";
812
- ESCAPE_TABLE[0x0c] = "f";
813
- ESCAPE_TABLE[0x0d] = "r";
814
- ESCAPE_TABLE[0x22] = '"';
815
- ESCAPE_TABLE[0x5c] = "\\";
816
- for (let i = 0; i < 0x20; i++) {
817
- if (ESCAPE_TABLE[i] === null) {
818
- ESCAPE_TABLE[i] = "u00" + i.toString(16).padStart(2, "0");
819
- }
820
- }
821
- const INITIAL_BUFFER_SIZE = 2048;
822
- function alloc(size) {
823
- return JsonBytesStringAdapter.allocUnsafe(size);
824
- }
825
- class JsonShapeSerializer2 extends SerdeContextConfig {
826
- settings;
827
- json;
828
- i = 0;
829
- rootSchema;
830
- rawValue;
831
- passthrough = false;
832
- constructor(settings) {
833
- super();
834
- this.settings = settings;
835
- this.json = alloc(INITIAL_BUFFER_SIZE);
836
- }
837
- write(schema, value) {
838
- this.i = 0;
839
- this.rawValue = value;
840
- this.rootSchema = NormalizedSchema.of(schema);
841
- this.passthrough = this.rootSchema.isBlobSchema() || this.rootSchema.isStringSchema();
842
- if (!this.passthrough) {
843
- this.writeValue(this.rootSchema, value, undefined);
844
- }
845
- }
846
- writeDiscriminatedDocument(schema, value) {
847
- this.i = 0;
848
- this.rootSchema = NormalizedSchema.of(schema);
849
- const ns = this.rootSchema;
850
- if (ns.isStructSchema() && value != null && typeof value === "object") {
851
- this.writeValue(ns, value, undefined);
852
- const prefix = `"__type":"${ns.getName(true) ?? "Unknown"}",`;
853
- const z = prefix.length;
854
- this.ensure(z);
855
- this.json.copyWithin(1 + z, 1, this.i);
856
- encoder.encodeInto(prefix, this.json.subarray(1));
857
- this.i += z;
858
- }
859
- else {
860
- this.writeValue(ns, value, undefined);
861
- }
862
- }
863
- flush() {
864
- this.rootSchema = undefined;
865
- const finalPosition = this.i;
866
- this.i = 0;
867
- const raw = this.rawValue;
868
- this.rawValue = undefined;
869
- if (finalPosition === 0) {
870
- return raw;
871
- }
872
- const result = this.json.subarray(0, finalPosition);
873
- this.json = alloc(INITIAL_BUFFER_SIZE);
874
- return result;
875
- }
876
- ensure(byteCount) {
877
- const { i, json } = this;
878
- if (i + byteCount > json.length) {
879
- let newSize = json.length * 2;
880
- while (newSize < i + byteCount) {
881
- newSize *= 2;
882
- }
883
- const next = alloc(newSize);
884
- next.set(this.json);
885
- this.json = next;
886
- }
887
- }
888
- writeAscii(s) {
889
- const z = s.length;
890
- this.ensure(z);
891
- let { i, json } = this;
892
- for (let j = 0; j < z; ++j) {
893
- json[i] = s.charCodeAt(j);
894
- i += 1;
895
- }
896
- this.i = i;
897
- }
898
- writeAsciiQuoted(s) {
899
- const z = s.length;
900
- this.ensure(z + 4);
901
- let { json, i } = this;
902
- json[i++] = QUOTE;
903
- for (let j = 0; j < z; ++j) {
904
- json[i++] = s.charCodeAt(j);
905
- }
906
- json[i++] = QUOTE;
907
- this.i = i;
908
- }
909
- writeJsonString(s) {
910
- this.ensure(s.length * 3 + 2);
911
- this.json[this.i++] = QUOTE;
912
- const z = s.length;
913
- for (let j = 0; j < z; ++j) {
914
- const c = s.charCodeAt(j);
915
- if (c > 0x22 && c < 0x5c) {
916
- this.json[this.i++] = c;
917
- }
918
- else if (c < 0x80) {
919
- const esc = ESCAPE_TABLE[c];
920
- if (esc !== null) {
921
- this.ensure(esc.length + 1);
922
- this.json[this.i++] = BACKSLASH;
923
- for (let k = 0; k < esc.length; k++) {
924
- this.json[this.i++] = esc.charCodeAt(k);
925
- }
926
- }
927
- else {
928
- this.json[this.i++] = c;
929
- }
930
- }
931
- else if (c >= 0xd800 && c <= 0xdbff) {
932
- const next = j + 1 < z ? s.charCodeAt(j + 1) : 0;
933
- if (next >= 0xdc00 && next <= 0xdfff) {
934
- this.ensure(4);
935
- const { written } = encoder.encodeInto(s.substring(j, j + 2), this.json.subarray(this.i));
936
- this.i += written;
937
- ++j;
938
- }
939
- else {
940
- this.ensure(6);
941
- this.writeUnicodeEscape(c);
942
- }
943
- }
944
- else if (c >= 0xdc00 && c <= 0xdfff) {
945
- this.ensure(6);
946
- this.writeUnicodeEscape(c);
947
- }
948
- else {
949
- let { i, json } = this;
950
- if (c < 0x800) {
951
- json[i++] = 0xc0 | (c >> 6);
952
- json[i++] = 0x80 | (c & 0x3f);
953
- }
954
- else {
955
- json[i++] = 0xe0 | (c >> 12);
956
- json[i++] = 0x80 | ((c >> 6) & 0x3f);
957
- json[i++] = 0x80 | (c & 0x3f);
958
- }
959
- this.i = i;
960
- }
961
- }
962
- this.json[this.i++] = QUOTE;
963
- }
964
- writeUnicodeEscape(code) {
965
- let { json, i } = this;
966
- json[i++] = BACKSLASH;
967
- json[i++] = 0x75;
968
- const hex = code.toString(16).padStart(4, "0");
969
- for (let j = 0; j < 4; ++j) {
970
- json[i++] = hex.charCodeAt(j);
971
- }
972
- this.i = i;
973
- }
974
- static B64 = (() => {
975
- const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
976
- const table = new Uint8Array(64);
977
- for (let i = 0; i < 64; ++i) {
978
- table[i] = chars.charCodeAt(i);
979
- }
980
- return table;
981
- })();
982
- writeBase64(data) {
983
- const b64Len = Math.ceil(data.length / 3) * 4;
984
- this.ensure(b64Len + 2);
985
- const json = this.json;
986
- const B64 = JsonShapeSerializer2.B64;
987
- let i = this.i;
988
- json[i++] = QUOTE;
989
- const len = data.length;
990
- const remainder = len % 3;
991
- const mainLen = len - remainder;
992
- for (let j = 0; j < mainLen; j += 3) {
993
- const a = data[j];
994
- const b = data[j + 1];
995
- const c = data[j + 2];
996
- json[i++] = B64[a >> 2];
997
- json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
998
- json[i++] = B64[((b & 0x0f) << 2) | (c >> 6)];
999
- json[i++] = B64[c & 0x3f];
1000
- }
1001
- if (remainder === 2) {
1002
- const a = data[mainLen];
1003
- const b = data[mainLen + 1];
1004
- json[i++] = B64[a >> 2];
1005
- json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
1006
- json[i++] = B64[(b & 0x0f) << 2];
1007
- json[i++] = 0x3d;
1008
- }
1009
- else if (remainder === 1) {
1010
- const a = data[mainLen];
1011
- json[i++] = B64[a >> 2];
1012
- json[i++] = B64[(a & 0x03) << 4];
1013
- json[i++] = 0x3d;
1014
- json[i++] = 0x3d;
1015
- }
1016
- json[i++] = QUOTE;
1017
- this.i = i;
1018
- }
1019
- writeValue(schema, value, container) {
1020
- if (value == null) {
1021
- if (container?.isStructSchema()) {
1022
- if (value === undefined) {
1023
- const ns = NormalizedSchema.of(schema);
1024
- if (ns.isIdempotencyToken()) {
1025
- this.writeAsciiQuoted(generateIdempotencyToken());
1026
- return;
1027
- }
1028
- }
1029
- return;
1030
- }
1031
- this.ensure(4);
1032
- this.json.set(NULL, this.i);
1033
- this.i += 4;
1034
- return;
1035
- }
1036
- const ns = NormalizedSchema.of(schema);
1037
- const isObject = typeof value === "object";
1038
- if (ns.isStringSchema()) {
1039
- const mediaType = ns.getMergedTraits().mediaType;
1040
- if (mediaType) {
1041
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
1042
- if (isJson) {
1043
- this.writeJsonString(LazyJsonString.from(value).toString());
1044
- return;
1045
- }
1046
- }
1047
- }
1048
- if (isObject) {
1049
- if (ns.isStructSchema()) {
1050
- this.writeStruct(ns, value);
1051
- return;
1052
- }
1053
- if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
1054
- this.writeList(ns, value, ns.isDocumentSchema());
1055
- return;
1056
- }
1057
- if (ns.isMapSchema()) {
1058
- this.writeMap(ns, value, false);
1059
- return;
1060
- }
1061
- if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
1062
- this.writeBase64(value);
1063
- return;
1064
- }
1065
- if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
1066
- this.writeTimestamp(ns, value);
1067
- return;
1068
- }
1069
- if (value instanceof NumericValue) {
1070
- this.writeAscii(value.string);
1071
- return;
1072
- }
1073
- if (ns.isDocumentSchema()) {
1074
- if (Array.isArray(value)) {
1075
- this.writeList(ns, value, true);
1076
- }
1077
- else {
1078
- this.writeMap(ns, value, true);
1079
- }
1080
- return;
1081
- }
1082
- const json = JSON.stringify(value);
1083
- this.writeAscii(json);
1084
- return;
1085
- }
1086
- if (typeof value === "string") {
1087
- if (ns.isBlobSchema()) {
1088
- const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
1089
- this.writeAsciiQuoted(b64);
1090
- return;
1091
- }
1092
- this.writeJsonString(value);
1093
- return;
1094
- }
1095
- if (typeof value === "number") {
1096
- if (Math.abs(value) === Infinity || Number.isNaN(value)) {
1097
- this.writeAsciiQuoted(String(value));
1098
- return;
1099
- }
1100
- const numStr = String(value);
1101
- this.writeAscii(numStr);
1102
- return;
1103
- }
1104
- if (typeof value === "boolean") {
1105
- this.ensure(5);
1106
- let { i, json } = this;
1107
- if (value) {
1108
- json.set(TRUE, i);
1109
- i += 4;
1110
- }
1111
- else {
1112
- json.set(FALSE, i);
1113
- i += 5;
1114
- }
1115
- this.i = i;
1116
- return;
1117
- }
1118
- if (typeof value === "bigint") {
1119
- this.writeAscii(value.toString());
1120
- return;
1121
- }
1122
- this.writeAscii(String(value));
1123
- }
1124
- writeStruct(ns, value) {
1125
- this.ensure(2);
1126
- this.json[this.i++] = OPEN_BRACE;
1127
- let wroteAny = false;
1128
- const hasType = typeof value.__type === "string";
1129
- let writtenKeys;
1130
- if (hasType) {
1131
- writtenKeys = new Set();
1132
- }
1133
- for (const [memberName, memberSchema] of ns.structIterator()) {
1134
- const item = value[memberName];
1135
- if (item == null && !memberSchema.isIdempotencyToken()) {
1136
- continue;
1137
- }
1138
- if (wroteAny) {
1139
- this.ensure(1);
1140
- this.json[this.i++] = COMMA;
1141
- }
1142
- wroteAny = true;
1143
- const targetKey = this.settings.jsonName ? (memberSchema.getMergedTraits().jsonName ?? memberName) : memberName;
1144
- if (writtenKeys) {
1145
- writtenKeys.add(memberName);
1146
- writtenKeys.add(targetKey);
1147
- }
1148
- this.writeAsciiQuoted(targetKey);
1149
- this.json[this.i++] = COLON;
1150
- this.writeValue(memberSchema, item, ns);
1151
- }
1152
- if (!wroteAny && ns.isUnionSchema()) {
1153
- const { $unknown } = value;
1154
- if (Array.isArray($unknown)) {
1155
- const [k, v] = $unknown;
1156
- this.writeAsciiQuoted(k);
1157
- this.ensure(1);
1158
- this.json[this.i++] = COLON;
1159
- this.writeValue(15, v, ns);
1160
- }
1161
- }
1162
- else if (hasType) {
1163
- for (const k in value) {
1164
- if (writtenKeys.has(k)) {
1165
- continue;
1166
- }
1167
- writtenKeys.add(k);
1168
- const v = value[k];
1169
- if (wroteAny) {
1170
- this.ensure(1);
1171
- this.json[this.i++] = COMMA;
1172
- }
1173
- wroteAny = true;
1174
- this.writeAsciiQuoted(k);
1175
- this.ensure(1);
1176
- this.json[this.i++] = COLON;
1177
- this.writeValue(15, v, undefined);
1178
- }
1179
- }
1180
- this.ensure(1);
1181
- this.json[this.i++] = CLOSE_BRACE;
1182
- }
1183
- writeList(ns, value, isDocument) {
1184
- const sparse = !!ns.getMergedTraits().sparse;
1185
- const valueSchema = ns.getValueSchema();
1186
- if (!isDocument) {
1187
- if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
1188
- let hasSpecials = false;
1189
- for (let i = 0; i < value.length; ++i) {
1190
- const v = value[i];
1191
- if (Number.isNaN(v) || v === Infinity || v === -Infinity || (v == null && !sparse)) {
1192
- hasSpecials = true;
1193
- break;
1194
- }
1195
- }
1196
- let json;
1197
- if (!hasSpecials) {
1198
- json = JSON.stringify(value);
1199
- }
1200
- else {
1201
- const out = [];
1202
- for (let i = 0; i < value.length; ++i) {
1203
- const v = value[i];
1204
- if (v == null && !sparse)
1205
- continue;
1206
- if (Number.isNaN(v) || v === Infinity || v === -Infinity) {
1207
- out.push(String(v));
1208
- }
1209
- else {
1210
- out.push(v);
1211
- }
1212
- }
1213
- json = JSON.stringify(out);
1214
- }
1215
- this.ensure(json.length * 3);
1216
- this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
1217
- return;
1218
- }
1219
- }
1220
- this.ensure(2);
1221
- this.json[this.i++] = OPEN_BRACKET;
1222
- let wroteFirstItem = false;
1223
- for (let i = 0; i < value.length; ++i) {
1224
- const item = value[i];
1225
- if (isDocument ? item === undefined : item == null && !sparse) {
1226
- continue;
1227
- }
1228
- if (wroteFirstItem) {
1229
- this.ensure(1);
1230
- this.json[this.i++] = COMMA;
1231
- }
1232
- this.writeValue(valueSchema, item, undefined);
1233
- wroteFirstItem = true;
1234
- }
1235
- this.ensure(1);
1236
- this.json[this.i++] = CLOSE_BRACKET;
1237
- }
1238
- writeMap(ns, value, isDocument) {
1239
- const sparse = !!ns.getMergedTraits().sparse;
1240
- const valueSchema = ns.getValueSchema();
1241
- if (!isDocument) {
1242
- if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
1243
- let modifications;
1244
- for (const k in value) {
1245
- const v = value[k];
1246
- if (Number.isNaN(v) || v === Infinity || v === -Infinity) {
1247
- (modifications ??= {})[k] = v;
1248
- value[k] = String(v);
1249
- }
1250
- else if (v === null && !sparse) {
1251
- (modifications ??= {})[k] = null;
1252
- value[k] = undefined;
1253
- }
1254
- }
1255
- const json = JSON.stringify(value);
1256
- if (modifications) {
1257
- Object.assign(value, modifications);
1258
- }
1259
- this.ensure(json.length * 3);
1260
- this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
1261
- return;
1262
- }
1263
- }
1264
- this.ensure(2);
1265
- this.json[this.i++] = OPEN_BRACE;
1266
- let first = true;
1267
- for (const k in value) {
1268
- const v = value[k];
1269
- if (isDocument ? v === undefined : v == null && !sparse) {
1270
- continue;
1271
- }
1272
- if (!first) {
1273
- this.ensure(1);
1274
- this.json[this.i++] = COMMA;
1275
- }
1276
- first = false;
1277
- this.writeJsonString(k);
1278
- this.ensure(1);
1279
- this.json[this.i++] = COLON;
1280
- this.writeValue(valueSchema, v, undefined);
1281
- }
1282
- this.ensure(1);
1283
- this.json[this.i++] = CLOSE_BRACE;
1284
- }
1285
- writeTimestamp(ns, value) {
1286
- const format = determineTimestampFormat(ns, this.settings);
1287
- switch (format) {
1288
- case 5: {
1289
- const iso = value.toISOString().replace(".000Z", "Z");
1290
- this.writeAsciiQuoted(iso);
1291
- return;
1292
- }
1293
- case 6: {
1294
- this.writeAsciiQuoted(dateToUtcString(value));
1295
- return;
1296
- }
1297
- case 7: {
1298
- const epochSecs = String(value.getTime() / 1000);
1299
- this.writeAscii(epochSecs);
1300
- return;
1301
- }
1302
- default: {
1303
- const epochSecs = String(value.getTime() / 1000);
1304
- this.writeAscii(epochSecs);
1305
- return;
1306
- }
1307
- }
1308
- }
1309
- }
1310
-
1311
- class JsonCodec2 extends SerdeContextConfig {
1312
- settings;
1313
- constructor(settings) {
1314
- super();
1315
- this.settings = settings;
1316
- }
1317
- createSerializer() {
1318
- const serializer = new JsonShapeSerializer2(this.settings);
1319
- serializer.setSerdeContext(this.serdeContext);
1320
- return serializer;
1321
- }
1322
- createDeserializer() {
1323
- const deserializer = new JsonShapeDeserializer2(this.settings);
1324
- deserializer.setSerdeContext(this.serdeContext);
1325
- return deserializer;
1326
- }
1327
- }
1328
-
1329
- class AwsJsonRpcProtocol extends RpcProtocol {
1330
- serializer;
1331
- deserializer;
1332
- serviceTarget;
1333
- codec;
1334
- mixin;
1335
- awsQueryCompatible;
1336
- constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
1337
- super({
1338
- defaultNamespace,
1339
- errorTypeRegistries,
1340
- });
1341
- this.serviceTarget = serviceTarget;
1342
- this.codec =
1343
- jsonCodec ??
1344
- new JsonCodec2({
1345
- timestampFormat: {
1346
- useTrait: true,
1347
- default: 7,
1348
- },
1349
- jsonName: false,
1350
- });
1351
- this.serializer = this.codec.createSerializer();
1352
- this.deserializer = this.codec.createDeserializer();
1353
- this.awsQueryCompatible = !!awsQueryCompatible;
1354
- this.mixin = new ProtocolLib(this.awsQueryCompatible);
1355
- }
1356
- async serializeRequest(operationSchema, input, context) {
1357
- const request = await super.serializeRequest(operationSchema, input, context);
1358
- if (!request.path.endsWith("/")) {
1359
- request.path += "/";
1360
- }
1361
- request.headers["content-type"] = `application/x-amz-json-${this.getJsonRpcVersion()}`;
1362
- request.headers["x-amz-target"] = `${this.serviceTarget}.${operationSchema.name}`;
1363
- if (this.awsQueryCompatible) {
1364
- request.headers["x-amzn-query-mode"] = "true";
1365
- }
1366
- if (deref(operationSchema.input) === "unit" || !request.body) {
1367
- request.body = "{}";
1368
- }
1369
- return request;
1370
- }
1371
- getPayloadCodec() {
1372
- return this.codec;
1373
- }
1374
- async handleError(operationSchema, context, response, dataObject, metadata) {
1375
- const { awsQueryCompatible } = this;
1376
- if (awsQueryCompatible) {
1377
- this.mixin.setQueryCompatError(dataObject, response);
1378
- }
1379
- const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, awsQueryCompatible) ?? "Unknown";
1380
- this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1381
- const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
1382
- const ns = NormalizedSchema.of(errorSchema);
1383
- const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1384
- const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1385
- const exception = new ErrorCtor({});
1386
- const output = {};
1387
- const errorDeserializer = this.codec.createDeserializer();
1388
- for (const [name, member] of ns.structIterator()) {
1389
- if (dataObject[name] != null) {
1390
- output[name] = errorDeserializer.readObject(member, dataObject[name]);
1391
- }
1392
- }
1393
- if (awsQueryCompatible) {
1394
- this.mixin.queryCompatOutput(dataObject, output);
1395
- }
1396
- throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
1397
- $fault: ns.getMergedTraits().error,
1398
- message,
1399
- }, output), dataObject);
1400
- }
1401
- }
1402
-
1403
- class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
1404
- constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
1405
- super({
1406
- defaultNamespace,
1407
- errorTypeRegistries,
1408
- serviceTarget,
1409
- awsQueryCompatible,
1410
- jsonCodec,
1411
- });
1412
- }
1413
- getShapeId() {
1414
- return "aws.protocols#awsJson1_0";
1415
- }
1416
- getJsonRpcVersion() {
1417
- return "1.0";
1418
- }
1419
- getDefaultContentType() {
1420
- return "application/x-amz-json-1.0";
1421
- }
1422
- }
1423
-
1424
- class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
1425
- constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
1426
- super({
1427
- defaultNamespace,
1428
- errorTypeRegistries,
1429
- serviceTarget,
1430
- awsQueryCompatible,
1431
- jsonCodec,
1432
- });
1433
- }
1434
- getShapeId() {
1435
- return "aws.protocols#awsJson1_1";
1436
- }
1437
- getJsonRpcVersion() {
1438
- return "1.1";
1439
- }
1440
- getDefaultContentType() {
1441
- return "application/x-amz-json-1.1";
1442
- }
1443
- }
1444
-
1445
- class AwsRestJsonProtocol extends HttpBindingProtocol {
1446
- serializer;
1447
- deserializer;
1448
- codec;
1449
- mixin = new ProtocolLib();
1450
- constructor({ defaultNamespace, errorTypeRegistries, jsonCodec, }) {
1451
- super({
1452
- defaultNamespace,
1453
- errorTypeRegistries,
1454
- });
1455
- const settings = {
1456
- timestampFormat: {
1457
- useTrait: true,
1458
- default: 7,
1459
- },
1460
- httpBindings: true,
1461
- jsonName: true,
1462
- };
1463
- this.codec = jsonCodec ?? new JsonCodec2(settings);
1464
- this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
1465
- this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
1466
- }
1467
- getShapeId() {
1468
- return "aws.protocols#restJson1";
1469
- }
1470
- getPayloadCodec() {
1471
- return this.codec;
1472
- }
1473
- setSerdeContext(serdeContext) {
1474
- this.codec.setSerdeContext(serdeContext);
1475
- super.setSerdeContext(serdeContext);
1476
- }
1477
- async serializeRequest(operationSchema, input, context) {
1478
- const request = await super.serializeRequest(operationSchema, input, context);
1479
- const inputSchema = NormalizedSchema.of(operationSchema.input);
1480
- if (!request.headers["content-type"]) {
1481
- const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
1482
- if (contentType) {
1483
- request.headers["content-type"] = contentType;
360
+ let canParseBuffer;
361
+ function detectBufferParsing() {
362
+ if (canParseBuffer === undefined) {
363
+ try {
364
+ if (typeof Buffer !== "function") {
365
+ canParseBuffer = false;
366
+ }
367
+ else {
368
+ const result = JSON.parse(Buffer.from([0x7b, 0x7d]));
369
+ canParseBuffer = result !== null && typeof result === "object";
1484
370
  }
1485
371
  }
1486
- if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) {
1487
- request.body = "{}";
372
+ catch {
373
+ canParseBuffer = false;
1488
374
  }
1489
- return request;
1490
375
  }
1491
- async deserializeResponse(operationSchema, context, response) {
1492
- const output = await super.deserializeResponse(operationSchema, context, response);
1493
- const outputSchema = NormalizedSchema.of(operationSchema.output);
1494
- for (const [name, member] of outputSchema.structIterator()) {
1495
- if (member.getMemberTraits().httpPayload && !(name in output)) {
1496
- output[name] = null;
376
+ return canParseBuffer;
377
+ }
378
+
379
+ async function parseJsonBody(streamBody, context, schema) {
380
+ let parsingInput;
381
+ if (detectBufferParsing() && typeof streamBody?.[Symbol.asyncIterator] === "function") {
382
+ const buffer = await collectBody(streamBody, context);
383
+ if (typeof Buffer === "function") {
384
+ if (Buffer.isBuffer(buffer)) {
385
+ parsingInput = buffer;
386
+ }
387
+ else {
388
+ parsingInput = Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
1497
389
  }
1498
390
  }
1499
- return output;
1500
391
  }
1501
- async handleError(operationSchema, context, response, dataObject, metadata) {
1502
- const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
1503
- this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1504
- const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
1505
- const ns = NormalizedSchema.of(errorSchema);
1506
- const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1507
- const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1508
- const exception = new ErrorCtor({});
1509
- await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
1510
- const output = {};
1511
- const errorDeserializer = this.codec.createDeserializer();
1512
- for (const [name, member] of ns.structIterator()) {
1513
- const target = member.getMergedTraits().jsonName ?? name;
1514
- output[name] = errorDeserializer.readObject(member, dataObject[target]);
392
+ if (!parsingInput) {
393
+ parsingInput = await collectBodyString(streamBody, context);
394
+ }
395
+ if (parsingInput.length === 0) {
396
+ return {};
397
+ }
398
+ const reviver = schema && needsReviver(schema) ? jsonReviver : undefined;
399
+ try {
400
+ return JSON.parse(parsingInput, reviver);
401
+ }
402
+ catch (e) {
403
+ if (e?.name === "SyntaxError") {
404
+ Object.defineProperty(e, "$responseBodyText", {
405
+ value: typeof parsingInput === "string" ? parsingInput : parsingInput.toString("utf8"),
406
+ });
1515
407
  }
1516
- throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
1517
- $fault: ns.getMergedTraits().error,
1518
- message,
1519
- }, output), dataObject);
408
+ throw e;
1520
409
  }
1521
- getDefaultContentType() {
1522
- return "application/json";
410
+ }
411
+ const parseJsonErrorBody = async (errorBody, context) => {
412
+ const value = await parseJsonBody(errorBody, context);
413
+ value.message = value.message ?? value.Message;
414
+ return value;
415
+ };
416
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
417
+ const sanitizeErrorCode = (rawValue) => {
418
+ let cleanValue = rawValue;
419
+ if (typeof cleanValue === "number") {
420
+ cleanValue = cleanValue.toString();
421
+ }
422
+ if (cleanValue.indexOf(",") >= 0) {
423
+ cleanValue = cleanValue.split(",")[0];
424
+ }
425
+ if (cleanValue.indexOf(":") >= 0) {
426
+ cleanValue = cleanValue.split(":")[0];
427
+ }
428
+ if (cleanValue.indexOf("#") >= 0) {
429
+ cleanValue = cleanValue.split("#")[1];
430
+ }
431
+ return cleanValue;
432
+ };
433
+ const loadRestJsonErrorCode = (output, data) => {
434
+ return loadErrorCode(output, data, ["header", "code", "type"]);
435
+ };
436
+ const loadJsonRpcErrorCode = (output, data, queryCompat = false) => {
437
+ return loadErrorCode(output, data, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
438
+ };
439
+ const loadErrorCode = ({ headers }, data, order) => {
440
+ while (order.length > 0) {
441
+ const location = order.shift();
442
+ switch (location) {
443
+ case "header":
444
+ const headerKey = findKey(headers ?? {}, "x-amzn-errortype");
445
+ if (headerKey !== undefined) {
446
+ return sanitizeErrorCode(headers[headerKey]);
447
+ }
448
+ break;
449
+ case "code":
450
+ const codeKey = findKey(data ?? {}, "code");
451
+ if (codeKey && data[codeKey] !== undefined) {
452
+ return sanitizeErrorCode(data[codeKey]);
453
+ }
454
+ break;
455
+ case "type":
456
+ if (data?.__type !== undefined) {
457
+ return sanitizeErrorCode(data.__type);
458
+ }
459
+ break;
460
+ }
1523
461
  }
462
+ };
463
+
464
+ function writeKey(obj) {
465
+ Object.defineProperty(obj, "__proto__", { value: undefined, writable: true, enumerable: true, configurable: true });
1524
466
  }
1525
467
 
1526
468
  class JsonShapeDeserializer extends SerdeContextConfig {
@@ -1824,7 +766,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
1824
766
  }
1825
767
  return out;
1826
768
  }
1827
- if (value instanceof Uint8Array && ns.isBlobSchema()) {
769
+ if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
1828
770
  if (ns === this.rootSchema) {
1829
771
  return value;
1830
772
  }
@@ -1848,83 +790,287 @@ class JsonShapeSerializer extends SerdeContextConfig {
1848
790
  this.useReplacer = true;
1849
791
  }
1850
792
  }
1851
- if (value === null && container?.isStructSchema()) {
1852
- return void 0;
793
+ if (value === null && container?.isStructSchema()) {
794
+ return void 0;
795
+ }
796
+ if (ns.isStringSchema()) {
797
+ if (typeof value === "undefined" && ns.isIdempotencyToken()) {
798
+ return generateIdempotencyToken();
799
+ }
800
+ const mediaType = ns.getMergedTraits().mediaType;
801
+ if (value != null && mediaType) {
802
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
803
+ if (isJson) {
804
+ return LazyJsonString.from(value);
805
+ }
806
+ }
807
+ return value;
808
+ }
809
+ if (typeof value === "number" && ns.isNumericSchema()) {
810
+ if (Math.abs(value) === Infinity || isNaN(value)) {
811
+ return String(value);
812
+ }
813
+ return value;
814
+ }
815
+ if (typeof value === "string" && ns.isBlobSchema()) {
816
+ if (ns === this.rootSchema) {
817
+ return value;
818
+ }
819
+ return (this.serdeContext?.base64Encoder ?? toBase64)(value);
820
+ }
821
+ if (typeof value === "bigint") {
822
+ this.useReplacer = true;
823
+ }
824
+ if (ns.isDocumentSchema()) {
825
+ if (isObject) {
826
+ const out = Array.isArray(value) ? [] : {};
827
+ for (const k in value) {
828
+ const v = value[k];
829
+ if (k === "__proto__") {
830
+ writeKey(out);
831
+ }
832
+ if (v instanceof NumericValue) {
833
+ this.useReplacer = true;
834
+ out[k] = v;
835
+ }
836
+ else {
837
+ out[k] = this._write(ns, v);
838
+ }
839
+ }
840
+ return out;
841
+ }
842
+ else {
843
+ return structuredClone(value);
844
+ }
845
+ }
846
+ return value;
847
+ }
848
+ }
849
+
850
+ class JsonCodec extends SerdeContextConfig {
851
+ settings;
852
+ constructor(settings) {
853
+ super();
854
+ this.settings = settings;
855
+ }
856
+ createSerializer() {
857
+ const serializer = new JsonShapeSerializer(this.settings);
858
+ serializer.setSerdeContext(this.serdeContext);
859
+ return serializer;
860
+ }
861
+ createDeserializer() {
862
+ const deserializer = new JsonShapeDeserializer(this.settings);
863
+ deserializer.setSerdeContext(this.serdeContext);
864
+ return deserializer;
865
+ }
866
+ }
867
+
868
+ class AwsJsonRpcProtocol extends RpcProtocol {
869
+ serializer;
870
+ deserializer;
871
+ serviceTarget;
872
+ codec;
873
+ mixin;
874
+ awsQueryCompatible;
875
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
876
+ super({
877
+ defaultNamespace,
878
+ errorTypeRegistries,
879
+ });
880
+ this.serviceTarget = serviceTarget;
881
+ this.codec =
882
+ jsonCodec ??
883
+ new JsonCodec({
884
+ timestampFormat: {
885
+ useTrait: true,
886
+ default: 7,
887
+ },
888
+ jsonName: false,
889
+ });
890
+ this.serializer = this.codec.createSerializer();
891
+ this.deserializer = this.codec.createDeserializer();
892
+ this.awsQueryCompatible = !!awsQueryCompatible;
893
+ this.mixin = new ProtocolLib(this.awsQueryCompatible);
894
+ }
895
+ async serializeRequest(operationSchema, input, context) {
896
+ const request = await super.serializeRequest(operationSchema, input, context);
897
+ if (!request.path.endsWith("/")) {
898
+ request.path += "/";
899
+ }
900
+ request.headers["content-type"] = `application/x-amz-json-${this.getJsonRpcVersion()}`;
901
+ request.headers["x-amz-target"] = `${this.serviceTarget}.${operationSchema.name}`;
902
+ if (this.awsQueryCompatible) {
903
+ request.headers["x-amzn-query-mode"] = "true";
904
+ }
905
+ if (deref(operationSchema.input) === "unit" || !request.body) {
906
+ request.body = "{}";
907
+ }
908
+ return request;
909
+ }
910
+ getPayloadCodec() {
911
+ return this.codec;
912
+ }
913
+ async handleError(operationSchema, context, response, dataObject, metadata) {
914
+ const { awsQueryCompatible } = this;
915
+ if (awsQueryCompatible) {
916
+ this.mixin.setQueryCompatError(dataObject, response);
917
+ }
918
+ const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, awsQueryCompatible) ?? "Unknown";
919
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
920
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
921
+ const ns = NormalizedSchema.of(errorSchema);
922
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
923
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
924
+ const exception = new ErrorCtor({});
925
+ const output = {};
926
+ const errorDeserializer = this.codec.createDeserializer();
927
+ for (const [name, member] of ns.structIterator()) {
928
+ if (dataObject[name] != null) {
929
+ output[name] = errorDeserializer.readObject(member, dataObject[name]);
930
+ }
931
+ }
932
+ if (awsQueryCompatible) {
933
+ this.mixin.queryCompatOutput(dataObject, output);
1853
934
  }
1854
- if (ns.isStringSchema()) {
1855
- if (typeof value === "undefined" && ns.isIdempotencyToken()) {
1856
- return generateIdempotencyToken();
1857
- }
1858
- const mediaType = ns.getMergedTraits().mediaType;
1859
- if (value != null && mediaType) {
1860
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
1861
- if (isJson) {
1862
- return LazyJsonString.from(value);
1863
- }
935
+ throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
936
+ $fault: ns.getMergedTraits().error,
937
+ message,
938
+ }, output), dataObject);
939
+ }
940
+ }
941
+
942
+ class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
943
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
944
+ super({
945
+ defaultNamespace,
946
+ errorTypeRegistries,
947
+ serviceTarget,
948
+ awsQueryCompatible,
949
+ jsonCodec,
950
+ });
951
+ }
952
+ getShapeId() {
953
+ return "aws.protocols#awsJson1_0";
954
+ }
955
+ getJsonRpcVersion() {
956
+ return "1.0";
957
+ }
958
+ getDefaultContentType() {
959
+ return "application/x-amz-json-1.0";
960
+ }
961
+ }
962
+
963
+ class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
964
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
965
+ super({
966
+ defaultNamespace,
967
+ errorTypeRegistries,
968
+ serviceTarget,
969
+ awsQueryCompatible,
970
+ jsonCodec,
971
+ });
972
+ }
973
+ getShapeId() {
974
+ return "aws.protocols#awsJson1_1";
975
+ }
976
+ getJsonRpcVersion() {
977
+ return "1.1";
978
+ }
979
+ getDefaultContentType() {
980
+ return "application/x-amz-json-1.1";
981
+ }
982
+ }
983
+
984
+ class AwsRestJsonProtocol extends HttpBindingProtocol {
985
+ serializer;
986
+ deserializer;
987
+ codec;
988
+ mixin = new ProtocolLib();
989
+ constructor({ defaultNamespace, errorTypeRegistries, }) {
990
+ super({
991
+ defaultNamespace,
992
+ errorTypeRegistries,
993
+ });
994
+ const settings = {
995
+ timestampFormat: {
996
+ useTrait: true,
997
+ default: 7,
998
+ },
999
+ httpBindings: true,
1000
+ jsonName: true,
1001
+ };
1002
+ this.codec = new JsonCodec(settings);
1003
+ this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
1004
+ this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
1005
+ }
1006
+ getShapeId() {
1007
+ return "aws.protocols#restJson1";
1008
+ }
1009
+ getPayloadCodec() {
1010
+ return this.codec;
1011
+ }
1012
+ setSerdeContext(serdeContext) {
1013
+ this.codec.setSerdeContext(serdeContext);
1014
+ super.setSerdeContext(serdeContext);
1015
+ }
1016
+ async serializeRequest(operationSchema, input, context) {
1017
+ const request = await super.serializeRequest(operationSchema, input, context);
1018
+ const inputSchema = NormalizedSchema.of(operationSchema.input);
1019
+ if (!request.headers["content-type"]) {
1020
+ const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
1021
+ if (contentType) {
1022
+ request.headers["content-type"] = contentType;
1864
1023
  }
1865
- return value;
1866
1024
  }
1867
- if (typeof value === "number") {
1868
- if (Math.abs(value) === Infinity || isNaN(value)) {
1869
- return String(value);
1870
- }
1871
- return value;
1025
+ if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) {
1026
+ request.body = "{}";
1872
1027
  }
1873
- if (typeof value === "string" && ns.isBlobSchema()) {
1874
- if (ns === this.rootSchema) {
1875
- return value;
1028
+ return request;
1029
+ }
1030
+ async deserializeResponse(operationSchema, context, response) {
1031
+ const output = await super.deserializeResponse(operationSchema, context, response);
1032
+ const outputSchema = NormalizedSchema.of(operationSchema.output);
1033
+ for (const [name, member] of outputSchema.structIterator()) {
1034
+ if (member.getMemberTraits().httpPayload && !(name in output)) {
1035
+ output[name] = null;
1876
1036
  }
1877
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
1878
- }
1879
- if (typeof value === "bigint") {
1880
- this.useReplacer = true;
1881
1037
  }
1882
- if (ns.isDocumentSchema()) {
1883
- if (isObject) {
1884
- if (value instanceof Uint8Array) {
1885
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
1886
- }
1887
- const out = Array.isArray(value) ? [] : {};
1888
- for (const k in value) {
1889
- const v = value[k];
1890
- if (k === "__proto__") {
1891
- writeKey(out);
1892
- }
1893
- if (v instanceof NumericValue) {
1894
- this.useReplacer = true;
1895
- out[k] = v;
1896
- }
1897
- else {
1898
- out[k] = this._write(ns, v);
1899
- }
1900
- }
1901
- return out;
1902
- }
1903
- else {
1904
- return structuredClone(value);
1905
- }
1038
+ return output;
1039
+ }
1040
+ async handleError(operationSchema, context, response, dataObject, metadata) {
1041
+ const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
1042
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1043
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
1044
+ const ns = NormalizedSchema.of(errorSchema);
1045
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1046
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1047
+ const exception = new ErrorCtor({});
1048
+ await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
1049
+ const output = {};
1050
+ const errorDeserializer = this.codec.createDeserializer();
1051
+ for (const [name, member] of ns.structIterator()) {
1052
+ const target = member.getMergedTraits().jsonName ?? name;
1053
+ output[name] = errorDeserializer.readObject(member, dataObject[target]);
1906
1054
  }
1907
- return value;
1055
+ throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
1056
+ $fault: ns.getMergedTraits().error,
1057
+ message,
1058
+ }, output), dataObject);
1059
+ }
1060
+ getDefaultContentType() {
1061
+ return "application/json";
1908
1062
  }
1909
1063
  }
1910
1064
 
1911
- class JsonCodec extends SerdeContextConfig {
1912
- settings;
1913
- constructor(settings) {
1914
- super();
1915
- this.settings = settings;
1916
- }
1917
- createSerializer() {
1918
- const serializer = new JsonShapeSerializer(this.settings);
1919
- serializer.setSerdeContext(this.serdeContext);
1920
- return serializer;
1065
+ const awsExpectUnion = (value) => {
1066
+ if (value == null) {
1067
+ return undefined;
1921
1068
  }
1922
- createDeserializer() {
1923
- const deserializer = new JsonShapeDeserializer(this.settings);
1924
- deserializer.setSerdeContext(this.serdeContext);
1925
- return deserializer;
1069
+ if (typeof value === "object" && "__type" in value) {
1070
+ delete value.__type;
1926
1071
  }
1927
- }
1072
+ return expectUnion(value);
1073
+ };
1928
1074
 
1929
1075
  class XmlShapeDeserializer extends SerdeContextConfig {
1930
1076
  settings;
@@ -2858,66 +2004,6 @@ class AwsRestXmlProtocol extends HttpBindingProtocol {
2858
2004
  }
2859
2005
  }
2860
2006
 
2861
- const awsExpectUnion = (value) => {
2862
- if (value == null) {
2863
- return undefined;
2864
- }
2865
- if (typeof value === "object" && "__type" in value) {
2866
- delete value.__type;
2867
- }
2868
- return expectUnion(value);
2869
- };
2870
-
2871
- const _toStr = (val) => {
2872
- if (val == null) {
2873
- return val;
2874
- }
2875
- if (typeof val === "number" || typeof val === "bigint") {
2876
- const warning = new Error(`Received number ${val} where a string was expected.`);
2877
- warning.name = "Warning";
2878
- console.warn(warning);
2879
- return String(val);
2880
- }
2881
- if (typeof val === "boolean") {
2882
- const warning = new Error(`Received boolean ${val} where a string was expected.`);
2883
- warning.name = "Warning";
2884
- console.warn(warning);
2885
- return String(val);
2886
- }
2887
- return val;
2888
- };
2889
- const _toBool = (val) => {
2890
- if (val == null) {
2891
- return val;
2892
- }
2893
- if (typeof val === "string") {
2894
- const lowercase = val.toLowerCase();
2895
- if (val !== "" && lowercase !== "false" && lowercase !== "true") {
2896
- const warning = new Error(`Received string "${val}" where a boolean was expected.`);
2897
- warning.name = "Warning";
2898
- console.warn(warning);
2899
- }
2900
- return val !== "" && lowercase !== "false";
2901
- }
2902
- return val;
2903
- };
2904
- const _toNum = (val) => {
2905
- if (val == null) {
2906
- return val;
2907
- }
2908
- if (typeof val === "string") {
2909
- const num = Number(val);
2910
- if (num.toString() !== val) {
2911
- const warning = new Error(`Received string "${val}" where a number was expected.`);
2912
- warning.name = "Warning";
2913
- console.warn(warning);
2914
- return val;
2915
- }
2916
- return num;
2917
- }
2918
- return val;
2919
- };
2920
-
2921
2007
  exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol;
2922
2008
  exports.AwsJson1_0Protocol = AwsJson1_0Protocol;
2923
2009
  exports.AwsJson1_1Protocol = AwsJson1_1Protocol;
@@ -2927,11 +2013,8 @@ exports.AwsRestJsonProtocol = AwsRestJsonProtocol;
2927
2013
  exports.AwsRestXmlProtocol = AwsRestXmlProtocol;
2928
2014
  exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol;
2929
2015
  exports.JsonCodec = JsonCodec;
2930
- exports.JsonCodec2 = JsonCodec2;
2931
2016
  exports.JsonShapeDeserializer = JsonShapeDeserializer;
2932
- exports.JsonShapeDeserializer2 = JsonShapeDeserializer2;
2933
2017
  exports.JsonShapeSerializer = JsonShapeSerializer;
2934
- exports.JsonShapeSerializer2 = JsonShapeSerializer2;
2935
2018
  exports.QueryShapeSerializer = QueryShapeSerializer;
2936
2019
  exports.XmlCodec = XmlCodec;
2937
2020
  exports.XmlShapeDeserializer = XmlShapeDeserializer;