@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,842 +1,648 @@
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);
1
+ 'use strict';
18
2
 
19
- // src/submodules/schema/index.ts
20
- var index_exports = {};
21
- __export(index_exports, {
22
- ErrorSchema: () => ErrorSchema,
23
- ListSchema: () => ListSchema,
24
- MapSchema: () => MapSchema,
25
- NormalizedSchema: () => NormalizedSchema,
26
- OperationSchema: () => OperationSchema,
27
- SCHEMA: () => SCHEMA,
28
- Schema: () => Schema,
29
- SimpleSchema: () => SimpleSchema,
30
- StructureSchema: () => StructureSchema,
31
- TypeRegistry: () => TypeRegistry,
32
- deref: () => deref,
33
- deserializerMiddlewareOption: () => deserializerMiddlewareOption,
34
- error: () => error,
35
- getSchemaSerdePlugin: () => getSchemaSerdePlugin,
36
- list: () => list,
37
- map: () => map,
38
- op: () => op,
39
- serializerMiddlewareOption: () => serializerMiddlewareOption,
40
- sim: () => sim,
41
- struct: () => struct
42
- });
43
- module.exports = __toCommonJS(index_exports);
3
+ var protocolHttp = require('@smithy/protocol-http');
4
+ var utilMiddleware = require('@smithy/util-middleware');
44
5
 
45
- // src/submodules/schema/deref.ts
46
- var deref = (schemaRef) => {
47
- if (typeof schemaRef === "function") {
48
- return schemaRef();
49
- }
50
- return schemaRef;
6
+ const deref = (schemaRef) => {
7
+ if (typeof schemaRef === "function") {
8
+ return schemaRef();
9
+ }
10
+ return schemaRef;
51
11
  };
52
12
 
53
- // src/submodules/schema/middleware/schemaDeserializationMiddleware.ts
54
- var import_protocol_http = require("@smithy/protocol-http");
55
- var import_util_middleware = require("@smithy/util-middleware");
56
- var schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
57
- const { response } = await next(args);
58
- const { operationSchema } = (0, import_util_middleware.getSmithyContext)(context);
59
- try {
60
- const parsed = await config.protocol.deserializeResponse(
61
- operationSchema,
62
- {
63
- ...config,
64
- ...context
65
- },
66
- response
67
- );
68
- return {
69
- response,
70
- output: parsed
71
- };
72
- } catch (error2) {
73
- Object.defineProperty(error2, "$response", {
74
- value: response
75
- });
76
- if (!("$metadata" in error2)) {
77
- const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
78
- try {
79
- error2.message += "\n " + hint;
80
- } catch (e) {
81
- if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
82
- console.warn(hint);
83
- } else {
84
- context.logger?.warn?.(hint);
85
- }
86
- }
87
- if (typeof error2.$responseBodyText !== "undefined") {
88
- if (error2.$response) {
89
- error2.$response.body = error2.$responseBodyText;
90
- }
91
- }
92
- try {
93
- if (import_protocol_http.HttpResponse.isInstance(response)) {
94
- const { headers = {} } = response;
95
- const headerEntries = Object.entries(headers);
96
- error2.$metadata = {
97
- httpStatusCode: response.statusCode,
98
- requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
99
- extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
100
- cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
101
- };
102
- }
103
- } catch (e) {
104
- }
105
- }
106
- throw error2;
107
- }
13
+ const schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
14
+ const { response } = await next(args);
15
+ const { operationSchema } = utilMiddleware.getSmithyContext(context);
16
+ try {
17
+ const parsed = await config.protocol.deserializeResponse(operationSchema, {
18
+ ...config,
19
+ ...context,
20
+ }, response);
21
+ return {
22
+ response,
23
+ output: parsed,
24
+ };
25
+ }
26
+ catch (error) {
27
+ Object.defineProperty(error, "$response", {
28
+ value: response,
29
+ });
30
+ if (!("$metadata" in error)) {
31
+ const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
32
+ try {
33
+ error.message += "\n " + hint;
34
+ }
35
+ catch (e) {
36
+ if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
37
+ console.warn(hint);
38
+ }
39
+ else {
40
+ context.logger?.warn?.(hint);
41
+ }
42
+ }
43
+ if (typeof error.$responseBodyText !== "undefined") {
44
+ if (error.$response) {
45
+ error.$response.body = error.$responseBodyText;
46
+ }
47
+ }
48
+ try {
49
+ if (protocolHttp.HttpResponse.isInstance(response)) {
50
+ const { headers = {} } = response;
51
+ const headerEntries = Object.entries(headers);
52
+ error.$metadata = {
53
+ httpStatusCode: response.statusCode,
54
+ requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
55
+ extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
56
+ cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries),
57
+ };
58
+ }
59
+ }
60
+ catch (e) {
61
+ }
62
+ }
63
+ throw error;
64
+ }
108
65
  };
109
- var findHeader = (pattern, headers) => {
110
- return (headers.find(([k]) => {
111
- return k.match(pattern);
112
- }) || [void 0, void 0])[1];
66
+ const findHeader = (pattern, headers) => {
67
+ return (headers.find(([k]) => {
68
+ return k.match(pattern);
69
+ }) || [void 0, void 0])[1];
113
70
  };
114
71
 
115
- // src/submodules/schema/middleware/schemaSerializationMiddleware.ts
116
- var import_util_middleware2 = require("@smithy/util-middleware");
117
- var schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
118
- const { operationSchema } = (0, import_util_middleware2.getSmithyContext)(context);
119
- const endpoint = context.endpointV2?.url && config.urlParser ? async () => config.urlParser(context.endpointV2.url) : config.endpoint;
120
- const request = await config.protocol.serializeRequest(operationSchema, args.input, {
121
- ...config,
122
- ...context,
123
- endpoint
124
- });
125
- return next({
126
- ...args,
127
- request
128
- });
72
+ const schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
73
+ const { operationSchema } = utilMiddleware.getSmithyContext(context);
74
+ const endpoint = context.endpointV2?.url && config.urlParser
75
+ ? async () => config.urlParser(context.endpointV2.url)
76
+ : config.endpoint;
77
+ const request = await config.protocol.serializeRequest(operationSchema, args.input, {
78
+ ...config,
79
+ ...context,
80
+ endpoint,
81
+ });
82
+ return next({
83
+ ...args,
84
+ request,
85
+ });
129
86
  };
