@cdk8s/awscdk-resolver 0.0.374 → 0.0.376

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 (423) hide show
  1. package/.jsii +2 -2
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@smithy/abort-controller/dist-cjs/index.js +28 -80
  4. package/node_modules/@smithy/abort-controller/dist-es/AbortController.js +1 -3
  5. package/node_modules/@smithy/abort-controller/dist-es/AbortSignal.js +2 -2
  6. package/node_modules/@smithy/abort-controller/package.json +2 -2
  7. package/node_modules/@smithy/config-resolver/dist-cjs/index.js +158 -215
  8. package/node_modules/@smithy/config-resolver/package.json +5 -5
  9. package/node_modules/@smithy/core/dist-cjs/index.js +308 -412
  10. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +957 -969
  11. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +198 -249
  12. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +793 -895
  13. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +617 -811
  14. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +584 -680
  15. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -0
  16. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +3 -3
  17. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +18 -18
  18. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +5 -5
  19. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -0
  20. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +2 -0
  21. package/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +9 -7
  22. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +2 -0
  23. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +3 -0
  24. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js +3 -0
  25. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +3 -2
  26. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +4 -1
  27. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +3 -5
  28. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +5 -5
  29. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +6 -5
  30. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +16 -8
  31. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +6 -5
  32. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +3 -0
  33. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +5 -5
  34. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +6 -5
  35. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +14 -14
  36. package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -0
  37. package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +1 -1
  38. package/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +4 -2
  39. package/node_modules/@smithy/core/package.json +11 -11
  40. package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +340 -412
  41. package/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js +2 -1
  42. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  43. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +190 -238
  44. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -0
  45. package/node_modules/@smithy/fetch-http-handler/package.json +6 -6
  46. package/node_modules/@smithy/hash-node/dist-cjs/index.js +38 -63
  47. package/node_modules/@smithy/hash-node/dist-es/index.js +3 -0
  48. package/node_modules/@smithy/hash-node/package.json +4 -4
  49. package/node_modules/@smithy/invalid-dependency/dist-cjs/index.js +7 -38
  50. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  51. package/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +4 -30
  52. package/node_modules/@smithy/is-array-buffer/package.json +1 -1
  53. package/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +39 -64
  54. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  55. package/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +1 -1
  56. package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +219 -277
  57. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  58. package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +327 -380
  59. package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.browser.js +1 -1
  60. package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +2 -2
  61. package/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js +1 -0
  62. package/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js +5 -1
  63. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  64. package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +89 -118
  65. package/node_modules/@smithy/middleware-serde/package.json +3 -3
  66. package/node_modules/@smithy/middleware-stack/dist-cjs/index.js +274 -297
  67. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  68. package/node_modules/@smithy/node-config-provider/dist-cjs/index.js +51 -98
  69. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  70. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +663 -771
  71. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +5 -3
  72. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -1
  73. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +1 -1
  74. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +4 -2
  75. package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +3 -1
  76. package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -4
  77. package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +3 -1
  78. package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
  79. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  80. package/node_modules/@smithy/property-provider/dist-cjs/index.js +105 -158
  81. package/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js +1 -1
  82. package/node_modules/@smithy/property-provider/dist-es/ProviderError.js +2 -1
  83. package/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js +1 -1
  84. package/node_modules/@smithy/property-provider/package.json +2 -2
  85. package/node_modules/@smithy/protocol-http/dist-cjs/index.js +154 -246
  86. package/node_modules/@smithy/protocol-http/dist-es/Field.js +3 -0
  87. package/node_modules/@smithy/protocol-http/dist-es/Fields.js +2 -1
  88. package/node_modules/@smithy/protocol-http/dist-es/httpRequest.js +11 -0
  89. package/node_modules/@smithy/protocol-http/dist-es/httpResponse.js +4 -0
  90. package/node_modules/@smithy/protocol-http/package.json +2 -2
  91. package/node_modules/@smithy/querystring-builder/dist-cjs/index.js +21 -47
  92. package/node_modules/@smithy/querystring-builder/package.json +3 -3
  93. package/node_modules/@smithy/querystring-parser/dist-cjs/index.js +22 -48
  94. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  95. package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +70 -103
  96. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  97. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +171 -210
  98. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +1 -1
  99. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  100. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +525 -648
  101. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +2 -1
  102. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +1 -1
  103. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +6 -0
  104. package/node_modules/@smithy/signature-v4/package.json +8 -8
  105. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +554 -747
  106. package/node_modules/@smithy/smithy-client/dist-es/client.js +4 -1
  107. package/node_modules/@smithy/smithy-client/dist-es/command.js +17 -18
  108. package/node_modules/@smithy/smithy-client/dist-es/exceptions.js +4 -0
  109. package/node_modules/@smithy/smithy-client/package.json +7 -7
  110. package/node_modules/@smithy/types/dist-cjs/index.js +80 -133
  111. package/node_modules/@smithy/types/package.json +1 -1
  112. package/node_modules/@smithy/url-parser/dist-cjs/index.js +20 -46
  113. package/node_modules/@smithy/url-parser/package.json +3 -3
  114. package/node_modules/@smithy/util-base64/dist-cjs/index.js +16 -24
  115. package/node_modules/@smithy/util-base64/package.json +3 -3
  116. package/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js +26 -50
  117. package/node_modules/@smithy/util-body-length-browser/package.json +1 -1
  118. package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +27 -50
  119. package/node_modules/@smithy/util-body-length-node/package.json +1 -1
  120. package/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +17 -44
  121. package/node_modules/@smithy/util-buffer-from/package.json +2 -2
  122. package/node_modules/@smithy/util-config-provider/dist-cjs/index.js +26 -56
  123. package/node_modules/@smithy/util-config-provider/package.json +1 -1
  124. package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/index.js +9 -22
  125. package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +4 -5
  126. package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js +2 -2
  127. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  128. package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +65 -110
  129. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  130. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +445 -526
  131. package/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js +3 -2
  132. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  133. package/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +29 -58
  134. package/node_modules/@smithy/util-hex-encoding/package.json +1 -1
  135. package/node_modules/@smithy/util-middleware/dist-cjs/index.js +11 -40
  136. package/node_modules/@smithy/util-middleware/package.json +2 -2
  137. package/node_modules/@smithy/util-retry/dist-cjs/index.js +260 -340
  138. package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +4 -1
  139. package/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js +1 -0
  140. package/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js +17 -8
  141. package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +5 -3
  142. package/node_modules/@smithy/util-retry/package.json +3 -3
  143. package/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js +3 -2
  144. package/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +7 -3
  145. package/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +2 -3
  146. package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +1 -1
  147. package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +2 -3
  148. package/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +1 -2
  149. package/node_modules/@smithy/util-stream/dist-cjs/headStream.js +4 -8
  150. package/node_modules/@smithy/util-stream/dist-cjs/index.js +83 -93
  151. package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +1 -2
  152. package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +1 -2
  153. package/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +3 -7
  154. package/node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js +3 -2
  155. package/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js +5 -0
  156. package/node_modules/@smithy/util-stream/dist-es/headStream.js +3 -6
  157. package/node_modules/@smithy/util-stream/package.json +8 -8
  158. package/node_modules/@smithy/util-uri-escape/dist-cjs/index.js +6 -40
  159. package/node_modules/@smithy/util-uri-escape/package.json +1 -1
  160. package/node_modules/@smithy/util-utf8/dist-cjs/index.js +27 -60
  161. package/node_modules/@smithy/util-utf8/package.json +2 -2
  162. package/node_modules/@smithy/util-waiter/dist-cjs/index.js +152 -189
  163. package/node_modules/@smithy/util-waiter/package.json +3 -3
  164. package/node_modules/@smithy/uuid/dist-cjs/index.js +33 -42
  165. package/node_modules/@smithy/uuid/package.json +1 -1
  166. package/package.json +6 -6
  167. package/node_modules/@smithy/abort-controller/dist-cjs/AbortController.js +0 -1
  168. package/node_modules/@smithy/abort-controller/dist-cjs/AbortSignal.js +0 -1
  169. package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +0 -1
  170. package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +0 -1
  171. package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/index.js +0 -1
  172. package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js +0 -1
  173. package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js +0 -1
  174. package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js +0 -1
  175. package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/config.js +0 -1
  176. package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/getRealRegion.js +0 -1
  177. package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/index.js +0 -1
  178. package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/isFipsRegion.js +0 -1
  179. package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js +0 -1
  180. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariant.js +0 -1
  181. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js +0 -1
  182. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/PartitionHash.js +0 -1
  183. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/RegionHash.js +0 -1
  184. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js +0 -1
  185. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getRegionInfo.js +0 -1
  186. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js +0 -1
  187. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js +0 -1
  188. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js +0 -1
  189. package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/index.js +0 -1
  190. package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/Endpoint.js +0 -1
  191. package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js +0 -1
  192. package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointMode.js +0 -1
  193. package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js +0 -1
  194. package/node_modules/@smithy/credential-provider-imds/dist-cjs/error/InstanceMetadataV1FallbackError.js +0 -1
  195. package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromContainerMetadata.js +0 -1
  196. package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromInstanceMetadata.js +0 -1
  197. package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js +0 -1
  198. package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js +0 -1
  199. package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js +0 -1
  200. package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/index.js +0 -1
  201. package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/retry.js +0 -1
  202. package/node_modules/@smithy/credential-provider-imds/dist-cjs/types.js +0 -1
  203. package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js +0 -1
  204. package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js +0 -1
  205. package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js +0 -1
  206. package/node_modules/@smithy/fetch-http-handler/dist-cjs/create-request.js +0 -1
  207. package/node_modules/@smithy/fetch-http-handler/dist-cjs/fetch-http-handler.js +0 -1
  208. package/node_modules/@smithy/fetch-http-handler/dist-cjs/request-timeout.js +0 -1
  209. package/node_modules/@smithy/fetch-http-handler/dist-cjs/stream-collector.js +0 -1
  210. package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidFunction.js +0 -1
  211. package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidProvider.js +0 -1
  212. package/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js +0 -1
  213. package/node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js +0 -1
  214. package/node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js +0 -1
  215. package/node_modules/@smithy/middleware-stack/dist-cjs/MiddlewareStack.js +0 -1
  216. package/node_modules/@smithy/middleware-stack/dist-cjs/types.js +0 -1
  217. package/node_modules/@smithy/node-config-provider/dist-cjs/configLoader.js +0 -1
  218. package/node_modules/@smithy/node-config-provider/dist-cjs/fromEnv.js +0 -1
  219. package/node_modules/@smithy/node-config-provider/dist-cjs/fromSharedConfigFiles.js +0 -1
  220. package/node_modules/@smithy/node-config-provider/dist-cjs/fromStatic.js +0 -1
  221. package/node_modules/@smithy/node-config-provider/dist-cjs/getSelectorName.js +0 -1
  222. package/node_modules/@smithy/node-http-handler/dist-cjs/constants.js +0 -1
  223. package/node_modules/@smithy/node-http-handler/dist-cjs/get-transformed-headers.js +0 -1
  224. package/node_modules/@smithy/node-http-handler/dist-cjs/node-http-handler.js +0 -1
  225. package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-manager.js +0 -1
  226. package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-pool.js +0 -1
  227. package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js +0 -1
  228. package/node_modules/@smithy/node-http-handler/dist-cjs/readable.mock.js +0 -1
  229. package/node_modules/@smithy/node-http-handler/dist-cjs/server.mock.js +0 -1
  230. package/node_modules/@smithy/node-http-handler/dist-cjs/set-connection-timeout.js +0 -1
  231. package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-keep-alive.js +0 -1
  232. package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-timeout.js +0 -1
  233. package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/collector.js +0 -1
  234. package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/index.js +0 -1
  235. package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/readable.mock.js +0 -1
  236. package/node_modules/@smithy/node-http-handler/dist-cjs/timing.js +0 -1
  237. package/node_modules/@smithy/node-http-handler/dist-cjs/write-request-body.js +0 -1
  238. package/node_modules/@smithy/property-provider/dist-cjs/CredentialsProviderError.js +0 -1
  239. package/node_modules/@smithy/property-provider/dist-cjs/ProviderError.js +0 -1
  240. package/node_modules/@smithy/property-provider/dist-cjs/TokenProviderError.js +0 -1
  241. package/node_modules/@smithy/property-provider/dist-cjs/chain.js +0 -1
  242. package/node_modules/@smithy/property-provider/dist-cjs/fromStatic.js +0 -1
  243. package/node_modules/@smithy/property-provider/dist-cjs/memoize.js +0 -1
  244. package/node_modules/@smithy/protocol-http/dist-cjs/Field.js +0 -1
  245. package/node_modules/@smithy/protocol-http/dist-cjs/Fields.js +0 -1
  246. package/node_modules/@smithy/protocol-http/dist-cjs/extensions/httpExtensionConfiguration.js +0 -1
  247. package/node_modules/@smithy/protocol-http/dist-cjs/extensions/index.js +0 -1
  248. package/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js +0 -1
  249. package/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js +0 -1
  250. package/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js +0 -1
  251. package/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js +0 -1
  252. package/node_modules/@smithy/protocol-http/dist-cjs/types.js +0 -1
  253. package/node_modules/@smithy/service-error-classification/dist-cjs/constants.js +0 -1
  254. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/externalDataInterceptor.js +0 -1
  255. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigData.js +0 -1
  256. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigFilepath.js +0 -1
  257. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js +0 -1
  258. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getProfileName.js +0 -1
  259. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSsoSessionData.js +0 -1
  260. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js +0 -1
  261. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js +0 -1
  262. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/mergeConfigFiles.js +0 -1
  263. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseIni.js +0 -1
  264. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseKnownFiles.js +0 -1
  265. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js +0 -1
  266. package/node_modules/@smithy/signature-v4/dist-cjs/HeaderFormatter.js +0 -1
  267. package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4.js +0 -1
  268. package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4Base.js +0 -1
  269. package/node_modules/@smithy/signature-v4/dist-cjs/constants.js +0 -1
  270. package/node_modules/@smithy/signature-v4/dist-cjs/credentialDerivation.js +0 -1
  271. package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalHeaders.js +0 -1
  272. package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalQuery.js +0 -1
  273. package/node_modules/@smithy/signature-v4/dist-cjs/getPayloadHash.js +0 -1
  274. package/node_modules/@smithy/signature-v4/dist-cjs/headerUtil.js +0 -1
  275. package/node_modules/@smithy/signature-v4/dist-cjs/moveHeadersToQuery.js +0 -1
  276. package/node_modules/@smithy/signature-v4/dist-cjs/prepareRequest.js +0 -1
  277. package/node_modules/@smithy/signature-v4/dist-cjs/signature-v4a-container.js +0 -1
  278. package/node_modules/@smithy/signature-v4/dist-cjs/suite.fixture.js +0 -1
  279. package/node_modules/@smithy/signature-v4/dist-cjs/utilDate.js +0 -1
  280. package/node_modules/@smithy/types/dist-cjs/abort-handler.js +0 -1
  281. package/node_modules/@smithy/types/dist-cjs/abort.js +0 -1
  282. package/node_modules/@smithy/types/dist-cjs/auth/HttpApiKeyAuth.js +0 -1
  283. package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthScheme.js +0 -1
  284. package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthSchemeProvider.js +0 -1
  285. package/node_modules/@smithy/types/dist-cjs/auth/HttpSigner.js +0 -1
  286. package/node_modules/@smithy/types/dist-cjs/auth/IdentityProviderConfig.js +0 -1
  287. package/node_modules/@smithy/types/dist-cjs/auth/auth.js +0 -1
  288. package/node_modules/@smithy/types/dist-cjs/auth/index.js +0 -1
  289. package/node_modules/@smithy/types/dist-cjs/blob/blob-payload-input-types.js +0 -1
  290. package/node_modules/@smithy/types/dist-cjs/checksum.js +0 -1
  291. package/node_modules/@smithy/types/dist-cjs/client.js +0 -1
  292. package/node_modules/@smithy/types/dist-cjs/command.js +0 -1
  293. package/node_modules/@smithy/types/dist-cjs/connection/config.js +0 -1
  294. package/node_modules/@smithy/types/dist-cjs/connection/index.js +0 -1
  295. package/node_modules/@smithy/types/dist-cjs/connection/manager.js +0 -1
  296. package/node_modules/@smithy/types/dist-cjs/connection/pool.js +0 -1
  297. package/node_modules/@smithy/types/dist-cjs/crypto.js +0 -1
  298. package/node_modules/@smithy/types/dist-cjs/downlevel-ts3.4/transform/type-transform.js +0 -1
  299. package/node_modules/@smithy/types/dist-cjs/encode.js +0 -1
  300. package/node_modules/@smithy/types/dist-cjs/endpoint.js +0 -1
  301. package/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js +0 -1
  302. package/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js +0 -1
  303. package/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js +0 -1
  304. package/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js +0 -1
  305. package/node_modules/@smithy/types/dist-cjs/endpoints/index.js +0 -1
  306. package/node_modules/@smithy/types/dist-cjs/endpoints/shared.js +0 -1
  307. package/node_modules/@smithy/types/dist-cjs/eventStream.js +0 -1
  308. package/node_modules/@smithy/types/dist-cjs/extensions/checksum.js +0 -1
  309. package/node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +0 -1
  310. package/node_modules/@smithy/types/dist-cjs/extensions/defaultExtensionConfiguration.js +0 -1
  311. package/node_modules/@smithy/types/dist-cjs/extensions/index.js +0 -1
  312. package/node_modules/@smithy/types/dist-cjs/extensions/retry.js +0 -1
  313. package/node_modules/@smithy/types/dist-cjs/externals-check/browser-externals-check.js +0 -1
  314. package/node_modules/@smithy/types/dist-cjs/feature-ids.js +0 -1
  315. package/node_modules/@smithy/types/dist-cjs/http/httpHandlerInitialization.js +0 -1
  316. package/node_modules/@smithy/types/dist-cjs/http.js +0 -1
  317. package/node_modules/@smithy/types/dist-cjs/identity/apiKeyIdentity.js +0 -1
  318. package/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js +0 -1
  319. package/node_modules/@smithy/types/dist-cjs/identity/identity.js +0 -1
  320. package/node_modules/@smithy/types/dist-cjs/identity/index.js +0 -1
  321. package/node_modules/@smithy/types/dist-cjs/identity/tokenIdentity.js +0 -1
  322. package/node_modules/@smithy/types/dist-cjs/logger.js +0 -1
  323. package/node_modules/@smithy/types/dist-cjs/middleware.js +0 -1
  324. package/node_modules/@smithy/types/dist-cjs/pagination.js +0 -1
  325. package/node_modules/@smithy/types/dist-cjs/profile.js +0 -1
  326. package/node_modules/@smithy/types/dist-cjs/response.js +0 -1
  327. package/node_modules/@smithy/types/dist-cjs/retry.js +0 -1
  328. package/node_modules/@smithy/types/dist-cjs/schema/schema.js +0 -1
  329. package/node_modules/@smithy/types/dist-cjs/schema/sentinels.js +0 -1
  330. package/node_modules/@smithy/types/dist-cjs/schema/traits.js +0 -1
  331. package/node_modules/@smithy/types/dist-cjs/serde.js +0 -1
  332. package/node_modules/@smithy/types/dist-cjs/shapes.js +0 -1
  333. package/node_modules/@smithy/types/dist-cjs/signature.js +0 -1
  334. package/node_modules/@smithy/types/dist-cjs/stream.js +0 -1
  335. package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-common-types.js +0 -1
  336. package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-input-types.js +0 -1
  337. package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-output-types.js +0 -1
  338. package/node_modules/@smithy/types/dist-cjs/transfer.js +0 -1
  339. package/node_modules/@smithy/types/dist-cjs/transform/client-method-transforms.js +0 -1
  340. package/node_modules/@smithy/types/dist-cjs/transform/client-payload-blob-type-narrow.js +0 -1
  341. package/node_modules/@smithy/types/dist-cjs/transform/exact.js +0 -1
  342. package/node_modules/@smithy/types/dist-cjs/transform/mutable.js +0 -1
  343. package/node_modules/@smithy/types/dist-cjs/transform/no-undefined.js +0 -1
  344. package/node_modules/@smithy/types/dist-cjs/transform/type-transform.js +0 -1
  345. package/node_modules/@smithy/types/dist-cjs/uri.js +0 -1
  346. package/node_modules/@smithy/types/dist-cjs/util.js +0 -1
  347. package/node_modules/@smithy/types/dist-cjs/waiter.js +0 -1
  348. package/node_modules/@smithy/util-body-length-browser/dist-cjs/calculateBodyLength.js +0 -1
  349. package/node_modules/@smithy/util-body-length-node/dist-cjs/calculateBodyLength.js +0 -1
  350. package/node_modules/@smithy/util-config-provider/dist-cjs/booleanSelector.js +0 -1
  351. package/node_modules/@smithy/util-config-provider/dist-cjs/numberSelector.js +0 -1
  352. package/node_modules/@smithy/util-config-provider/dist-cjs/types.js +0 -1
  353. package/node_modules/@smithy/util-endpoints/dist-cjs/cache/EndpointCache.js +0 -1
  354. package/node_modules/@smithy/util-endpoints/dist-cjs/debug/debugId.js +0 -1
  355. package/node_modules/@smithy/util-endpoints/dist-cjs/debug/index.js +0 -1
  356. package/node_modules/@smithy/util-endpoints/dist-cjs/debug/toDebugString.js +0 -1
  357. package/node_modules/@smithy/util-endpoints/dist-cjs/getEndpointUrlConfig.js +0 -1
  358. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/booleanEquals.js +0 -1
  359. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttr.js +0 -1
  360. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttrPathList.js +0 -1
  361. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/index.js +0 -1
  362. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isIpAddress.js +0 -1
  363. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isSet.js +0 -1
  364. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isValidHostLabel.js +0 -1
  365. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/not.js +0 -1
  366. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/parseURL.js +0 -1
  367. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/stringEquals.js +0 -1
  368. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/substring.js +0 -1
  369. package/node_modules/@smithy/util-endpoints/dist-cjs/lib/uriEncode.js +0 -1
  370. package/node_modules/@smithy/util-endpoints/dist-cjs/resolveEndpoint.js +0 -1
  371. package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointError.js +0 -1
  372. package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointFunctions.js +0 -1
  373. package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointRuleObject.js +0 -1
  374. package/node_modules/@smithy/util-endpoints/dist-cjs/types/ErrorRuleObject.js +0 -1
  375. package/node_modules/@smithy/util-endpoints/dist-cjs/types/RuleSetObject.js +0 -1
  376. package/node_modules/@smithy/util-endpoints/dist-cjs/types/TreeRuleObject.js +0 -1
  377. package/node_modules/@smithy/util-endpoints/dist-cjs/types/index.js +0 -1
  378. package/node_modules/@smithy/util-endpoints/dist-cjs/types/shared.js +0 -1
  379. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/callFunction.js +0 -1
  380. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/customEndpointFunctions.js +0 -1
  381. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/endpointFunctions.js +0 -1
  382. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateCondition.js +0 -1
  383. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateConditions.js +0 -1
  384. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js +0 -1
  385. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateErrorRule.js +0 -1
  386. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateExpression.js +0 -1
  387. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateRules.js +0 -1
  388. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTemplate.js +0 -1
  389. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTreeRule.js +0 -1
  390. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointHeaders.js +0 -1
  391. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperties.js +0 -1
  392. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperty.js +0 -1
  393. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointUrl.js +0 -1
  394. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getReferenceValue.js +0 -1
  395. package/node_modules/@smithy/util-endpoints/dist-cjs/utils/index.js +0 -1
  396. package/node_modules/@smithy/util-middleware/dist-cjs/getSmithyContext.js +0 -1
  397. package/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js +0 -1
  398. package/node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js +0 -1
  399. package/node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js +0 -1
  400. package/node_modules/@smithy/util-retry/dist-cjs/DefaultRateLimiter.js +0 -1
  401. package/node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js +0 -1
  402. package/node_modules/@smithy/util-retry/dist-cjs/config.js +0 -1
  403. package/node_modules/@smithy/util-retry/dist-cjs/constants.js +0 -1
  404. package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryBackoffStrategy.js +0 -1
  405. package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryToken.js +0 -1
  406. package/node_modules/@smithy/util-retry/dist-cjs/types.js +0 -1
  407. package/node_modules/@smithy/util-stream/dist-cjs/blob/Uint8ArrayBlobAdapter.js +0 -1
  408. package/node_modules/@smithy/util-stream/dist-cjs/blob/transforms.js +0 -1
  409. package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri-path.js +0 -1
  410. package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri.js +0 -1
  411. package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.browser.js +0 -1
  412. package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.js +0 -1
  413. package/node_modules/@smithy/util-utf8/dist-cjs/toUint8Array.js +0 -1
  414. package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.browser.js +0 -1
  415. package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.js +0 -1
  416. package/node_modules/@smithy/util-waiter/dist-cjs/createWaiter.js +0 -1
  417. package/node_modules/@smithy/util-waiter/dist-cjs/poller.js +0 -1
  418. package/node_modules/@smithy/util-waiter/dist-cjs/utils/index.js +0 -1
  419. package/node_modules/@smithy/util-waiter/dist-cjs/utils/sleep.js +0 -1
  420. package/node_modules/@smithy/util-waiter/dist-cjs/utils/validate.js +0 -1
  421. package/node_modules/@smithy/util-waiter/dist-cjs/waiter.js +0 -1
  422. package/node_modules/@smithy/uuid/dist-cjs/randomUUID.browser.js +0 -1
  423. package/node_modules/@smithy/uuid/dist-cjs/v4.js +0 -1
@@ -1,1072 +1,1060 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/submodules/cbor/index.ts
20
- var index_exports = {};
21
- __export(index_exports, {
22
- CborCodec: () => CborCodec,
23
- CborShapeDeserializer: () => CborShapeDeserializer,
24
- CborShapeSerializer: () => CborShapeSerializer,
25
- SmithyRpcV2CborProtocol: () => SmithyRpcV2CborProtocol,
26
- buildHttpRpcRequest: () => buildHttpRpcRequest,
27
- cbor: () => cbor,
28
- checkCborResponse: () => checkCborResponse,
29
- dateToTag: () => dateToTag,
30
- loadSmithyRpcV2CborErrorCode: () => loadSmithyRpcV2CborErrorCode,
31
- parseCborBody: () => parseCborBody,
32
- parseCborErrorBody: () => parseCborErrorBody,
33
- tag: () => tag,
34
- tagSymbol: () => tagSymbol
35
- });
36
- module.exports = __toCommonJS(index_exports);
1
+ 'use strict';
37
2
 
38
- // src/submodules/cbor/cbor-decode.ts
39
- var import_serde = require("@smithy/core/serde");
40
- var import_util_utf8 = require("@smithy/util-utf8");
3
+ var serde = require('@smithy/core/serde');
4
+ var utilUtf8 = require('@smithy/util-utf8');
5
+ var protocols = require('@smithy/core/protocols');
6
+ var protocolHttp = require('@smithy/protocol-http');
7
+ var utilBodyLengthBrowser = require('@smithy/util-body-length-browser');
8
+ var schema = require('@smithy/core/schema');
9
+ var utilMiddleware = require('@smithy/util-middleware');
10
+ var utilBase64 = require('@smithy/util-base64');
41
11
 