130
87
 
131
- // src/submodules/schema/middleware/getSchemaSerdePlugin.ts
132
- var deserializerMiddlewareOption = {
133
- name: "deserializerMiddleware",
134
- step: "deserialize",
135
- tags: ["DESERIALIZER"],
136
- override: true
88
+ const deserializerMiddlewareOption = {
89
+ name: "deserializerMiddleware",
90
+ step: "deserialize",
91
+ tags: ["DESERIALIZER"],
92
+ override: true,
137
93
  };
138
- var serializerMiddlewareOption = {
139
- name: "serializerMiddleware",
140
- step: "serialize",
141
- tags: ["SERIALIZER"],
142
- override: true
94
+ const serializerMiddlewareOption = {
95
+ name: "serializerMiddleware",
96
+ step: "serialize",
97
+ tags: ["SERIALIZER"],
98
+ override: true,
143
99
  };
144
100
  function getSchemaSerdePlugin(config) {
145
- return {
146
- applyToStack: (commandStack) => {
147
- commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);
148
- commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);
149
- config.protocol.setSerdeContext(config);
101
+ return {
102
+ applyToStack: (commandStack) => {
103
+ commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);
104
+ commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);
105
+ config.protocol.setSerdeContext(config);
106
+ },
107
+ };
108
+ }
109
+
110
+ class TypeRegistry {
111
+ namespace;
112
+ schemas;
113
+ exceptions;
114
+ static registries = new Map();
115
+ constructor(namespace, schemas = new Map(), exceptions = new Map()) {
116
+ this.namespace = namespace;
117
+ this.schemas = schemas;
118
+ this.exceptions = exceptions;
119
+ }
120
+ static for(namespace) {
121
+ if (!TypeRegistry.registries.has(namespace)) {
122
+ TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));
123
+ }
124
+ return TypeRegistry.registries.get(namespace);
125
+ }
126
+ register(shapeId, schema) {
127
+ const qualifiedName = this.normalizeShapeId(shapeId);
128
+ this.schemas.set(qualifiedName, schema);
129
+ }
130
+ getSchema(shapeId) {
131
+ const id = this.normalizeShapeId(shapeId);
132
+ if (!this.schemas.has(id)) {
133
+ throw new Error(`@smithy/core/schema - schema not found for ${id}`);
134
+ }
135
+ return this.schemas.get(id);
136
+ }
137
+ registerError(errorSchema, ctor) {
138
+ this.exceptions.set(errorSchema, ctor);
139
+ }
140
+ getErrorCtor(errorSchema) {
141
+ return this.exceptions.get(errorSchema);
142
+ }
143
+ getBaseException() {
144
+ for (const [id, schema] of this.schemas.entries()) {
145
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
146
+ return schema;
147
+ }
148
+ }
149
+ return undefined;
150
+ }
151
+ find(predicate) {
152
+ return [...this.schemas.values()].find(predicate);
153
+ }
154
+ clear() {
155
+ this.schemas.clear();
156
+ this.exceptions.clear();
157
+ }
158
+ normalizeShapeId(shapeId) {
159
+ if (shapeId.includes("#")) {
160
+ return shapeId;
161
+ }
162
+ return this.namespace + "#" + shapeId;
163
+ }
164
+ getNamespace(shapeId) {
165
+ return this.normalizeShapeId(shapeId).split("#")[0];
150
166
  }
151
- };
152
167
  }
153
168
 
154
- // src/submodules/schema/TypeRegistry.ts
155
- var TypeRegistry = class _TypeRegistry {
156
- constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
157
- this.namespace = namespace;
158
- this.schemas = schemas;
159
- this.exceptions = exceptions;
160
- }
161
- static {
162
- this.registries = /* @__PURE__ */ new Map();
163
- }
164
- /**
165
- * @param namespace - specifier.
166
- * @returns the schema for that namespace, creating it if necessary.
167
- */
168
- static for(namespace) {
169
- if (!_TypeRegistry.registries.has(namespace)) {
170
- _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace));
171
- }
172
- return _TypeRegistry.registries.get(namespace);
173
- }
174
- /**
175
- * Adds the given schema to a type registry with the same namespace.
176
- *
177
- * @param shapeId - to be registered.
178
- * @param schema - to be registered.
179
- */
180
- register(shapeId, schema) {
181
- const qualifiedName = this.normalizeShapeId(shapeId);
182
- this.schemas.set(qualifiedName, schema);
183
- }
184
- /**
185
- * @param shapeId - query.
186
- * @returns the schema.
187
- */
188
- getSchema(shapeId) {
189
- const id = this.normalizeShapeId(shapeId);
190
- if (!this.schemas.has(id)) {
191
- throw new Error(`@smithy/core/schema - schema not found for ${id}`);
192
- }
193
- return this.schemas.get(id);
194
- }
195
- /**
196
- * Associates an error schema with its constructor.
197
- */
198
- registerError(errorSchema, ctor) {
199
- this.exceptions.set(errorSchema, ctor);
200
- }
201
- /**
202
- * @param errorSchema - query.
203
- * @returns Error constructor that extends the service's base exception.
204
- */
205
- getErrorCtor(errorSchema) {
206
- return this.exceptions.get(errorSchema);
207
- }
208
- /**
209
- * The smithy-typescript code generator generates a synthetic (i.e. unmodeled) base exception,
210
- * because generated SDKs before the introduction of schemas have the notion of a ServiceBaseException, which
211
- * is unique per service/model.
212
- *
213
- * This is generated under a unique prefix that is combined with the service namespace, and this
214
- * method is used to retrieve it.
215
- *
216
- * The base exception synthetic schema is used when an error is returned by a service, but we cannot
217
- * determine what existing schema to use to deserialize it.
218
- *
219
- * @returns the synthetic base exception of the service namespace associated with this registry instance.
220
- */
221
- getBaseException() {
222
- for (const [id, schema] of this.schemas.entries()) {
223
- if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
169
+ class Schema {
170
+ name;
171
+ namespace;
172
+ traits;
173
+ static assign(instance, values) {
174
+ const schema = Object.assign(instance, values);
175
+ TypeRegistry.for(schema.namespace).register(schema.name, schema);
224
176
  return schema;
225
- }
226
- }
227
- return void 0;
228
- }
229
- /**
230
- * @param predicate - criterion.
231
- * @returns a schema in this registry matching the predicate.
232
- */
233
- find(predicate) {
234
- return [...this.schemas.values()].find(predicate);
235
- }
236
- /**
237
- * Unloads the current TypeRegistry.
238
- */
239
- clear() {
240
- this.schemas.clear();
241
- this.exceptions.clear();
242
- }
243
- normalizeShapeId(shapeId) {
244
- if (shapeId.includes("#")) {
245
- return shapeId;
246
- }
247
- return this.namespace + "#" + shapeId;
248
- }
249
- getNamespace(shapeId) {
250
- return this.normalizeShapeId(shapeId).split("#")[0];
251
- }
252
- };
253
-
254
- // src/submodules/schema/schemas/Schema.ts
255
- var Schema = class {
256
- static assign(instance, values) {
257
- const schema = Object.assign(instance, values);
258
- TypeRegistry.for(schema.namespace).register(schema.name, schema);
259
- return schema;
260
- }
261
- static [Symbol.hasInstance](lhs) {
262
- const isPrototype = this.prototype.isPrototypeOf(lhs);
263
- if (!isPrototype && typeof lhs === "object" && lhs !== null) {
264
- const list2 = lhs;
265
- return list2.symbol === this.symbol;
266
- }
267
- return isPrototype;
268
- }
269
- getName() {
270
- return this.namespace + "#" + this.name;
271
- }
272
- };
177
+ }
178
+ static [Symbol.hasInstance](lhs) {
179
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
180
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
181
+ const list = lhs;
182
+ return list.symbol === this.symbol;
183
+ }
184
+ return isPrototype;
185
+ }
186
+ getName() {
187
+ return this.namespace + "#" + this.name;
188
+ }
189
+ }
273
190
 