42
- // src/submodules/cbor/cbor-types.ts
43
- var majorUint64 = 0;
44
- var majorNegativeInt64 = 1;
45
- var majorUnstructuredByteString = 2;
46
- var majorUtf8String = 3;
47
- var majorList = 4;
48
- var majorMap = 5;
49
- var majorTag = 6;
50
- var majorSpecial = 7;
51
- var specialFalse = 20;
52
- var specialTrue = 21;
53
- var specialNull = 22;
54
- var specialUndefined = 23;
55
- var extendedOneByte = 24;
56
- var extendedFloat16 = 25;
57
- var extendedFloat32 = 26;
58
- var extendedFloat64 = 27;
59
- var minorIndefinite = 31;
12
+ const majorUint64 = 0;
13
+ const majorNegativeInt64 = 1;
14
+ const majorUnstructuredByteString = 2;
15
+ const majorUtf8String = 3;
16
+ const majorList = 4;
17
+ const majorMap = 5;
18
+ const majorTag = 6;
19
+ const majorSpecial = 7;
20
+ const specialFalse = 20;
21
+ const specialTrue = 21;
22
+ const specialNull = 22;
23
+ const specialUndefined = 23;
24
+ const extendedOneByte = 24;
25
+ const extendedFloat16 = 25;
26
+ const extendedFloat32 = 26;
27
+ const extendedFloat64 = 27;
28
+ const minorIndefinite = 31;
60
29
  function alloc(size) {
61
- return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size);
30
+ return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size);
62
31
  }
63
- var tagSymbol = Symbol("@smithy/core/cbor::tagSymbol");
64
- function tag(data2) {
65
- data2[tagSymbol] = true;
66
- return data2;
32
+ const tagSymbol = Symbol("@smithy/core/cbor::tagSymbol");
33
+ function tag(data) {
34
+ data[tagSymbol] = true;
35
+ return data;
67
36
  }
68
37
 
69
- // src/submodules/cbor/cbor-decode.ts
70
- var USE_TEXT_DECODER = typeof TextDecoder !== "undefined";
71
- var USE_BUFFER = typeof Buffer !== "undefined";
72
- var payload = alloc(0);
73
- var dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
74
- var textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null;
75
- var _offset = 0;
38
+ const USE_TEXT_DECODER = typeof TextDecoder !== "undefined";
39
+ const USE_BUFFER$1 = typeof Buffer !== "undefined";
40
+ let payload = alloc(0);
41
+ let dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
42
+ const textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null;
43
+ let _offset = 0;
76
44
  function setPayload(bytes) {
77
- payload = bytes;
78
- dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
45
+ payload = bytes;
46
+ dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
79
47
  }
80
48
  function decode(at, to) {
81
- if (at >= to) {
82
- throw new Error("unexpected end of (decode) payload.");
83
- }
84
- const major = (payload[at] & 224) >> 5;
85
- const minor = payload[at] & 31;
86
- switch (major) {
87
- case majorUint64:
88
- case majorNegativeInt64:
89
- case majorTag:
90
- let unsignedInt;
91
- let offset;
92
- if (minor < 24) {
93
- unsignedInt = minor;
94
- offset = 1;
95
- } else {
96
- switch (minor) {
97
- case extendedOneByte:
98
- case extendedFloat16:
99
- case extendedFloat32:
100
- case extendedFloat64:
101
- const countLength = minorValueToArgumentLength[minor];
102
- const countOffset = countLength + 1;
103
- offset = countOffset;
104
- if (to - at < countOffset) {
105
- throw new Error(`countLength ${countLength} greater than remaining buf len.`);
49
+ if (at >= to) {
50
+ throw new Error("unexpected end of (decode) payload.");
51
+ }
52
+ const major = (payload[at] & 0b1110_0000) >> 5;
53
+ const minor = payload[at] & 0b0001_1111;
54
+ switch (major) {
55
+ case majorUint64:
56
+ case majorNegativeInt64:
57
+ case majorTag:
58
+ let unsignedInt;
59
+ let offset;
60
+ if (minor < 24) {
61
+ unsignedInt = minor;
62
+ offset = 1;
106
63
  }
107
- const countIndex = at + 1;
108
- if (countLength === 1) {
109
- unsignedInt = payload[countIndex];
110
- } else if (countLength === 2) {
111
- unsignedInt = dataView.getUint16(countIndex);
112
- } else if (countLength === 4) {
113
- unsignedInt = dataView.getUint32(countIndex);
114
- } else {
115
- unsignedInt = dataView.getBigUint64(countIndex);
64
+ else {
65
+ switch (minor) {
66
+ case extendedOneByte:
67
+ case extendedFloat16:
68
+ case extendedFloat32:
69
+ case extendedFloat64:
70
+ const countLength = minorValueToArgumentLength[minor];
71
+ const countOffset = (countLength + 1);
72
+ offset = countOffset;
73
+ if (to - at < countOffset) {
74
+ throw new Error(`countLength ${countLength} greater than remaining buf len.`);
75
+ }
76
+ const countIndex = at + 1;
77
+ if (countLength === 1) {
78
+ unsignedInt = payload[countIndex];
79
+ }
80
+ else if (countLength === 2) {
81
+ unsignedInt = dataView$1.getUint16(countIndex);
82
+ }
83
+ else if (countLength === 4) {
84
+ unsignedInt = dataView$1.getUint32(countIndex);
85
+ }
86
+ else {
87
+ unsignedInt = dataView$1.getBigUint64(countIndex);
88
+ }
89
+ break;
90
+ default:
91
+ throw new Error(`unexpected minor value ${minor}.`);
92
+ }
116
93
  }
117
- break;
118
- default:
119
- throw new Error(`unexpected minor value ${minor}.`);
120
- }
121
- }
122
- if (major === majorUint64) {
123
- _offset = offset;
124
- return castBigInt(unsignedInt);
125
- } else if (major === majorNegativeInt64) {
126
- let negativeInt;
127
- if (typeof unsignedInt === "bigint") {
128
- negativeInt = BigInt(-1) - unsignedInt;
129
- } else {
130
- negativeInt = -1 - unsignedInt;
131
- }
132
- _offset = offset;
133
- return castBigInt(negativeInt);
134
- } else {
135
- if (minor === 2 || minor === 3) {
136
- const length = decodeCount(at + offset, to);
137
- let b = BigInt(0);
138
- const start = at + offset + _offset;
139
- for (let i = start; i < start + length; ++i) {
140
- b = b << BigInt(8) | BigInt(payload[i]);
141
- }
142
- _offset = offset + _offset + length;
143
- return minor === 3 ? -b - BigInt(1) : b;
144
- } else if (minor === 4) {
145
- const decimalFraction = decode(at + offset, to);
146
- const [exponent, mantissa] = decimalFraction;
147
- const normalizer = mantissa < 0 ? -1 : 1;
148
- const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
149
- let numericString;
150
- const sign = mantissa < 0 ? "-" : "";
151
- numericString = exponent === 0 ? mantissaStr : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
152
- numericString = numericString.replace(/^0+/g, "");
153
- if (numericString === "") {
154
- numericString = "0";
155
- }
156
- if (numericString[0] === ".") {
157
- numericString = "0" + numericString;
158
- }
159
- numericString = sign + numericString;
160
- _offset = offset + _offset;
161
- return (0, import_serde.nv)(numericString);
162
- } else {
163
- const value = decode(at + offset, to);
164
- const valueOffset = _offset;
165
- _offset = offset + valueOffset;
166
- return tag({ tag: castBigInt(unsignedInt), value });
167
- }
168
- }
169
- case majorUtf8String:
170
- case majorMap:
171
- case majorList:
172
- case majorUnstructuredByteString:
173
- if (minor === minorIndefinite) {
174
- switch (major) {
175
- case majorUtf8String:
176
- return decodeUtf8StringIndefinite(at, to);
177
- case majorMap:
178
- return decodeMapIndefinite(at, to);
179
- case majorList:
180
- return decodeListIndefinite(at, to);
181
- case majorUnstructuredByteString:
182
- return decodeUnstructuredByteStringIndefinite(at, to);
183
- }
184
- } else {
185
- switch (major) {
186
- case majorUtf8String:
187
- return decodeUtf8String(at, to);
188
- case majorMap:
189
- return decodeMap(at, to);
190
- case majorList:
191
- return decodeList(at, to);
192
- case majorUnstructuredByteString:
193
- return decodeUnstructuredByteString(at, to);
194
- }
195
- }
196
- default:
197
- return decodeSpecial(at, to);
198
- }
94
+ if (major === majorUint64) {
95
+ _offset = offset;
96
+ return castBigInt(unsignedInt);
97
+ }
98
+ else if (major === majorNegativeInt64) {
99
+ let negativeInt;
100
+ if (typeof unsignedInt === "bigint") {
101
+ negativeInt = BigInt(-1) - unsignedInt;
102
+ }
103
+ else {
104
+ negativeInt = -1 - unsignedInt;
105
+ }
106
+ _offset = offset;
107
+ return castBigInt(negativeInt);
108
+ }
109
+ else {
110
+ if (minor === 2 || minor === 3) {
111
+ const length = decodeCount(at + offset, to);
112
+ let b = BigInt(0);
113
+ const start = at + offset + _offset;
114
+ for (let i = start; i < start + length; ++i) {
115
+ b = (b << BigInt(8)) | BigInt(payload[i]);
116
+ }
117
+ _offset = offset + _offset + length;
118
+ return minor === 3 ? -b - BigInt(1) : b;
119
+ }
120
+ else if (minor === 4) {
121
+ const decimalFraction = decode(at + offset, to);
122
+ const [exponent, mantissa] = decimalFraction;
123
+ const normalizer = mantissa < 0 ? -1 : 1;
124
+ const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
125
+ let numericString;
126
+ const sign = mantissa < 0 ? "-" : "";
127
+ numericString =
128
+ exponent === 0
129
+ ? mantissaStr
130
+ : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
131
+ numericString = numericString.replace(/^0+/g, "");
132
+ if (numericString === "") {
133
+ numericString = "0";
134
+ }
135
+ if (numericString[0] === ".") {
136
+ numericString = "0" + numericString;
137
+ }
138
+ numericString = sign + numericString;
139
+ _offset = offset + _offset;
140
+ return serde.nv(numericString);
141
+ }
142
+ else {
143
+ const value = decode(at + offset, to);
144
+ const valueOffset = _offset;
145
+ _offset = offset + valueOffset;
146
+ return tag({ tag: castBigInt(unsignedInt), value });
147
+ }
148
+ }
149
+ case majorUtf8String:
150
+ case majorMap:
151
+ case majorList:
152
+ case majorUnstructuredByteString:
153
+ if (minor === minorIndefinite) {
154
+ switch (major) {
155
+ case majorUtf8String:
156
+ return decodeUtf8StringIndefinite(at, to);
157
+ case majorMap:
158
+ return decodeMapIndefinite(at, to);
159
+ case majorList:
160
+ return decodeListIndefinite(at, to);
161
+ case majorUnstructuredByteString:
162
+ return decodeUnstructuredByteStringIndefinite(at, to);
163
+ }
164
+ }
165
+ else {
166
+ switch (major) {
167
+ case majorUtf8String:
168
+ return decodeUtf8String(at, to);
169
+ case majorMap:
170
+ return decodeMap(at, to);
171
+ case majorList:
172
+ return decodeList(at, to);
173
+ case majorUnstructuredByteString:
174
+ return decodeUnstructuredByteString(at, to);
175
+ }
176
+ }
177
+ default:
178
+ return decodeSpecial(at, to);
179
+ }
199
180
  }
200
181
  function bytesToUtf8(bytes, at, to) {
201
- if (USE_BUFFER && bytes.constructor?.name === "Buffer") {
202
- return bytes.toString("utf-8", at, to);
203
- }
204
- if (textDecoder) {
205
- return textDecoder.decode(bytes.subarray(at, to));
206
- }
207
- return (0, import_util_utf8.toUtf8)(bytes.subarray(at, to));
182
+ if (USE_BUFFER$1 && bytes.constructor?.name === "Buffer") {
183
+ return bytes.toString("utf-8", at, to);
184
+ }
185
+ if (textDecoder) {
186
+ return textDecoder.decode(bytes.subarray(at, to));
187
+ }
188
+ return utilUtf8.toUtf8(bytes.subarray(at, to));
208
189
  }
209
190
  function demote(bigInteger) {
210
- const num = Number(bigInteger);
211
- if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) {
212
- console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`));
213
- }
214
- return num;
191
+ const num = Number(bigInteger);
192
+ if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) {
193
+ console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`));
194
+ }
195
+ return num;
215
196
  }
216
- var minorValueToArgumentLength = {
217
- [extendedOneByte]: 1,
218
- [extendedFloat16]: 2,
219
- [extendedFloat32]: 4,
220
- [extendedFloat64]: 8
197
+ const minorValueToArgumentLength = {
198
+ [extendedOneByte]: 1,
199
+ [extendedFloat16]: 2,
200
+ [extendedFloat32]: 4,
201
+ [extendedFloat64]: 8,
221
202
  };
222
203
  function bytesToFloat16(a, b) {
223
- const sign = a >> 7;
224
- const exponent = (a & 124) >> 2;
225
- const fraction = (a & 3) << 8 | b;
226
- const scalar = sign === 0 ? 1 : -1;
227
- let exponentComponent;
228
- let summation;
229
- if (exponent === 0) {
230
- if (fraction === 0) {
231
- return 0;
232
- } else {
233
- exponentComponent = Math.pow(2, 1 - 15);
234
- summation = 0;
204
+ const sign = a >> 7;
205
+ const exponent = (a & 0b0111_1100) >> 2;
206
+ const fraction = ((a & 0b0000_0011) << 8) | b;
207
+ const scalar = sign === 0 ? 1 : -1;
208
+ let exponentComponent;
209
+ let summation;
210
+ if (exponent === 0b00000) {
211
+ if (fraction === 0b00000_00000) {
212
+ return 0;
213
+ }
214
+ else {
215
+ exponentComponent = Math.pow(2, 1 - 15);
216
+ summation = 0;
217
+ }
218
+ }
219
+ else if (exponent === 0b11111) {
220
+ if (fraction === 0b00000_00000) {
221
+ return scalar * Infinity;
222
+ }
223
+ else {
224
+ return NaN;
225
+ }
235
226
  }
236
- } else if (exponent === 31) {
237
- if (fraction === 0) {
238
- return scalar * Infinity;
239
- } else {
240
- return NaN;
227
+ else {
228
+ exponentComponent = Math.pow(2, exponent - 15);
229
+ summation = 1;
241
230
  }
242
- } else {
243
- exponentComponent = Math.pow(2, exponent - 15);
244
- summation = 1;
245
- }
246
- summation += fraction / 1024;
247
- return scalar * (exponentComponent * summation);
231
+ summation += fraction / 1024;
232
+ return scalar * (exponentComponent * summation);
248
233
  }
249
234
  function decodeCount(at, to) {
250
- const minor = payload[at] & 31;
251
- if (minor < 24) {
252
- _offset = 1;
253
- return minor;
254
- }
255
- if (minor === extendedOneByte || minor === extendedFloat16 || minor === extendedFloat32 || minor === extendedFloat64) {
256
- const countLength = minorValueToArgumentLength[minor];
257
- _offset = countLength + 1;
258
- if (to - at < _offset) {
259
- throw new Error(`countLength ${countLength} greater than remaining buf len.`);
235
+ const minor = payload[at] & 0b0001_1111;
236
+ if (minor < 24) {
237
+ _offset = 1;
238
+ return minor;
260
239
  }
261
- const countIndex = at + 1;
262
- if (countLength === 1) {
263
- return payload[countIndex];
264
- } else if (countLength === 2) {
265
- return dataView.getUint16(countIndex);
266
- } else if (countLength === 4) {
267
- return dataView.getUint32(countIndex);
240
+ if (minor === extendedOneByte ||
241
+ minor === extendedFloat16 ||
242
+ minor === extendedFloat32 ||
243
+ minor === extendedFloat64) {
244
+ const countLength = minorValueToArgumentLength[minor];
245
+ _offset = (countLength + 1);
246
+ if (to - at < _offset) {
247
+ throw new Error(`countLength ${countLength} greater than remaining buf len.`);
248
+ }
249
+ const countIndex = at + 1;
250
+ if (countLength === 1) {
251
+ return payload[countIndex];
252
+ }
253
+ else if (countLength === 2) {
254
+ return dataView$1.getUint16(countIndex);
255
+ }
256
+ else if (countLength === 4) {
257
+ return dataView$1.getUint32(countIndex);
258
+ }
259
+ return demote(dataView$1.getBigUint64(countIndex));
268
260
  }
269
- return demote(dataView.getBigUint64(countIndex));
270
- }
271
- throw new Error(`unexpected minor value ${minor}.`);
261
+ throw new Error(`unexpected minor value ${minor}.`);
272
262
  }
273
263
  function decodeUtf8String(at, to) {
274
- const length = decodeCount(at, to);
275
- const offset = _offset;
276
- at += offset;
277
- if (to - at < length) {
278
- throw new Error(`string len ${length} greater than remaining buf len.`);
279
- }
280
- const value = bytesToUtf8(payload, at, at + length);
281
- _offset = offset + length;
282
- return value;
264
+ const length = decodeCount(at, to);
265
+ const offset = _offset;
266
+ at += offset;
267
+ if (to - at < length) {
268
+ throw new Error(`string len ${length} greater than remaining buf len.`);
269
+ }
270
+ const value = bytesToUtf8(payload, at, at + length);
271
+ _offset = offset + length;
272
+ return value;
283
273
  }
284
274
  function decodeUtf8StringIndefinite(at, to) {
285
- at += 1;
286
- const vector = [];
287
- for (const base = at; at < to; ) {
288
- if (payload[at] === 255) {
289
- const data2 = alloc(vector.length);
290
- data2.set(vector, 0);
291
- _offset = at - base + 2;
292
- return bytesToUtf8(data2, 0, data2.length);
293
- }
294
- const major = (payload[at] & 224) >> 5;
295
- const minor = payload[at] & 31;
296
- if (major !== majorUtf8String) {
297
- throw new Error(`unexpected major type ${major} in indefinite string.`);
298
- }
299
- if (minor === minorIndefinite) {
300
- throw new Error("nested indefinite string.");
301
- }
302
- const bytes = decodeUnstructuredByteString(at, to);
303
- const length = _offset;
304
- at += length;
305
- for (let i = 0; i < bytes.length; ++i) {
306
- vector.push(bytes[i]);
275
+ at += 1;
276
+ const vector = [];
277
+ for (const base = at; at < to;) {
278
+ if (payload[at] === 0b1111_1111) {
279
+ const data = alloc(vector.length);
280
+ data.set(vector, 0);
281
+ _offset = at - base + 2;
282
+ return bytesToUtf8(data, 0, data.length);
283
+ }
284
+ const major = (payload[at] & 0b1110_0000) >> 5;
285
+ const minor = payload[at] & 0b0001_1111;
286
+ if (major !== majorUtf8String) {
287
+ throw new Error(`unexpected major type ${major} in indefinite string.`);
288
+ }
289
+ if (minor === minorIndefinite) {
290
+ throw new Error("nested indefinite string.");
291
+ }
292
+ const bytes = decodeUnstructuredByteString(at, to);
293
+ const length = _offset;
294
+ at += length;
295
+ for (let i = 0; i < bytes.length; ++i) {
296
+ vector.push(bytes[i]);
297
+ }
307
298
  }
308
- }
309
- throw new Error("expected break marker.");
299
+ throw new Error("expected break marker.");
310
300
  }
311
301
  function decodeUnstructuredByteString(at, to) {
312
- const length = decodeCount(at, to);
313
- const offset = _offset;
314
- at += offset;
315
- if (to - at < length) {
316
- throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`);
317
- }
318
- const value = payload.subarray(at, at + length);
319
- _offset = offset + length;
320
- return value;
302
+ const length = decodeCount(at, to);
303
+ const offset = _offset;
304
+ at += offset;
305
+ if (to - at < length) {
306
+ throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`);
307
+ }
308
+ const value = payload.subarray(at, at + length);
309
+ _offset = offset + length;
310
+ return value;
321
311
  }
322
312
  function decodeUnstructuredByteStringIndefinite(at, to) {
323
- at += 1;
324
- const vector = [];
325
- for (const base = at; at < to; ) {
326
- if (payload[at] === 255) {
327
- const data2 = alloc(vector.length);
328
- data2.set(vector, 0);
329
- _offset = at - base + 2;
330
- return data2;
331
- }
332
- const major = (payload[at] & 224) >> 5;
333
- const minor = payload[at] & 31;
334
- if (major !== majorUnstructuredByteString) {
335
- throw new Error(`unexpected major type ${major} in indefinite string.`);
336
- }
337
- if (minor === minorIndefinite) {
338
- throw new Error("nested indefinite string.");
339
- }
340
- const bytes = decodeUnstructuredByteString(at, to);
341
- const length = _offset;
342
- at += length;
343
- for (let i = 0; i < bytes.length; ++i) {
344
- vector.push(bytes[i]);
313
+ at += 1;
314
+ const vector = [];
315
+ for (const base = at; at < to;) {
316
+ if (payload[at] === 0b1111_1111) {
317
+ const data = alloc(vector.length);
318
+ data.set(vector, 0);
319
+ _offset = at - base + 2;
320
+ return data;
321
+ }
322
+ const major = (payload[at] & 0b1110_0000) >> 5;
323
+ const minor = payload[at] & 0b0001_1111;
324
+ if (major !== majorUnstructuredByteString) {
325
+ throw new Error(`unexpected major type ${major} in indefinite string.`);
326
+ }
327
+ if (minor === minorIndefinite) {
328
+ throw new Error("nested indefinite string.");
329
+ }
330
+ const bytes = decodeUnstructuredByteString(at, to);
331
+ const length = _offset;
332
+ at += length;
333
+ for (let i = 0; i < bytes.length; ++i) {
334
+ vector.push(bytes[i]);
335
+ }
345
336
  }
346
- }
347
- throw new Error("expected break marker.");
337
+ throw new Error("expected break marker.");
348
338
  }
349
339
  function decodeList(at, to) {
350
- const listDataLength = decodeCount(at, to);
351
- const offset = _offset;
352
- at += offset;
353
- const base = at;
354
- const list = Array(listDataLength);
355
- for (let i = 0; i < listDataLength; ++i) {
356
- const item = decode(at, to);
357
- const itemOffset = _offset;
358
- list[i] = item;
359
- at += itemOffset;
360
- }
361
- _offset = offset + (at - base);
362
- return list;
340
+ const listDataLength = decodeCount(at, to);
341
+ const offset = _offset;
342
+ at += offset;
343
+ const base = at;
344
+ const list = Array(listDataLength);
345
+ for (let i = 0; i < listDataLength; ++i) {
346
+ const item = decode(at, to);
347
+ const itemOffset = _offset;
348
+ list[i] = item;
349
+ at += itemOffset;
350
+ }
351
+ _offset = offset + (at - base);
352
+ return list;
363
353
  }
364
354
  function decodeListIndefinite(at, to) {
365
- at += 1;
366
- const list = [];
367
- for (const base = at; at < to; ) {
368
- if (payload[at] === 255) {
369
- _offset = at - base + 2;
370
- return list;
355
+ at += 1;
356
+ const list = [];
357
+ for (const base = at; at < to;) {
358
+ if (payload[at] === 0b1111_1111) {
359
+ _offset = at - base + 2;
360
+ return list;
361
+ }
362
+ const item = decode(at, to);
363
+ const n = _offset;
364
+ at += n;
365
+ list.push(item);
371
366
  }
372
- const item = decode(at, to);
373
- const n = _offset;
374
- at += n;
375
- list.push(item);
376
- }
377
- throw new Error("expected break marker.");
367
+ throw new Error("expected break marker.");
378
368
  }
379
369
  function decodeMap(at, to) {
380
- const mapDataLength = decodeCount(at, to);
381
- const offset = _offset;
382
- at += offset;
383
- const base = at;
384
- const map = {};
385
- for (let i = 0; i < mapDataLength; ++i) {
386
- if (at >= to) {
387
- throw new Error("unexpected end of map payload.");
388
- }
389
- const major = (payload[at] & 224) >> 5;
390
- if (major !== majorUtf8String) {
391
- throw new Error(`unexpected major type ${major} for map key at index ${at}.`);
370
+ const mapDataLength = decodeCount(at, to);
371
+ const offset = _offset;
372
+ at += offset;
373
+ const base = at;
374
+ const map = {};
375
+ for (let i = 0; i < mapDataLength; ++i) {
376
+ if (at >= to) {
377
+ throw new Error("unexpected end of map payload.");
378
+ }
379
+ const major = (payload[at] & 0b1110_0000) >> 5;
380
+ if (major !== majorUtf8String) {
381
+ throw new Error(`unexpected major type ${major} for map key at index ${at}.`);
382
+ }
383
+ const key = decode(at, to);
384
+ at += _offset;
385
+ const value = decode(at, to);
386
+ at += _offset;
387
+ map[key] = value;
392
388
  }
393
- const key = decode(at, to);
394
- at += _offset;
395
- const value = decode(at, to);
396
- at += _offset;
397
- map[key] = value;
398
- }
399
- _offset = offset + (at - base);
400
- return map;
389
+ _offset = offset + (at - base);
390
+ return map;
401
391
  }
402
392
  function decodeMapIndefinite(at, to) {
403
- at += 1;
404
- const base = at;
405
- const map = {};
406
- for (; at < to; ) {
407
- if (at >= to) {
408
- throw new Error("unexpected end of map payload.");
409
- }
410
- if (payload[at] === 255) {
411
- _offset = at - base + 2;
412
- return map;
413
- }
414
- const major = (payload[at] & 224) >> 5;
415
- if (major !== majorUtf8String) {
416
- throw new Error(`unexpected major type ${major} for map key.`);
393
+ at += 1;
394
+ const base = at;
395
+ const map = {};
396
+ for (; at < to;) {
397
+ if (at >= to) {
398
+ throw new Error("unexpected end of map payload.");
399
+ }
400
+ if (payload[at] === 0b1111_1111) {
401
+ _offset = at - base + 2;
402
+ return map;
403
+ }
404
+ const major = (payload[at] & 0b1110_0000) >> 5;
405
+ if (major !== majorUtf8String) {
406
+ throw new Error(`unexpected major type ${major} for map key.`);
407
+ }
408
+ const key = decode(at, to);
409
+ at += _offset;
410
+ const value = decode(at, to);
411
+ at += _offset;
412
+ map[key] = value;
417
413
  }
418
- const key = decode(at, to);
419
- at += _offset;
420
- const value = decode(at, to);
421
- at += _offset;
422
- map[key] = value;
423
- }
424
- throw new Error("expected break marker.");
414
+ throw new Error("expected break marker.");
425
415
  }
426
416
  function decodeSpecial(at, to) {
427
- const minor = payload[at] & 31;
428
- switch (minor) {
429
- case specialTrue:
430
- case specialFalse:
431
- _offset = 1;
432
- return minor === specialTrue;
433
- case specialNull:
434
- _offset = 1;
435
- return null;
436
- case specialUndefined:
437
- _offset = 1;
438
- return null;
439
- case extendedFloat16:
440
- if (to - at < 3) {
441
- throw new Error("incomplete float16 at end of buf.");
442
- }
443
- _offset = 3;
444
- return bytesToFloat16(payload[at + 1], payload[at + 2]);
445
- case extendedFloat32:
446
- if (to - at < 5) {
447
- throw new Error("incomplete float32 at end of buf.");
448
- }
449
- _offset = 5;
450
- return dataView.getFloat32(at + 1);
451
- case extendedFloat64:
452
- if (to - at < 9) {
453
- throw new Error("incomplete float64 at end of buf.");
454
- }
455
- _offset = 9;
456
- return dataView.getFloat64(at + 1);
457
- default:
458
- throw new Error(`unexpected minor value ${minor}.`);
459
- }
417
+ const minor = payload[at] & 0b0001_1111;
418
+ switch (minor) {
419
+ case specialTrue:
420
+ case specialFalse:
421
+ _offset = 1;
422
+ return minor === specialTrue;
423
+ case specialNull:
424
+ _offset = 1;
425
+ return null;
426
+ case specialUndefined:
427
+ _offset = 1;
428
+ return null;
429
+ case extendedFloat16:
430
+ if (to - at < 3) {
431
+ throw new Error("incomplete float16 at end of buf.");
432
+ }
433
+ _offset = 3;
434
+ return bytesToFloat16(payload[at + 1], payload[at + 2]);
435
+ case extendedFloat32:
436
+ if (to - at < 5) {
437
+ throw new Error("incomplete float32 at end of buf.");
438
+ }
439
+ _offset = 5;
440
+ return dataView$1.getFloat32(at + 1);
441
+ case extendedFloat64:
442
+ if (to - at < 9) {
443
+ throw new Error("incomplete float64 at end of buf.");
444
+ }
445
+ _offset = 9;
446
+ return dataView$1.getFloat64(at + 1);
447
+ default:
448
+ throw new Error(`unexpected minor value ${minor}.`);
449
+ }
460
450
  }
461
451
  function castBigInt(bigInt) {
462
- if (typeof bigInt === "number") {
452
+ if (typeof bigInt === "number") {
453
+ return bigInt;
454
+ }
455
+ const num = Number(bigInt);
456
+ if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {
457
+ return num;
458
+ }
463
459
  return bigInt;
464
- }
465
- const num = Number(bigInt);
466
- if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {
467
- return num;
468
- }
469
- return bigInt;
470
460
  }
471
461
 
472
- // src/submodules/cbor/cbor-encode.ts
473
- var import_serde2 = require("@smithy/core/serde");
474
- var import_util_utf82 = require("@smithy/util-utf8");
475
- var USE_BUFFER2 = typeof Buffer !== "undefined";
476
- var initialSize = 2048;
477
- var data = alloc(initialSize);
478
- var dataView2 = new DataView(data.buffer, data.byteOffset, data.byteLength);
479
- var cursor = 0;
462
+ const USE_BUFFER = typeof Buffer !== "undefined";
463
+ const initialSize = 2048;
464
+ let data = alloc(initialSize);
465
+ let dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
466
+ let cursor = 0;
480
467
  function ensureSpace(bytes) {
481
- const remaining = data.byteLength - cursor;
482
- if (remaining < bytes) {
483
- if (cursor < 16e6) {
484
- resize(Math.max(data.byteLength * 4, data.byteLength + bytes));
485
- } else {
486
- resize(data.byteLength + bytes + 16e6);
468
+ const remaining = data.byteLength - cursor;
469
+ if (remaining < bytes) {
470
+ if (cursor < 16_000_000) {
471
+ resize(Math.max(data.byteLength * 4, data.byteLength + bytes));
472
+ }
473
+ else {
474
+ resize(data.byteLength + bytes + 16_000_000);
475
+ }
487
476
  }
488
- }
489
477
  }
490
478
  function toUint8Array() {
491
- const out = alloc(cursor);
492
- out.set(data.subarray(0, cursor), 0);
493
- cursor = 0;
494
- return out;
479
+ const out = alloc(cursor);
480
+ out.set(data.subarray(0, cursor), 0);
481
+ cursor = 0;
482
+ return out;
495
483
  }
496
484
  function resize(size) {
497
- const old = data;
498
- data = alloc(size);
499
- if (old) {
500
- if (old.copy) {
501
- old.copy(data, 0, 0, old.byteLength);
502
- } else {
503
- data.set(old, 0);
485
+ const old = data;
486
+ data = alloc(size);
487
+ if (old) {
488
+ if (old.copy) {
489
+ old.copy(data, 0, 0, old.byteLength);
490
+ }
491
+ else {
492
+ data.set(old, 0);
493
+ }
504
494
  }
505
- }
506
- dataView2 = new DataView(data.buffer, data.byteOffset, data.byteLength);
495
+ dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
507
496
  }
508
497
  function encodeHeader(major, value) {
509
- if (value < 24) {
510
- data[cursor++] = major << 5 | value;
511
- } else if (value < 1 << 8) {
512
- data[cursor++] = major << 5 | 24;
513
- data[cursor++] = value;
514
- } else if (value < 1 << 16) {
515
- data[cursor++] = major << 5 | extendedFloat16;
516
- dataView2.setUint16(cursor, value);
517
- cursor += 2;
518
- } else if (value < 2 ** 32) {
519
- data[cursor++] = major << 5 | extendedFloat32;
520
- dataView2.setUint32(cursor, value);
521
- cursor += 4;
522
- } else {
523
- data[cursor++] = major << 5 | extendedFloat64;
524
- dataView2.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value));
525
- cursor += 8;
526
- }
498
+ if (value < 24) {
499
+ data[cursor++] = (major << 5) | value;
500
+ }
501
+ else if (value < 1 << 8) {
502
+ data[cursor++] = (major << 5) | 24;
503
+ data[cursor++] = value;
504
+ }
505
+ else if (value < 1 << 16) {
506
+ data[cursor++] = (major << 5) | extendedFloat16;
507
+ dataView.setUint16(cursor, value);
508
+ cursor += 2;
509
+ }
510
+ else if (value < 2 ** 32) {
511
+ data[cursor++] = (major << 5) | extendedFloat32;
512
+ dataView.setUint32(cursor, value);
513
+ cursor += 4;
514
+ }
515
+ else {
516
+ data[cursor++] = (major << 5) | extendedFloat64;
517
+ dataView.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value));
518
+ cursor += 8;
519
+ }
527
520
  }
528
521
  function encode(_input) {
529
- const encodeStack = [_input];
530
- while (encodeStack.length) {
531
- const input = encodeStack.pop();
532
- ensureSpace(typeof input === "string" ? input.length * 4 : 64);
533
- if (typeof input === "string") {
534
- if (USE_BUFFER2) {
535
- encodeHeader(majorUtf8String, Buffer.byteLength(input));
536
- cursor += data.write(input, cursor);
537
- } else {
538
- const bytes = (0, import_util_utf82.fromUtf8)(input);
539
- encodeHeader(majorUtf8String, bytes.byteLength);
540
- data.set(bytes, cursor);
541
- cursor += bytes.byteLength;
542
- }
543
- continue;
544
- } else if (typeof input === "number") {
545
- if (Number.isInteger(input)) {
546
- const nonNegative = input >= 0;
547
- const major = nonNegative ? majorUint64 : majorNegativeInt64;
548
- const value = nonNegative ? input : -input - 1;
549
- if (value < 24) {
550
- data[cursor++] = major << 5 | value;
551
- } else if (value < 256) {
552
- data[cursor++] = major << 5 | 24;
553
- data[cursor++] = value;
554
- } else if (value < 65536) {
555
- data[cursor++] = major << 5 | extendedFloat16;
556
- data[cursor++] = value >> 8;
557
- data[cursor++] = value;
558
- } else if (value < 4294967296) {
559
- data[cursor++] = major << 5 | extendedFloat32;
560
- dataView2.setUint32(cursor, value);
561
- cursor += 4;
562
- } else {
563
- data[cursor++] = major << 5 | extendedFloat64;
564
- dataView2.setBigUint64(cursor, BigInt(value));
565
- cursor += 8;
522
+ const encodeStack = [_input];
523
+ while (encodeStack.length) {
524
+ const input = encodeStack.pop();
525
+ ensureSpace(typeof input === "string" ? input.length * 4 : 64);
526
+ if (typeof input === "string") {
527
+ if (USE_BUFFER) {
528
+ encodeHeader(majorUtf8String, Buffer.byteLength(input));
529
+ cursor += data.write(input, cursor);
530
+ }
531
+ else {
532
+ const bytes = utilUtf8.fromUtf8(input);
533
+ encodeHeader(majorUtf8String, bytes.byteLength);
534
+ data.set(bytes, cursor);
535
+ cursor += bytes.byteLength;
536
+ }
537
+ continue;
566
538
  }
567
- continue;
568
- }
569
- data[cursor++] = majorSpecial << 5 | extendedFloat64;
570
- dataView2.setFloat64(cursor, input);
571
- cursor += 8;
572
- continue;
573
- } else if (typeof input === "bigint") {
574
- const nonNegative = input >= 0;
575
- const major = nonNegative ? majorUint64 : majorNegativeInt64;
576
- const value = nonNegative ? input : -input - BigInt(1);
577
- const n = Number(value);
578
- if (n < 24) {
579
- data[cursor++] = major << 5 | n;
580
- } else if (n < 256) {
581
- data[cursor++] = major << 5 | 24;
582
- data[cursor++] = n;
583
- } else if (n < 65536) {
584
- data[cursor++] = major << 5 | extendedFloat16;
585
- data[cursor++] = n >> 8;
586
- data[cursor++] = n & 255;
587
- } else if (n < 4294967296) {
588
- data[cursor++] = major << 5 | extendedFloat32;
589
- dataView2.setUint32(cursor, n);
590
- cursor += 4;
591
- } else if (value < BigInt("18446744073709551616")) {
592
- data[cursor++] = major << 5 | extendedFloat64;
593
- dataView2.setBigUint64(cursor, value);
594
- cursor += 8;
595
- } else {
596
- const binaryBigInt = value.toString(2);
597
- const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8));
598
- let b = value;
599
- let i = 0;
600
- while (bigIntBytes.byteLength - ++i >= 0) {
601
- bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255));
602
- b >>= BigInt(8);
539
+ else if (typeof input === "number") {
540
+ if (Number.isInteger(input)) {
541
+ const nonNegative = input >= 0;
542
+ const major = nonNegative ? majorUint64 : majorNegativeInt64;
543
+ const value = nonNegative ? input : -input - 1;
544
+ if (value < 24) {
545
+ data[cursor++] = (major << 5) | value;
546
+ }
547
+ else if (value < 256) {
548
+ data[cursor++] = (major << 5) | 24;
549
+ data[cursor++] = value;
550
+ }
551
+ else if (value < 65536) {
552
+ data[cursor++] = (major << 5) | extendedFloat16;
553
+ data[cursor++] = value >> 8;
554
+ data[cursor++] = value;
555
+ }
556
+ else if (value < 4294967296) {
557
+ data[cursor++] = (major << 5) | extendedFloat32;
558
+ dataView.setUint32(cursor, value);
559
+ cursor += 4;
560
+ }
561
+ else {
562
+ data[cursor++] = (major << 5) | extendedFloat64;
563
+ dataView.setBigUint64(cursor, BigInt(value));
564
+ cursor += 8;
565
+ }
566
+ continue;
567
+ }
568
+ data[cursor++] = (majorSpecial << 5) | extendedFloat64;
569
+ dataView.setFloat64(cursor, input);
570
+ cursor += 8;
571
+ continue;
603
572
  }
604
- ensureSpace(bigIntBytes.byteLength * 2);
605
- data[cursor++] = nonNegative ? 194 : 195;
606
- if (USE_BUFFER2) {
607
- encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes));
608
- } else {
609
- encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength);
573
+ else if (typeof input === "bigint") {
574
+ const nonNegative = input >= 0;
575
+ const major = nonNegative ? majorUint64 : majorNegativeInt64;
576
+ const value = nonNegative ? input : -input - BigInt(1);
577
+ const n = Number(value);
578
+ if (n < 24) {
579
+ data[cursor++] = (major << 5) | n;
580
+ }
581
+ else if (n < 256) {
582
+ data[cursor++] = (major << 5) | 24;
583
+ data[cursor++] = n;
584
+ }
585
+ else if (n < 65536) {
586
+ data[cursor++] = (major << 5) | extendedFloat16;
587
+ data[cursor++] = n >> 8;
588
+ data[cursor++] = n & 0b1111_1111;
589
+ }
590
+ else if (n < 4294967296) {
591
+ data[cursor++] = (major << 5) | extendedFloat32;
592
+ dataView.setUint32(cursor, n);
593
+ cursor += 4;
594
+ }
595
+ else if (value < BigInt("18446744073709551616")) {
596
+ data[cursor++] = (major << 5) | extendedFloat64;
597
+ dataView.setBigUint64(cursor, value);
598
+ cursor += 8;
599
+ }
600
+ else {
601
+ const binaryBigInt = value.toString(2);
602
+ const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8));
603
+ let b = value;
604
+ let i = 0;
605
+ while (bigIntBytes.byteLength - ++i >= 0) {
606
+ bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255));
607
+ b >>= BigInt(8);
608
+ }
609
+ ensureSpace(bigIntBytes.byteLength * 2);
610
+ data[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011;
611
+ if (USE_BUFFER) {
612
+ encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes));
613
+ }
614
+ else {
615
+ encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength);
616
+ }
617
+ data.set(bigIntBytes, cursor);
618
+ cursor += bigIntBytes.byteLength;
619
+ }
620
+ continue;
621
+ }
622
+ else if (input === null) {
623
+ data[cursor++] = (majorSpecial << 5) | specialNull;
624
+ continue;
610
625
  }
611
- data.set(bigIntBytes, cursor);
612
- cursor += bigIntBytes.byteLength;
613
- }
614
- continue;
615
- } else if (input === null) {
616
- data[cursor++] = majorSpecial << 5 | specialNull;
617
- continue;
618
- } else if (typeof input === "boolean") {
619
- data[cursor++] = majorSpecial << 5 | (input ? specialTrue : specialFalse);
620
- continue;
621
- } else if (typeof input === "undefined") {
622
- throw new Error("@smithy/core/cbor: client may not serialize undefined value.");
623
- } else if (Array.isArray(input)) {
624
- for (let i = input.length - 1; i >= 0; --i) {
625
- encodeStack.push(input[i]);
626
- }
627
- encodeHeader(majorList, input.length);
628
- continue;
629
- } else if (typeof input.byteLength === "number") {
630
- ensureSpace(input.length * 2);
631
- encodeHeader(majorUnstructuredByteString, input.length);
632
- data.set(input, cursor);
633
- cursor += input.byteLength;
634
- continue;
635
- } else if (typeof input === "object") {
636
- if (input instanceof import_serde2.NumericValue) {
637
- const decimalIndex = input.string.indexOf(".");
638
- const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;
639
- const mantissa = BigInt(input.string.replace(".", ""));
640
- data[cursor++] = 196;
641
- encodeStack.push(mantissa);
642
- encodeStack.push(exponent);
643
- encodeHeader(majorList, 2);
644
- continue;
645
- }
646
- if (input[tagSymbol]) {
647
- if ("tag" in input && "value" in input) {
648
- encodeStack.push(input.value);
649
- encodeHeader(majorTag, input.tag);
650
- continue;
651
- } else {
652
- throw new Error(
653
- "tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input)
654
- );
626
+ else if (typeof input === "boolean") {
627
+ data[cursor++] = (majorSpecial << 5) | (input ? specialTrue : specialFalse);
628
+ continue;
655
629
  }
656
- }
657
- const keys = Object.keys(input);
658
- for (let i = keys.length - 1; i >= 0; --i) {
659
- const key = keys[i];
660
- encodeStack.push(input[key]);
661
- encodeStack.push(key);
662
- }
663
- encodeHeader(majorMap, keys.length);
664
- continue;
630
+ else if (typeof input === "undefined") {
631
+ throw new Error("@smithy/core/cbor: client may not serialize undefined value.");
632
+ }
633
+ else if (Array.isArray(input)) {
634
+ for (let i = input.length - 1; i >= 0; --i) {
635
+ encodeStack.push(input[i]);
636
+ }
637
+ encodeHeader(majorList, input.length);
638
+ continue;
639
+ }
640
+ else if (typeof input.byteLength === "number") {
641
+ ensureSpace(input.length * 2);
642
+ encodeHeader(majorUnstructuredByteString, input.length);
643
+ data.set(input, cursor);
644
+ cursor += input.byteLength;
645
+ continue;
646
+ }
647
+ else if (typeof input === "object") {
648
+ if (input instanceof serde.NumericValue) {
649
+ const decimalIndex = input.string.indexOf(".");
650
+ const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;
651
+ const mantissa = BigInt(input.string.replace(".", ""));
652
+ data[cursor++] = 0b110_00100;
653
+ encodeStack.push(mantissa);
654
+ encodeStack.push(exponent);
655
+ encodeHeader(majorList, 2);
656
+ continue;
657
+ }
658
+ if (input[tagSymbol]) {
659
+ if ("tag" in input && "value" in input) {
660
+ encodeStack.push(input.value);
661
+ encodeHeader(majorTag, input.tag);
662
+ continue;
663
+ }
664
+ else {
665
+ throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input));
666
+ }
667
+ }
668
+ const keys = Object.keys(input);
669
+ for (let i = keys.length - 1; i >= 0; --i) {
670
+ const key = keys[i];
671
+ encodeStack.push(input[key]);
672
+ encodeStack.push(key);
673
+ }
674
+ encodeHeader(majorMap, keys.length);
675
+ continue;
676
+ }
677
+ throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`);
665
678
  }
666
- throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`);
667
- }
668
679
  }