274
- // src/submodules/schema/schemas/ListSchema.ts
275
- var ListSchema = class _ListSchema extends Schema {
276
- constructor() {
277
- super(...arguments);
278
- this.symbol = _ListSchema.symbol;
279
- }
280
- static {
281
- this.symbol = Symbol.for("@smithy/lis");
282
- }
283
- };
284
- var list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), {
285
- name,
286
- namespace,
287
- traits,
288
- valueSchema
191
+ class ListSchema extends Schema {
192
+ static symbol = Symbol.for("@smithy/lis");
193
+ name;
194
+ traits;
195
+ valueSchema;
196
+ symbol = ListSchema.symbol;
197
+ }
198
+ const list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), {
199
+ name,
200
+ namespace,
201
+ traits,
202
+ valueSchema,
289
203
  });
290
204
 
291
- // src/submodules/schema/schemas/MapSchema.ts
292
- var MapSchema = class _MapSchema extends Schema {
293
- constructor() {
294
- super(...arguments);
295
- this.symbol = _MapSchema.symbol;
296
- }
297
- static {
298
- this.symbol = Symbol.for("@smithy/map");
299
- }
300
- };
301
- var map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), {
302
- name,
303
- namespace,
304
- traits,
305
- keySchema,
306
- valueSchema
205
+ class MapSchema extends Schema {
206
+ static symbol = Symbol.for("@smithy/map");
207
+ name;
208
+ traits;
209
+ keySchema;
210
+ valueSchema;
211
+ symbol = MapSchema.symbol;
212
+ }
213
+ const map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), {
214
+ name,
215
+ namespace,
216
+ traits,
217
+ keySchema,
218
+ valueSchema,
307
219
  });
308
220
 
309
- // src/submodules/schema/schemas/OperationSchema.ts
310
- var OperationSchema = class _OperationSchema extends Schema {
311
- constructor() {
312
- super(...arguments);
313
- this.symbol = _OperationSchema.symbol;
314
- }
315
- static {
316
- this.symbol = Symbol.for("@smithy/ope");
317
- }
318
- };
319
- var op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), {
320
- name,
321
- namespace,
322
- traits,
323
- input,
324
- output
221
+ class OperationSchema extends Schema {
222
+ static symbol = Symbol.for("@smithy/ope");
223
+ name;
224
+ traits;
225
+ input;
226
+ output;
227
+ symbol = OperationSchema.symbol;
228
+ }
229
+ const op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), {
230
+ name,
231
+ namespace,
232
+ traits,
233
+ input,
234
+ output,
325
235
  });
326
236
 
327
- // src/submodules/schema/schemas/StructureSchema.ts
328
- var StructureSchema = class _StructureSchema extends Schema {
329
- constructor() {
330
- super(...arguments);
331
- this.symbol = _StructureSchema.symbol;
332
- }
333
- static {
334
- this.symbol = Symbol.for("@smithy/str");
335
- }
336
- };
337
- var struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), {
338
- name,
339
- namespace,
340
- traits,
341
- memberNames,
342
- memberList
237
+ class StructureSchema extends Schema {
238
+ static symbol = Symbol.for("@smithy/str");
239
+ name;
240
+ traits;
241
+ memberNames;
242
+ memberList;
243
+ symbol = StructureSchema.symbol;
244
+ }
245
+ const struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), {
246
+ name,
247
+ namespace,
248
+ traits,
249
+ memberNames,
250
+ memberList,
343
251
  });
344
252
 
345
- // src/submodules/schema/schemas/ErrorSchema.ts
346
- var ErrorSchema = class _ErrorSchema extends StructureSchema {
347
- constructor() {
348
- super(...arguments);
349
- this.symbol = _ErrorSchema.symbol;
350
- }
351
- static {
352
- this.symbol = Symbol.for("@smithy/err");
353
- }
354
- };
355
- var error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), {
356
- name,
357
- namespace,
358
- traits,
359
- memberNames,
360
- memberList,
361
- ctor: null
253
+ class ErrorSchema extends StructureSchema {
254
+ static symbol = Symbol.for("@smithy/err");
255
+ ctor;
256
+ symbol = ErrorSchema.symbol;
257
+ }
258
+ const error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), {
259
+ name,
260
+ namespace,
261
+ traits,
262
+ memberNames,
263
+ memberList,
264
+ ctor: null,
362
265
  });