669
680
 
670
- // src/submodules/cbor/cbor.ts
671
- var cbor = {
672
- deserialize(payload2) {
673
- setPayload(payload2);
674
- return decode(0, payload2.length);
675
- },
676
- serialize(input) {
677
- try {
678
- encode(input);
679
- return toUint8Array();
680
- } catch (e) {
681
- toUint8Array();
682
- throw e;
683
- }
684
- },
685
- /**
686
- * @public
687
- * @param size - byte length to allocate.
688
- *
689
- * This may be used to garbage collect the CBOR
690
- * shared encoding buffer space,
691
- * e.g. resizeEncodingBuffer(0);
692
- *
693
- * This may also be used to pre-allocate more space for
694
- * CBOR encoding, e.g. resizeEncodingBuffer(100_000_000);
695
- */
696
- resizeEncodingBuffer(size) {
697
- resize(size);
698
- }
681
+ const cbor = {
682
+ deserialize(payload) {
683
+ setPayload(payload);
684
+ return decode(0, payload.length);
685
+ },
686
+ serialize(input) {
687
+ try {
688
+ encode(input);
689
+ return toUint8Array();
690
+ }
691
+ catch (e) {
692
+ toUint8Array();
693
+ throw e;
694
+ }
695
+ },
696
+ resizeEncodingBuffer(size) {
697
+ resize(size);
698
+ },
699
699
  };
700
700
 
701
- // src/submodules/cbor/parseCborBody.ts
702
- var import_protocols = require("@smithy/core/protocols");
703
- var import_protocol_http = require("@smithy/protocol-http");
704
- var import_util_body_length_browser = require("@smithy/util-body-length-browser");
705
- var parseCborBody = (streamBody, context) => {
706
- return (0, import_protocols.collectBody)(streamBody, context).then(async (bytes) => {
707
- if (bytes.length) {
708
- try {
709
- return cbor.deserialize(bytes);
710
- } catch (e) {
711
- Object.defineProperty(e, "$responseBodyText", {
712
- value: context.utf8Encoder(bytes)
713
- });
714
- throw e;
715
- }
716
- }
717
- return {};
718
- });
701
+ const parseCborBody = (streamBody, context) => {
702
+ return protocols.collectBody(streamBody, context).then(async (bytes) => {
703
+ if (bytes.length) {
704
+ try {
705
+ return cbor.deserialize(bytes);
706
+ }
707
+ catch (e) {
708
+ Object.defineProperty(e, "$responseBodyText", {
709
+ value: context.utf8Encoder(bytes),
710
+ });
711
+ throw e;
712
+ }
713
+ }
714
+ return {};
715
+ });
719
716
  };
720
- var dateToTag = (date) => {
721
- return tag({
722
- tag: 1,
723
- value: date.getTime() / 1e3
724
- });
717
+ const dateToTag = (date) => {
718
+ return tag({
719
+ tag: 1,
720
+ value: date.getTime() / 1000,
721
+ });
725
722
  };
726
- var parseCborErrorBody = async (errorBody, context) => {
727
- const value = await parseCborBody(errorBody, context);
728
- value.message = value.message ?? value.Message;
729
- return value;
723
+ const parseCborErrorBody = async (errorBody, context) => {
724
+ const value = await parseCborBody(errorBody, context);
725
+ value.message = value.message ?? value.Message;
726
+ return value;
730
727
  };
731
- var loadSmithyRpcV2CborErrorCode = (output, data2) => {
732
- const sanitizeErrorCode = (rawValue) => {
733
- let cleanValue = rawValue;
734
- if (typeof cleanValue === "number") {
735
- cleanValue = cleanValue.toString();
736
- }
737
- if (cleanValue.indexOf(",") >= 0) {
738
- cleanValue = cleanValue.split(",")[0];
739
- }
740
- if (cleanValue.indexOf(":") >= 0) {
741
- cleanValue = cleanValue.split(":")[0];
728
+ const loadSmithyRpcV2CborErrorCode = (output, data) => {
729
+ const sanitizeErrorCode = (rawValue) => {
730
+ let cleanValue = rawValue;
731
+ if (typeof cleanValue === "number") {
732
+ cleanValue = cleanValue.toString();
733
+ }
734
+ if (cleanValue.indexOf(",") >= 0) {
735
+ cleanValue = cleanValue.split(",")[0];
736
+ }
737
+ if (cleanValue.indexOf(":") >= 0) {
738
+ cleanValue = cleanValue.split(":")[0];
739
+ }
740
+ if (cleanValue.indexOf("#") >= 0) {
741
+ cleanValue = cleanValue.split("#")[1];
742
+ }
743
+ return cleanValue;
744
+ };
745
+ if (data["__type"] !== undefined) {
746
+ return sanitizeErrorCode(data["__type"]);
742
747
  }
743
- if (cleanValue.indexOf("#") >= 0) {
744
- cleanValue = cleanValue.split("#")[1];
748
+ const codeKey = Object.keys(data).find((key) => key.toLowerCase() === "code");
749
+ if (codeKey && data[codeKey] !== undefined) {
750
+ return sanitizeErrorCode(data[codeKey]);
745
751
  }
746
- return cleanValue;
747
- };
748
- if (data2["__type"] !== void 0) {
749
- return sanitizeErrorCode(data2["__type"]);
750
- }
751
- const codeKey = Object.keys(data2).find((key) => key.toLowerCase() === "code");
752
- if (codeKey && data2[codeKey] !== void 0) {
753
- return sanitizeErrorCode(data2[codeKey]);
754
- }
755
752
  };
756
- var checkCborResponse = (response) => {
757
- if (String(response.headers["smithy-protocol"]).toLowerCase() !== "rpc-v2-cbor") {
758
- throw new Error("Malformed RPCv2 CBOR response, status: " + response.statusCode);
759
- }
753
+ const checkCborResponse = (response) => {
754
+ if (String(response.headers["smithy-protocol"]).toLowerCase() !== "rpc-v2-cbor") {
755
+ throw new Error("Malformed RPCv2 CBOR response, status: " + response.statusCode);
756
+ }
760
757
  };
761
- var buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
762
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
763
- const contents = {
764
- protocol,
765
- hostname,
766
- port,
767
- method: "POST",
768
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
769
- headers: {
770
- // intentional copy.
771
- ...headers
758
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
759
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
760
+ const contents = {
761
+ protocol,
762
+ hostname,
763
+ port,
764
+ method: "POST",
765
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
766
+ headers: {
767
+ ...headers,
768
+ },
769
+ };
770
+ if (resolvedHostname !== undefined) {
771
+ contents.hostname = resolvedHostname;
772
772
  }
773
- };
774
- if (resolvedHostname !== void 0) {
775
- contents.hostname = resolvedHostname;
776
- }
777
- if (body !== void 0) {
778
- contents.body = body;
779
- try {
780
- contents.headers["content-length"] = String((0, import_util_body_length_browser.calculateBodyLength)(body));
781
- } catch (e) {
773
+ if (body !== undefined) {
774
+ contents.body = body;
775
+ try {
776
+ contents.headers["content-length"] = String(utilBodyLengthBrowser.calculateBodyLength(body));
777
+ }
778
+ catch (e) { }
782
779
  }
783
- }
784
- return new import_protocol_http.HttpRequest(contents);
780
+ return new protocolHttp.HttpRequest(contents);
785
781
  };
786
782
 
787
- // src/submodules/cbor/SmithyRpcV2CborProtocol.ts
788
- var import_protocols2 = require("@smithy/core/protocols");
789
- var import_schema2 = require("@smithy/core/schema");
790
- var import_util_middleware = require("@smithy/util-middleware");
791
-
792
- // src/submodules/cbor/CborCodec.ts
793
- var import_schema = require("@smithy/core/schema");
794
- var import_serde3 = require("@smithy/core/serde");
795
- var import_util_base64 = require("@smithy/util-base64");
796
- var CborCodec = class {
797
- createSerializer() {
798
- const serializer = new CborShapeSerializer();
799
- serializer.setSerdeContext(this.serdeContext);
800
- return serializer;
801
- }
802
- createDeserializer() {
803
- const deserializer = new CborShapeDeserializer();
804
- deserializer.setSerdeContext(this.serdeContext);
805
- return deserializer;
806
- }
807
- setSerdeContext(serdeContext) {
808
- this.serdeContext = serdeContext;
809
- }
810
- };
811
- var CborShapeSerializer = class {
812
- setSerdeContext(serdeContext) {
813
- this.serdeContext = serdeContext;
814
- }
815
- write(schema, value) {
816
- this.value = this.serialize(schema, value);
817
- }
818
- /**
819
- * Recursive serializer transform that copies and prepares the user input object
820
- * for CBOR serialization.
821
- */
822
- serialize(schema, source) {
823
- const ns = import_schema.NormalizedSchema.of(schema);
824
- if (source == null) {
825
- if (ns.isIdempotencyToken()) {
826
- return (0, import_serde3.generateIdempotencyToken)();
827
- }
828
- return source;
783
+ class CborCodec {
784
+ serdeContext;
785
+ createSerializer() {
786
+ const serializer = new CborShapeSerializer();
787
+ serializer.setSerdeContext(this.serdeContext);
788
+ return serializer;
829
789
  }
830
- if (ns.isBlobSchema()) {
831
- if (typeof source === "string") {
832
- return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(source);
833
- }
834
- return source;
790
+ createDeserializer() {
791
+ const deserializer = new CborShapeDeserializer();
792
+ deserializer.setSerdeContext(this.serdeContext);
793
+ return deserializer;
835
794
  }
836
- if (ns.isTimestampSchema()) {
837
- if (typeof source === "number" || typeof source === "bigint") {
838
- return dateToTag(new Date(Number(source) / 1e3 | 0));
839
- }
840
- return dateToTag(source);
795
+ setSerdeContext(serdeContext) {
796
+ this.serdeContext = serdeContext;
841
797
  }
842
- if (typeof source === "function" || typeof source === "object") {
843
- const sourceObject = source;
844
- if (ns.isListSchema() && Array.isArray(sourceObject)) {
845
- const sparse = !!ns.getMergedTraits().sparse;
846
- const newArray = [];
847
- let i = 0;
848
- for (const item of sourceObject) {
849
- const value = this.serialize(ns.getValueSchema(), item);
850
- if (value != null || sparse) {
851
- newArray[i++] = value;
852
- }
798
+ }
799
+ class CborShapeSerializer {
800
+ serdeContext;
801
+ value;
802
+ setSerdeContext(serdeContext) {
803
+ this.serdeContext = serdeContext;
804
+ }
805
+ write(schema, value) {
806
+ this.value = this.serialize(schema, value);
807
+ }
808
+ serialize(schema$1, source) {
809
+ const ns = schema.NormalizedSchema.of(schema$1);
810
+ if (source == null) {
811
+ if (ns.isIdempotencyToken()) {
812
+ return serde.generateIdempotencyToken();
813
+ }
814
+ return source;
853
815
  }
854
- return newArray;
855
- }
856
- if (sourceObject instanceof Date) {
857
- return dateToTag(sourceObject);
858
- }
859
- const newObject = {};
860
- if (ns.isMapSchema()) {
861
- const sparse = !!ns.getMergedTraits().sparse;
862
- for (const key of Object.keys(sourceObject)) {
863
- const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
864
- if (value != null || sparse) {
865
- newObject[key] = value;
866
- }
816
+ if (ns.isBlobSchema()) {
817
+ if (typeof source === "string") {
818
+ return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(source);
819
+ }
820
+ return source;
867
821
  }
868
- } else if (ns.isStructSchema()) {
869
- for (const [key, memberSchema] of ns.structIterator()) {
870
- const value = this.serialize(memberSchema, sourceObject[key]);
871
- if (value != null) {
872
- newObject[key] = value;
873
- }
822
+ if (ns.isTimestampSchema()) {
823
+ if (typeof source === "number" || typeof source === "bigint") {
824
+ return dateToTag(new Date((Number(source) / 1000) | 0));
825
+ }
826
+ return dateToTag(source);
874
827
  }
875
- } else if (ns.isDocumentSchema()) {
876
- for (const key of Object.keys(sourceObject)) {
877
- newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
828
+ if (typeof source === "function" || typeof source === "object") {
829
+ const sourceObject = source;
830
+ if (ns.isListSchema() && Array.isArray(sourceObject)) {
831
+ const sparse = !!ns.getMergedTraits().sparse;
832
+ const newArray = [];
833
+ let i = 0;
834
+ for (const item of sourceObject) {
835
+ const value = this.serialize(ns.getValueSchema(), item);
836
+ if (value != null || sparse) {
837
+ newArray[i++] = value;
838
+ }
839
+ }
840
+ return newArray;
841
+ }
842
+ if (sourceObject instanceof Date) {
843
+ return dateToTag(sourceObject);
844
+ }
845
+ const newObject = {};
846
+ if (ns.isMapSchema()) {
847
+ const sparse = !!ns.getMergedTraits().sparse;
848
+ for (const key of Object.keys(sourceObject)) {
849
+ const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
850
+ if (value != null || sparse) {
851
+ newObject[key] = value;
852
+ }
853
+ }
854
+ }
855
+ else if (ns.isStructSchema()) {
856
+ for (const [key, memberSchema] of ns.structIterator()) {
857
+ const value = this.serialize(memberSchema, sourceObject[key]);
858
+ if (value != null) {
859
+ newObject[key] = value;
860
+ }
861
+ }
862
+ }
863
+ else if (ns.isDocumentSchema()) {
864
+ for (const key of Object.keys(sourceObject)) {
865
+ newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
866
+ }
867
+ }
868
+ return newObject;
878
869
  }
879
- }
880
- return newObject;
870
+ return source;
881
871
  }
882
- return source;
883
- }
884
- flush() {
885
- const buffer = cbor.serialize(this.value);
886
- this.value = void 0;
887
- return buffer;
888
- }
889
- };
890
- var CborShapeDeserializer = class {
891
- setSerdeContext(serdeContext) {
892
- this.serdeContext = serdeContext;
893
- }
894
- read(schema, bytes) {
895
- const data2 = cbor.deserialize(bytes);
896
- return this.readValue(schema, data2);
897
- }
898
- /**
899
- * Public because it's called by the protocol implementation to deserialize errors.
900
- * @internal
901
- */
902
- readValue(_schema, value) {
903
- const ns = import_schema.NormalizedSchema.of(_schema);
904
- if (ns.isTimestampSchema() && typeof value === "number") {
905
- return (0, import_serde3.parseEpochTimestamp)(value);
872
+ flush() {
873
+ const buffer = cbor.serialize(this.value);
874
+ this.value = undefined;
875
+ return buffer;
876
+ }
877
+ }
878
+ class CborShapeDeserializer {
879
+ serdeContext;
880
+ setSerdeContext(serdeContext) {
881
+ this.serdeContext = serdeContext;
906
882
  }
907
- if (ns.isBlobSchema()) {
908
- if (typeof value === "string") {
909
- return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(value);
910
- }
911
- return value;
883
+ read(schema, bytes) {
884
+ const data = cbor.deserialize(bytes);
885
+ return this.readValue(schema, data);
912
886
  }
913
- if (typeof value === "undefined" || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "bigint" || typeof value === "symbol") {
914
- return value;
915
- } else if (typeof value === "function" || typeof value === "object") {
916
- if (value === null) {
917
- return null;
918
- }
919
- if ("byteLength" in value) {
920
- return value;
921
- }
922
- if (value instanceof Date) {
923
- return value;
924
- }
925
- if (ns.isDocumentSchema()) {
926
- return value;
927
- }
928
- if (ns.isListSchema()) {
929
- const newArray = [];
930
- const memberSchema = ns.getValueSchema();
931
- const sparse = !!ns.getMergedTraits().sparse;
932
- for (const item of value) {
933
- const itemValue = this.readValue(memberSchema, item);
934
- if (itemValue != null || sparse) {
935
- newArray.push(itemValue);
936
- }
887
+ readValue(_schema, value) {
888
+ const ns = schema.NormalizedSchema.of(_schema);
889
+ if (ns.isTimestampSchema() && typeof value === "number") {
890
+ return serde.parseEpochTimestamp(value);
937
891
  }
938
- return newArray;
939
- }
940
- const newObject = {};
941
- if (ns.isMapSchema()) {
942
- const sparse = !!ns.getMergedTraits().sparse;
943
- const targetSchema = ns.getValueSchema();
944
- for (const key of Object.keys(value)) {
945
- const itemValue = this.readValue(targetSchema, value[key]);
946
- if (itemValue != null || sparse) {
947
- newObject[key] = itemValue;
948
- }
892
+ if (ns.isBlobSchema()) {
893
+ if (typeof value === "string") {
894
+ return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);
895
+ }
896
+ return value;
949
897
  }
950
- } else if (ns.isStructSchema()) {
951
- for (const [key, memberSchema] of ns.structIterator()) {
952
- newObject[key] = this.readValue(memberSchema, value[key]);
898
+ if (typeof value === "undefined" ||
899
+ typeof value === "boolean" ||
900
+ typeof value === "number" ||
901
+ typeof value === "string" ||
902
+ typeof value === "bigint" ||
903
+ typeof value === "symbol") {
904
+ return value;
905
+ }
906
+ else if (typeof value === "function" || typeof value === "object") {
907
+ if (value === null) {
908
+ return null;
909
+ }
910
+ if ("byteLength" in value) {
911
+ return value;
912
+ }
913
+ if (value instanceof Date) {
914
+ return value;
915
+ }
916
+ if (ns.isDocumentSchema()) {
917
+ return value;
918
+ }
919
+ if (ns.isListSchema()) {
920
+ const newArray = [];
921
+ const memberSchema = ns.getValueSchema();
922
+ const sparse = !!ns.getMergedTraits().sparse;
923
+ for (const item of value) {
924
+ const itemValue = this.readValue(memberSchema, item);
925
+ if (itemValue != null || sparse) {
926
+ newArray.push(itemValue);
927
+ }
928
+ }
929
+ return newArray;
930
+ }
931
+ const newObject = {};
932
+ if (ns.isMapSchema()) {
933
+ const sparse = !!ns.getMergedTraits().sparse;
934
+ const targetSchema = ns.getValueSchema();
935
+ for (const key of Object.keys(value)) {
936
+ const itemValue = this.readValue(targetSchema, value[key]);
937
+ if (itemValue != null || sparse) {
938
+ newObject[key] = itemValue;
939
+ }
940
+ }
941
+ }
942
+ else if (ns.isStructSchema()) {
943
+ for (const [key, memberSchema] of ns.structIterator()) {
944
+ newObject[key] = this.readValue(memberSchema, value[key]);
945
+ }
946
+ }
947
+ return newObject;
948
+ }
949
+ else {
950
+ return value;
953
951
  }
954
- }
955
- return newObject;
956
- } else {
957
- return value;
958
952
  }
959
- }
960
- };
953
+ }
961
954
 
962
- // src/submodules/cbor/SmithyRpcV2CborProtocol.ts
963
- var SmithyRpcV2CborProtocol = class extends import_protocols2.RpcProtocol {
964
- constructor({ defaultNamespace }) {
965
- super({ defaultNamespace });
966
- this.codec = new CborCodec();
967
- this.serializer = this.codec.createSerializer();
968
- this.deserializer = this.codec.createDeserializer();
969
- }
970
- getShapeId() {
971
- return "smithy.protocols#rpcv2Cbor";
972
- }
973
- getPayloadCodec() {
974
- return this.codec;
975
- }
976
- async serializeRequest(operationSchema, input, context) {
977
- const request = await super.serializeRequest(operationSchema, input, context);
978
- Object.assign(request.headers, {
979
- "content-type": this.getDefaultContentType(),
980
- "smithy-protocol": "rpc-v2-cbor",
981
- accept: this.getDefaultContentType()
982
- });
983
- if ((0, import_schema2.deref)(operationSchema.input) === "unit") {
984
- delete request.body;
985
- delete request.headers["content-type"];
986
- } else {
987
- if (!request.body) {
988
- this.serializer.write(15, {});
989
- request.body = this.serializer.flush();
990
- }
991
- try {
992
- request.headers["content-length"] = String(request.body.byteLength);
993
- } catch (e) {
994
- }
955
+ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
956
+ codec = new CborCodec();
957
+ serializer = this.codec.createSerializer();
958
+ deserializer = this.codec.createDeserializer();
959
+ constructor({ defaultNamespace }) {
960
+ super({ defaultNamespace });
995
961
  }
996
- const { service, operation } = (0, import_util_middleware.getSmithyContext)(context);
997
- const path = `/service/${service}/operation/${operation}`;
998
- if (request.path.endsWith("/")) {
999
- request.path += path.slice(1);
1000
- } else {
1001
- request.path += path;
962
+ getShapeId() {
963
+ return "smithy.protocols#rpcv2Cbor";
1002
964
  }
1003
- return request;
1004
- }
1005
- async deserializeResponse(operationSchema, context, response) {
1006
- return super.deserializeResponse(operationSchema, context, response);
1007
- }
1008
- async handleError(operationSchema, context, response, dataObject, metadata) {
1009
- const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
1010
- let namespace = this.options.defaultNamespace;
1011
- if (errorName.includes("#")) {
1012
- [namespace] = errorName.split("#");
965
+ getPayloadCodec() {
966
+ return this.codec;
1013
967
  }
1014
- const errorMetadata = {
1015
- $metadata: metadata,
1016
- $response: response,
1017
- $fault: response.statusCode <= 500 ? "client" : "server"
1018
- };
1019
- const registry = import_schema2.TypeRegistry.for(namespace);
1020
- let errorSchema;
1021
- try {
1022
- errorSchema = registry.getSchema(errorName);
1023
- } catch (e) {
1024
- if (dataObject.Message) {
1025
- dataObject.message = dataObject.Message;
1026
- }
1027
- const synthetic = import_schema2.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
1028
- const baseExceptionSchema = synthetic.getBaseException();
1029
- if (baseExceptionSchema) {
1030
- const ErrorCtor2 = synthetic.getErrorCtor(baseExceptionSchema);
1031
- throw Object.assign(new ErrorCtor2({ name: errorName }), errorMetadata, dataObject);
1032
- }
1033
- throw Object.assign(new Error(errorName), errorMetadata, dataObject);
968
+ async serializeRequest(operationSchema, input, context) {
969
+ const request = await super.serializeRequest(operationSchema, input, context);
970
+ Object.assign(request.headers, {
971
+ "content-type": this.getDefaultContentType(),
972
+ "smithy-protocol": "rpc-v2-cbor",
973
+ accept: this.getDefaultContentType(),
974
+ });
975
+ if (schema.deref(operationSchema.input) === "unit") {
976
+ delete request.body;
977
+ delete request.headers["content-type"];
978
+ }
979
+ else {
980
+ if (!request.body) {
981
+ this.serializer.write(15, {});
982
+ request.body = this.serializer.flush();
983
+ }
984
+ try {
985
+ request.headers["content-length"] = String(request.body.byteLength);
986
+ }
987
+ catch (e) { }
988
+ }
989
+ const { service, operation } = utilMiddleware.getSmithyContext(context);
990
+ const path = `/service/${service}/operation/${operation}`;
991
+ if (request.path.endsWith("/")) {
992
+ request.path += path.slice(1);
993
+ }
994
+ else {
995
+ request.path += path;
996
+ }
997
+ return request;
1034
998
  }
1035
- const ns = import_schema2.NormalizedSchema.of(errorSchema);
1036
- const ErrorCtor = registry.getErrorCtor(errorSchema);
1037
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
1038
- const exception = new ErrorCtor(message);
1039
- const output = {};
1040
- for (const [name, member] of ns.structIterator()) {
1041
- output[name] = this.deserializer.readValue(member, dataObject[name]);
999
+ async deserializeResponse(operationSchema, context, response) {
1000
+ return super.deserializeResponse(operationSchema, context, response);
1042
1001
  }
1043
- throw Object.assign(
1044
- exception,
1045
- errorMetadata,
1046
- {
1047
- $fault: ns.getMergedTraits().error,
1048
- message
1049
- },
1050
- output
1051
- );
1052
- }
1053
- getDefaultContentType() {
1054
- return "application/cbor";
1055
- }
1056
- };
1057
- // Annotate the CommonJS export names for ESM import in node:
1058
- 0 && (module.exports = {
1059
- CborCodec,
1060
- CborShapeDeserializer,
1061
- CborShapeSerializer,
1062
- SmithyRpcV2CborProtocol,
1063
- buildHttpRpcRequest,
1064
- cbor,
1065
- checkCborResponse,
1066
- dateToTag,
1067
- loadSmithyRpcV2CborErrorCode,
1068
- parseCborBody,
1069
- parseCborErrorBody,
1070
- tag,
1071
- tagSymbol
1072
- });
1002
+ async handleError(operationSchema, context, response, dataObject, metadata) {
1003
+ const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
1004
+ let namespace = this.options.defaultNamespace;
1005
+ if (errorName.includes("#")) {
1006
+ [namespace] = errorName.split("#");
1007
+ }
1008
+ const errorMetadata = {
1009
+ $metadata: metadata,
1010
+ $response: response,
1011
+ $fault: response.statusCode <= 500 ? "client" : "server",
1012
+ };
1013
+ const registry = schema.TypeRegistry.for(namespace);
1014
+ let errorSchema;
1015
+ try {
1016
+ errorSchema = registry.getSchema(errorName);
1017
+ }
1018
+ catch (e) {
1019
+ if (dataObject.Message) {
1020
+ dataObject.message = dataObject.Message;
1021
+ }
1022
+ const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
1023
+ const baseExceptionSchema = synthetic.getBaseException();
1024
+ if (baseExceptionSchema) {
1025
+ const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema);
1026
+ throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
1027
+ }
1028
+ throw Object.assign(new Error(errorName), errorMetadata, dataObject);
1029
+ }
1030
+ const ns = schema.NormalizedSchema.of(errorSchema);
1031
+ const ErrorCtor = registry.getErrorCtor(errorSchema);
1032
+ const message = dataObject.message ?? dataObject.Message ?? "Unknown";
1033
+ const exception = new ErrorCtor(message);
1034
+ const output = {};
1035
+ for (const [name, member] of ns.structIterator()) {
1036
+ output[name] = this.deserializer.readValue(member, dataObject[name]);
1037
+ }
1038
+ throw Object.assign(exception, errorMetadata, {
1039
+ $fault: ns.getMergedTraits().error,
1040
+ message,
1041
+ }, output);
1042
+ }
1043
+ getDefaultContentType() {
1044
+ return "application/cbor";
1045
+ }
1046
+ }
1047
+
1048
+ exports.CborCodec = CborCodec;
1049
+ exports.CborShapeDeserializer = CborShapeDeserializer;
1050
+ exports.CborShapeSerializer = CborShapeSerializer;
1051
+ exports.SmithyRpcV2CborProtocol = SmithyRpcV2CborProtocol;
1052
+ exports.buildHttpRpcRequest = buildHttpRpcRequest;
1053
+ exports.cbor = cbor;
1054
+ exports.checkCborResponse = checkCborResponse;
1055
+ exports.dateToTag = dateToTag;
1056
+ exports.loadSmithyRpcV2CborErrorCode = loadSmithyRpcV2CborErrorCode;
1057
+ exports.parseCborBody = parseCborBody;
1058
+ exports.parseCborErrorBody = parseCborErrorBody;
1059
+ exports.tag = tag;
1060
+ exports.tagSymbol = tagSymbol;