363
266
 
364
- // src/submodules/schema/schemas/sentinels.ts
365
- var SCHEMA = {
366
- BLOB: 21,
367
- // 21
368
- STREAMING_BLOB: 42,
369
- // 42
370
- BOOLEAN: 2,
371
- // 2
372
- STRING: 0,
373
- // 0
374
- NUMERIC: 1,
375
- // 1
376
- BIG_INTEGER: 17,
377
- // 17
378
- BIG_DECIMAL: 19,
379
- // 19
380
- DOCUMENT: 15,
381
- // 15
382
- TIMESTAMP_DEFAULT: 4,
383
- // 4
384
- TIMESTAMP_DATE_TIME: 5,
385
- // 5
386
- TIMESTAMP_HTTP_DATE: 6,
387
- // 6
388
- TIMESTAMP_EPOCH_SECONDS: 7,
389
- // 7
390
- LIST_MODIFIER: 64,
391
- // 64
392
- MAP_MODIFIER: 128
393
- // 128
267
+ const SCHEMA = {
268
+ BLOB: 0b0001_0101,
269
+ STREAMING_BLOB: 0b0010_1010,
270
+ BOOLEAN: 0b0000_0010,
271
+ STRING: 0b0000_0000,
272
+ NUMERIC: 0b0000_0001,
273
+ BIG_INTEGER: 0b0001_0001,
274
+ BIG_DECIMAL: 0b0001_0011,
275
+ DOCUMENT: 0b0000_1111,
276
+ TIMESTAMP_DEFAULT: 0b0000_0100,
277
+ TIMESTAMP_DATE_TIME: 0b0000_0101,
278
+ TIMESTAMP_HTTP_DATE: 0b0000_0110,
279
+ TIMESTAMP_EPOCH_SECONDS: 0b0000_0111,
280
+ LIST_MODIFIER: 0b0100_0000,
281
+ MAP_MODIFIER: 0b1000_0000,
394
282
  };
395
283
 
396
- // src/submodules/schema/schemas/SimpleSchema.ts
397
- var SimpleSchema = class _SimpleSchema extends Schema {
398
- constructor() {
399
- super(...arguments);
400
- this.symbol = _SimpleSchema.symbol;
401
- }
402
- static {
403
- this.symbol = Symbol.for("@smithy/sim");
404
- }
405
- };
406
- var sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {
407
- name,
408
- namespace,
409
- traits,
410
- schemaRef
284
+ class SimpleSchema extends Schema {
285
+ static symbol = Symbol.for("@smithy/sim");
286
+ name;
287
+ schemaRef;
288
+ traits;
289
+ symbol = SimpleSchema.symbol;
290
+ }
291
+ const sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {
292
+ name,
293
+ namespace,
294
+ traits,
295
+ schemaRef,
411
296
  });
412
297
 
413
- // src/submodules/schema/schemas/NormalizedSchema.ts
414
- var NormalizedSchema = class _NormalizedSchema {
415
- /**
416
- * @param ref - a polymorphic SchemaRef to be dereferenced/normalized.
417
- * @param memberName - optional memberName if this NormalizedSchema should be considered a member schema.
418
- */
419
- constructor(ref, memberName) {
420
- this.ref = ref;
421
- this.memberName = memberName;
422
- this.symbol = _NormalizedSchema.symbol;
423
- const traitStack = [];
424
- let _ref = ref;
425
- let schema = ref;
426
- this._isMemberSchema = false;
427
- while (Array.isArray(_ref)) {
428
- traitStack.push(_ref[1]);
429
- _ref = _ref[0];
430
- schema = deref(_ref);
431
- this._isMemberSchema = true;
432
- }
433
- if (traitStack.length > 0) {
434
- this.memberTraits = {};
435
- for (let i = traitStack.length - 1; i >= 0; --i) {
436
- const traitSet = traitStack[i];
437
- Object.assign(this.memberTraits, _NormalizedSchema.translateTraits(traitSet));
438
- }
439
- } else {
440
- this.memberTraits = 0;
441
- }
442
- if (schema instanceof _NormalizedSchema) {
443
- const computedMemberTraits = this.memberTraits;
444
- Object.assign(this, schema);
445
- this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
446
- this.normalizedTraits = void 0;
447
- this.memberName = memberName ?? schema.memberName;
448
- return;
449
- }
450
- this.schema = deref(schema);
451
- if (this.schema && typeof this.schema === "object") {
452
- this.traits = this.schema?.traits ?? {};
453
- } else {
454
- this.traits = 0;
455
- }
456
- this.name = (this.schema instanceof Schema ? this.schema.getName?.() : void 0) ?? this.memberName ?? this.getSchemaName();
457
- if (this._isMemberSchema && !memberName) {
458
- throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
459
- }
460
- }
461
- static {
462
- this.symbol = Symbol.for("@smithy/nor");
463
- }
464
- static [Symbol.hasInstance](lhs) {
465
- return Schema[Symbol.hasInstance].bind(this)(lhs);
466
- }
467
- /**
468
- * Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
469
- */
470
- static of(ref) {
471
- if (ref instanceof _NormalizedSchema) {
472
- return ref;
473
- }
474
- if (Array.isArray(ref)) {
475
- const [ns, traits] = ref;
476
- if (ns instanceof _NormalizedSchema) {
477
- Object.assign(ns.getMergedTraits(), _NormalizedSchema.translateTraits(traits));
478
- return ns;
479
- }
480
- throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
481
- }
482
- return new _NormalizedSchema(ref);
483
- }
484
- /**
485
- * @param indicator - numeric indicator for preset trait combination.
486
- * @returns equivalent trait object.
487
- */
488
- static translateTraits(indicator) {
489
- if (typeof indicator === "object") {
490
- return indicator;
491
- }
492
- indicator = indicator | 0;
493
- const traits = {};
494
- let i = 0;
495
- for (const trait of [
496
- "httpLabel",
497
- "idempotent",
498
- "idempotencyToken",
499
- "sensitive",
500
- "httpPayload",
501
- "httpResponseCode",
502
- "httpQueryParams"
503
- ]) {
504
- if ((indicator >> i++ & 1) === 1) {
505
- traits[trait] = 1;
506
- }
507
- }
508
- return traits;
509
- }
510
- /**
511
- * @returns the underlying non-normalized schema.
512
- */
513
- getSchema() {
514
- if (this.schema instanceof _NormalizedSchema) {
515
- Object.assign(this, { schema: this.schema.getSchema() });
516
- return this.schema;
517
- }
518
- if (this.schema instanceof SimpleSchema) {
519
- return deref(this.schema.schemaRef);
520
- }
521
- return deref(this.schema);
522
- }
523
- /**
524
- * @param withNamespace - qualifies the name.
525
- * @returns e.g. `MyShape` or `com.namespace#MyShape`.
526
- */
527
- getName(withNamespace = false) {
528
- if (!withNamespace) {
529
- if (this.name && this.name.includes("#")) {
530
- return this.name.split("#")[1];
531
- }
532
- }
533
- return this.name || void 0;
534
- }
535
- /**
536
- * @returns the member name if the schema is a member schema.
537
- * @throws Error when the schema isn't a member schema.
538
- */
539
- getMemberName() {
540
- if (!this.isMemberSchema()) {
541
- throw new Error(`@smithy/core/schema - non-member schema: ${this.getName(true)}`);
542
- }
543
- return this.memberName;
544
- }
545
- isMemberSchema() {
546
- return this._isMemberSchema;
547
- }
548
- isUnitSchema() {
549
- return this.getSchema() === "unit";
550
- }
551
- /**
552
- * boolean methods on this class help control flow in shape serialization and deserialization.
553
- */
554
- isListSchema() {
555
- const inner = this.getSchema();
556
- if (typeof inner === "number") {
557
- return inner >= SCHEMA.LIST_MODIFIER && inner < SCHEMA.MAP_MODIFIER;
558
- }
559
- return inner instanceof ListSchema;
560
- }
561
- isMapSchema() {
562
- const inner = this.getSchema();
563
- if (typeof inner === "number") {
564
- return inner >= SCHEMA.MAP_MODIFIER && inner <= 255;
565
- }
566
- return inner instanceof MapSchema;
567
- }
568
- isStructSchema() {
569
- const inner = this.getSchema();
570
- return inner !== null && typeof inner === "object" && "members" in inner || inner instanceof StructureSchema;
571
- }
572
- isBlobSchema() {
573
- return this.getSchema() === SCHEMA.BLOB || this.getSchema() === SCHEMA.STREAMING_BLOB;
574
- }
575
- isTimestampSchema() {
576
- const schema = this.getSchema();
577
- return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
578
- }
579
- isDocumentSchema() {
580
- return this.getSchema() === SCHEMA.DOCUMENT;
581
- }
582
- isStringSchema() {
583
- return this.getSchema() === SCHEMA.STRING;
584
- }
585
- isBooleanSchema() {
586
- return this.getSchema() === SCHEMA.BOOLEAN;
587
- }
588
- isNumericSchema() {
589
- return this.getSchema() === SCHEMA.NUMERIC;
590
- }
591
- isBigIntegerSchema() {
592
- return this.getSchema() === SCHEMA.BIG_INTEGER;
593
- }
594
- isBigDecimalSchema() {
595
- return this.getSchema() === SCHEMA.BIG_DECIMAL;
596
- }
597
- isStreaming() {
598
- const streaming = !!this.getMergedTraits().streaming;
599
- if (streaming) {
600
- return true;
601
- }
602
- return this.getSchema() === SCHEMA.STREAMING_BLOB;
603
- }
604
- /**
605
- * This is a shortcut to avoid calling `getMergedTraits().idempotencyToken` on every string.
606
- * @returns whether the schema has the idempotencyToken trait.
607
- */
608
- isIdempotencyToken() {
609
- if (this.normalizedTraits) {
610
- return !!this.normalizedTraits.idempotencyToken;
611
- }
612
- for (const traits of [this.traits, this.memberTraits]) {
613
- if (typeof traits === "number") {
614
- if ((traits & 4) === 4) {
615
- return true;
616
- }
617
- } else if (typeof traits === "object") {
618
- if (!!traits.idempotencyToken) {
619
- return true;
620
- }
621
- }
622
- }
623
- return false;
624
- }
625
- /**
626
- * @returns own traits merged with member traits, where member traits of the same trait key take priority.
627
- * This method is cached.
628
- */
629
- getMergedTraits() {
630
- return this.normalizedTraits ?? (this.normalizedTraits = {
631
- ...this.getOwnTraits(),
632
- ...this.getMemberTraits()
633
- });
634
- }
635
- /**
636
- * @returns only the member traits. If the schema is not a member, this returns empty.
637
- */
638
- getMemberTraits() {
639
- return _NormalizedSchema.translateTraits(this.memberTraits);
640
- }
641
- /**
642
- * @returns only the traits inherent to the shape or member target shape if this schema is a member.
643
- * If there are any member traits they are excluded.
644
- */
645
- getOwnTraits() {
646
- return _NormalizedSchema.translateTraits(this.traits);
647
- }
648
- /**
649
- * @returns the map's key's schema. Returns a dummy Document schema if this schema is a Document.
650
- *
651
- * @throws Error if the schema is not a Map or Document.
652
- */
653
- getKeySchema() {
654
- if (this.isDocumentSchema()) {
655
- return this.memberFrom([SCHEMA.DOCUMENT, 0], "key");
656
- }
657
- if (!this.isMapSchema()) {
658
- throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
659
- }
660
- const schema = this.getSchema();
661
- if (typeof schema === "number") {
662
- return this.memberFrom([63 & schema, 0], "key");
663
- }
664
- return this.memberFrom([schema.keySchema, 0], "key");
665
- }
666
- /**
667
- * @returns the schema of the map's value or list's member.
668
- * Returns a dummy Document schema if this schema is a Document.
669
- *
670
- * @throws Error if the schema is not a Map, List, nor Document.
671
- */
672
- getValueSchema() {
673
- const schema = this.getSchema();
674
- if (typeof schema === "number") {
675
- if (this.isMapSchema()) {
676
- return this.memberFrom([63 & schema, 0], "value");
677
- } else if (this.isListSchema()) {
678
- return this.memberFrom([63 & schema, 0], "member");
679
- }
680
- }
681
- if (schema && typeof schema === "object") {
682
- if (this.isStructSchema()) {
683
- throw new Error(`may not getValueSchema() on structure ${this.getName(true)}`);
684
- }
685
- const collection = schema;
686
- if ("valueSchema" in collection) {
687
- if (this.isMapSchema()) {
688
- return this.memberFrom([collection.valueSchema, 0], "value");
689
- } else if (this.isListSchema()) {
690
- return this.memberFrom([collection.valueSchema, 0], "member");
691
- }
692
- }
693
- }
694
- if (this.isDocumentSchema()) {
695
- return this.memberFrom([SCHEMA.DOCUMENT, 0], "value");
696
- }
697
- throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
698
- }
699
- /**
700
- * @param member - to query.
701
- * @returns whether there is a memberSchema with the given member name. False if not a structure (or union).
702
- */
703
- hasMemberSchema(member) {
704
- if (this.isStructSchema()) {
705
- const struct2 = this.getSchema();
706
- return struct2.memberNames.includes(member);
707
- }
708
- return false;
709
- }
710
- /**
711
- * @returns the NormalizedSchema for the given member name. The returned instance will return true for `isMemberSchema()`
712
- * and will have the member name given.
713
- * @param member - which member to retrieve and wrap.
714
- *
715
- * @throws Error if member does not exist or the schema is neither a document nor structure.
716
- * Note that errors are assumed to be structures and unions are considered structures for these purposes.
717
- */
718
- getMemberSchema(member) {
719
- if (this.isStructSchema()) {
720
- const struct2 = this.getSchema();
721
- if (!struct2.memberNames.includes(member)) {
722
- throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${member}.`);
723
- }
724
- const i = struct2.memberNames.indexOf(member);
725
- const memberSchema = struct2.memberList[i];
726
- return this.memberFrom(Array.isArray(memberSchema) ? memberSchema : [memberSchema, 0], member);
727
- }
728
- if (this.isDocumentSchema()) {
729
- return this.memberFrom([SCHEMA.DOCUMENT, 0], member);
730
- }
731
- throw new Error(`@smithy/core/schema - ${this.getName(true)} has no members.`);
732
- }
733
- /**
734
- * This can be used for checking the members as a hashmap.
735
- * Prefer the structIterator method for iteration.
736
- *
737
- * This does NOT return list and map members, it is only for structures.
738
- *
739
- * @deprecated use (checked) structIterator instead.
740
- *
741
- * @returns a map of member names to member schemas (normalized).
742
- */
743
- getMemberSchemas() {
744
- const buffer = {};
745
- try {
746
- for (const [k, v] of this.structIterator()) {
747
- buffer[k] = v;
748
- }
749
- } catch (ignored) {
750
- }
751
- return buffer;
752
- }
753
- /**
754
- * @returns member name of event stream or empty string indicating none exists or this
755
- * isn't a structure schema.
756
- */
757
- getEventStreamMember() {
758
- if (this.isStructSchema()) {
759
- for (const [memberName, memberSchema] of this.structIterator()) {
760
- if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
761
- return memberName;
762
- }
763
- }
764
- }
765
- return "";
766
- }
767
- /**
768
- * Allows iteration over members of a structure schema.
769
- * Each yield is a pair of the member name and member schema.
770
- *
771
- * This avoids the overhead of calling Object.entries(ns.getMemberSchemas()).
772
- */
773
- *structIterator() {
774
- if (this.isUnitSchema()) {
775
- return;
776
- }
777
- if (!this.isStructSchema()) {
778
- throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
779
- }
780
- const struct2 = this.getSchema();
781
- for (let i = 0; i < struct2.memberNames.length; ++i) {
782
- yield [struct2.memberNames[i], this.memberFrom([struct2.memberList[i], 0], struct2.memberNames[i])];
783
- }
784
- }
785
- /**
786
- * Creates a normalized member schema from the given schema and member name.
787
- */
788
- memberFrom(memberSchema, memberName) {
789
- if (memberSchema instanceof _NormalizedSchema) {
790
- return Object.assign(memberSchema, {
791
- memberName,
792
- _isMemberSchema: true
793
- });
794
- }
795
- return new _NormalizedSchema(memberSchema, memberName);
796
- }
797
- /**
798
- * @returns a last-resort human-readable name for the schema if it has no other identifiers.
799
- */
800
- getSchemaName() {
801
- const schema = this.getSchema();
802
- if (typeof schema === "number") {
803
- const _schema = 63 & schema;
804
- const container = 192 & schema;
805
- const type = Object.entries(SCHEMA).find(([, value]) => {
806
- return value === _schema;
807
- })?.[0] ?? "Unknown";
808
- switch (container) {
809
- case SCHEMA.MAP_MODIFIER:
810
- return `${type}Map`;
811
- case SCHEMA.LIST_MODIFIER:
812
- return `${type}List`;
813
- case 0:
814
- return type;
815
- }
816
- }
817
- return "Unknown";
818
- }
819
- };
820
- // Annotate the CommonJS export names for ESM import in node:
821
- 0 && (module.exports = {
822
- ErrorSchema,
823
- ListSchema,
824
- MapSchema,
825
- NormalizedSchema,
826
- OperationSchema,
827
- SCHEMA,
828
- Schema,
829
- SimpleSchema,
830
- StructureSchema,
831
- TypeRegistry,
832
- deref,
833
- deserializerMiddlewareOption,
834
- error,
835
- getSchemaSerdePlugin,
836
- list,
837
- map,
838
- op,
839
- serializerMiddlewareOption,
840
- sim,
841
- struct
842
- });
298
+ class NormalizedSchema {
299
+ ref;
300
+ memberName;
301
+ static symbol = Symbol.for("@smithy/nor");
302
+ symbol = NormalizedSchema.symbol;
303
+ name;
304
+ schema;
305
+ _isMemberSchema;
306
+ traits;
307
+ memberTraits;
308
+ normalizedTraits;
309
+ constructor(ref, memberName) {
310
+ this.ref = ref;
311
+ this.memberName = memberName;
312
+ const traitStack = [];
313
+ let _ref = ref;
314
+ let schema = ref;
315
+ this._isMemberSchema = false;
316
+ while (Array.isArray(_ref)) {
317
+ traitStack.push(_ref[1]);
318
+ _ref = _ref[0];
319
+ schema = deref(_ref);
320
+ this._isMemberSchema = true;
321
+ }
322
+ if (traitStack.length > 0) {
323
+ this.memberTraits = {};
324
+ for (let i = traitStack.length - 1; i >= 0; --i) {
325
+ const traitSet = traitStack[i];
326
+ Object.assign(this.memberTraits, NormalizedSchema.translateTraits(traitSet));
327
+ }
328
+ }
329
+ else {
330
+ this.memberTraits = 0;
331
+ }
332
+ if (schema instanceof NormalizedSchema) {
333
+ const computedMemberTraits = this.memberTraits;
334
+ Object.assign(this, schema);
335
+ this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
336
+ this.normalizedTraits = void 0;
337
+ this.memberName = memberName ?? schema.memberName;
338
+ return;
339
+ }
340
+ this.schema = deref(schema);
341
+ if (this.schema && typeof this.schema === "object") {
342
+ this.traits = this.schema?.traits ?? {};
343
+ }
344
+ else {
345
+ this.traits = 0;
346
+ }
347
+ this.name =
348
+ (this.schema instanceof Schema ? this.schema.getName?.() : void 0) ?? this.memberName ?? this.getSchemaName();
349
+ if (this._isMemberSchema && !memberName) {
350
+ throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
351
+ }
352
+ }
353
+ static [Symbol.hasInstance](lhs) {
354
+ return Schema[Symbol.hasInstance].bind(this)(lhs);
355
+ }
356
+ static of(ref) {
357
+ if (ref instanceof NormalizedSchema) {
358
+ return ref;
359
+ }
360
+ if (Array.isArray(ref)) {
361
+ const [ns, traits] = ref;
362
+ if (ns instanceof NormalizedSchema) {
363
+ Object.assign(ns.getMergedTraits(), NormalizedSchema.translateTraits(traits));
364
+ return ns;
365
+ }
366
+ throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
367
+ }
368
+ return new NormalizedSchema(ref);
369
+ }
370
+ static translateTraits(indicator) {
371
+ if (typeof indicator === "object") {
372
+ return indicator;
373
+ }
374
+ indicator = indicator | 0;
375
+ const traits = {};
376
+ let i = 0;
377
+ for (const trait of [
378
+ "httpLabel",
379
+ "idempotent",
380
+ "idempotencyToken",
381
+ "sensitive",
382
+ "httpPayload",
383
+ "httpResponseCode",
384
+ "httpQueryParams",
385
+ ]) {
386
+ if (((indicator >> i++) & 1) === 1) {
387
+ traits[trait] = 1;
388
+ }
389
+ }
390
+ return traits;
391
+ }
392
+ getSchema() {
393
+ if (this.schema instanceof NormalizedSchema) {
394
+ Object.assign(this, { schema: this.schema.getSchema() });
395
+ return this.schema;
396
+ }
397
+ if (this.schema instanceof SimpleSchema) {
398
+ return deref(this.schema.schemaRef);
399
+ }
400
+ return deref(this.schema);
401
+ }
402
+ getName(withNamespace = false) {
403
+ if (!withNamespace) {
404
+ if (this.name && this.name.includes("#")) {
405
+ return this.name.split("#")[1];
406
+ }
407
+ }
408
+ return this.name || undefined;
409
+ }
410
+ getMemberName() {
411
+ if (!this.isMemberSchema()) {
412
+ throw new Error(`@smithy/core/schema - non-member schema: ${this.getName(true)}`);
413
+ }
414
+ return this.memberName;
415
+ }
416
+ isMemberSchema() {
417
+ return this._isMemberSchema;
418
+ }
419
+ isUnitSchema() {
420
+ return this.getSchema() === "unit";
421
+ }
422
+ isListSchema() {
423
+ const inner = this.getSchema();
424
+ if (typeof inner === "number") {
425
+ return inner >= SCHEMA.LIST_MODIFIER && inner < SCHEMA.MAP_MODIFIER;
426
+ }
427
+ return inner instanceof ListSchema;
428
+ }
429
+ isMapSchema() {
430
+ const inner = this.getSchema();
431
+ if (typeof inner === "number") {
432
+ return inner >= SCHEMA.MAP_MODIFIER && inner <= 0b1111_1111;
433
+ }
434
+ return inner instanceof MapSchema;
435
+ }
436
+ isStructSchema() {
437
+ const inner = this.getSchema();
438
+ return (inner !== null && typeof inner === "object" && "members" in inner) || inner instanceof StructureSchema;
439
+ }
440
+ isBlobSchema() {
441
+ return this.getSchema() === SCHEMA.BLOB || this.getSchema() === SCHEMA.STREAMING_BLOB;
442
+ }
443
+ isTimestampSchema() {
444
+ const schema = this.getSchema();
445
+ return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
446
+ }
447
+ isDocumentSchema() {
448
+ return this.getSchema() === SCHEMA.DOCUMENT;
449
+ }
450
+ isStringSchema() {
451
+ return this.getSchema() === SCHEMA.STRING;
452
+ }
453
+ isBooleanSchema() {
454
+ return this.getSchema() === SCHEMA.BOOLEAN;
455
+ }
456
+ isNumericSchema() {
457
+ return this.getSchema() === SCHEMA.NUMERIC;
458
+ }
459
+ isBigIntegerSchema() {
460
+ return this.getSchema() === SCHEMA.BIG_INTEGER;
461
+ }
462
+ isBigDecimalSchema() {
463
+ return this.getSchema() === SCHEMA.BIG_DECIMAL;
464
+ }
465
+ isStreaming() {
466
+ const streaming = !!this.getMergedTraits().streaming;
467
+ if (streaming) {
468
+ return true;
469
+ }
470
+ return this.getSchema() === SCHEMA.STREAMING_BLOB;
471
+ }
472
+ isIdempotencyToken() {
473
+ if (this.normalizedTraits) {
474
+ return !!this.normalizedTraits.idempotencyToken;
475
+ }
476
+ for (const traits of [this.traits, this.memberTraits]) {
477
+ if (typeof traits === "number") {
478
+ if ((traits & 0b0100) === 0b0100) {
479
+ return true;
480
+ }
481
+ }
482
+ else if (typeof traits === "object") {
483
+ if (!!traits.idempotencyToken) {
484
+ return true;
485
+ }
486
+ }
487
+ }
488
+ return false;
489
+ }
490
+ getMergedTraits() {
491
+ return (this.normalizedTraits ??
492
+ (this.normalizedTraits = {
493
+ ...this.getOwnTraits(),
494
+ ...this.getMemberTraits(),
495
+ }));
496
+ }
497
+ getMemberTraits() {
498
+ return NormalizedSchema.translateTraits(this.memberTraits);
499
+ }
500
+ getOwnTraits() {
501
+ return NormalizedSchema.translateTraits(this.traits);
502
+ }
503
+ getKeySchema() {
504
+ if (this.isDocumentSchema()) {
505
+ return this.memberFrom([SCHEMA.DOCUMENT, 0], "key");
506
+ }
507
+ if (!this.isMapSchema()) {
508
+ throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
509
+ }
510
+ const schema = this.getSchema();
511
+ if (typeof schema === "number") {
512
+ return this.memberFrom([0b0011_1111 & schema, 0], "key");
513
+ }
514
+ return this.memberFrom([schema.keySchema, 0], "key");
515
+ }
516
+ getValueSchema() {
517
+ const schema = this.getSchema();
518
+ if (typeof schema === "number") {
519
+ if (this.isMapSchema()) {
520
+ return this.memberFrom([0b0011_1111 & schema, 0], "value");
521
+ }
522
+ else if (this.isListSchema()) {
523
+ return this.memberFrom([0b0011_1111 & schema, 0], "member");
524
+ }
525
+ }
526
+ if (schema && typeof schema === "object") {
527
+ if (this.isStructSchema()) {
528
+ throw new Error(`may not getValueSchema() on structure ${this.getName(true)}`);
529
+ }
530
+ const collection = schema;
531
+ if ("valueSchema" in collection) {
532
+ if (this.isMapSchema()) {
533
+ return this.memberFrom([collection.valueSchema, 0], "value");
534
+ }
535
+ else if (this.isListSchema()) {
536
+ return this.memberFrom([collection.valueSchema, 0], "member");
537
+ }
538
+ }
539
+ }
540
+ if (this.isDocumentSchema()) {
541
+ return this.memberFrom([SCHEMA.DOCUMENT, 0], "value");
542
+ }
543
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
544
+ }
545
+ hasMemberSchema(member) {
546
+ if (this.isStructSchema()) {
547
+ const struct = this.getSchema();
548
+ return struct.memberNames.includes(member);
549
+ }
550
+ return false;
551
+ }
552
+ getMemberSchema(member) {
553
+ if (this.isStructSchema()) {
554
+ const struct = this.getSchema();
555
+ if (!struct.memberNames.includes(member)) {
556
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${member}.`);
557
+ }
558
+ const i = struct.memberNames.indexOf(member);
559
+ const memberSchema = struct.memberList[i];
560
+ return this.memberFrom(Array.isArray(memberSchema) ? memberSchema : [memberSchema, 0], member);
561
+ }
562
+ if (this.isDocumentSchema()) {
563
+ return this.memberFrom([SCHEMA.DOCUMENT, 0], member);
564
+ }
565
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no members.`);
566
+ }
567
+ getMemberSchemas() {
568
+ const buffer = {};
569
+ try {
570
+ for (const [k, v] of this.structIterator()) {
571
+ buffer[k] = v;
572
+ }
573
+ }
574
+ catch (ignored) { }
575
+ return buffer;
576
+ }
577
+ getEventStreamMember() {
578
+ if (this.isStructSchema()) {
579
+ for (const [memberName, memberSchema] of this.structIterator()) {
580
+ if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
581
+ return memberName;
582
+ }
583
+ }
584
+ }
585
+ return "";
586
+ }
587
+ *structIterator() {
588
+ if (this.isUnitSchema()) {
589
+ return;
590
+ }
591
+ if (!this.isStructSchema()) {
592
+ throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
593
+ }
594
+ const struct = this.getSchema();
595
+ for (let i = 0; i < struct.memberNames.length; ++i) {
596
+ yield [struct.memberNames[i], this.memberFrom([struct.memberList[i], 0], struct.memberNames[i])];
597
+ }
598
+ }
599
+ memberFrom(memberSchema, memberName) {
600
+ if (memberSchema instanceof NormalizedSchema) {
601
+ return Object.assign(memberSchema, {
602
+ memberName,
603
+ _isMemberSchema: true,
604
+ });
605
+ }
606
+ return new NormalizedSchema(memberSchema, memberName);
607
+ }
608
+ getSchemaName() {
609
+ const schema = this.getSchema();
610
+ if (typeof schema === "number") {
611
+ const _schema = 0b0011_1111 & schema;
612
+ const container = 0b1100_0000 & schema;
613
+ const type = Object.entries(SCHEMA).find(([, value]) => {
614
+ return value === _schema;
615
+ })?.[0] ?? "Unknown";
616
+ switch (container) {
617
+ case SCHEMA.MAP_MODIFIER:
618
+ return `${type}Map`;
619
+ case SCHEMA.LIST_MODIFIER:
620
+ return `${type}List`;
621
+ case 0:
622
+ return type;
623
+ }
624
+ }
625
+ return "Unknown";
626
+ }
627
+ }
628
+
629
+ exports.ErrorSchema = ErrorSchema;
630
+ exports.ListSchema = ListSchema;
631
+ exports.MapSchema = MapSchema;
632
+ exports.NormalizedSchema = NormalizedSchema;
633
+ exports.OperationSchema = OperationSchema;
634
+ exports.SCHEMA = SCHEMA;
635
+ exports.Schema = Schema;
636
+ exports.SimpleSchema = SimpleSchema;
637
+ exports.StructureSchema = StructureSchema;
638
+ exports.TypeRegistry = TypeRegistry;
639
+ exports.deref = deref;
640
+ exports.deserializerMiddlewareOption = deserializerMiddlewareOption;
641
+ exports.error = error;
642
+ exports.getSchemaSerdePlugin = getSchemaSerdePlugin;
643
+ exports.list = list;
644
+ exports.map = map;
645
+ exports.op = op;
646
+ exports.serializerMiddlewareOption = serializerMiddlewareOption;
647
+ exports.sim = sim;
648
+ exports.struct = struct;