@cdk8s/awscdk-resolver 0.0.643 → 0.0.644

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 (200) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +2 -1
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/enums.js +1 -0
  5. package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/DescribeChangeSetCommand.d.ts +1 -1
  6. package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/enums.d.ts +1 -0
  7. package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/models_0.d.ts +7 -3
  8. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/enums.d.ts +1 -0
  9. package/node_modules/@aws-sdk/client-cloudformation/package.json +6 -6
  10. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +856 -57
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +8 -5
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
  14. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +1 -0
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonCodec.js → codec-v1/JsonCodec.js} +1 -1
  16. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +1 -0
  17. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeDeserializer.js → codec-v1/JsonShapeDeserializer.js} +6 -6
  18. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeSerializer.js → codec-v1/JsonShapeSerializer.js} +3 -3
  19. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +103 -0
  20. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +20 -0
  21. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{experimental/BufferJsonShapeDeserializer.js → codec-v2/JsonShapeDeserializer2.js} +38 -18
  22. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{experimental/ByteJsonShapeSerializer.js → codec-v2/JsonShapeSerializer2.js} +66 -60
  23. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +9 -6
  24. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
  25. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
  26. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
  27. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
  28. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +7 -0
  29. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonCodec.d.ts → codec-v1/JsonCodec.d.ts} +4 -8
  30. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +7 -0
  31. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeDeserializer.d.ts → codec-v1/JsonShapeDeserializer.d.ts} +3 -2
  32. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeSerializer.d.ts → codec-v1/JsonShapeSerializer.d.ts} +3 -2
  33. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
  34. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -0
  35. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{experimental/BufferJsonShapeDeserializer.d.ts → codec-v2/JsonShapeDeserializer2.d.ts} +4 -3
  36. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{experimental/ByteJsonShapeSerializer.d.ts → codec-v2/JsonShapeSerializer2.d.ts} +19 -16
  37. package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +4 -7
  38. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +61 -21
  39. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +13 -27
  40. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +4 -16
  41. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +5 -14
  42. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +16 -5
  43. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +4 -11
  44. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +107 -47
  45. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +112 -39
  46. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +107 -48
  47. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +13 -14
  48. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +25 -35
  49. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +14 -4
  50. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +2 -6
  51. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +2 -5
  52. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +2 -5
  53. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +2 -6
  54. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +2 -10
  55. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +2 -6
  56. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +16 -20
  57. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +21 -44
  58. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -7
  59. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +2 -5
  60. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -18
  61. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +8 -11
  62. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +14 -16
  63. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +1 -4
  64. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +7 -14
  65. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +1 -4
  66. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +6 -7
  67. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +6 -12
  68. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +6 -7
  69. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -2
  70. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +4 -5
  71. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +2 -7
  72. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +28 -38
  73. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -638
  74. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -1
  75. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +29 -56
  76. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -1
  77. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -1
  78. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +6 -1
  79. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -1
  80. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -1
  81. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -1
  82. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +12 -1
  83. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +4 -7
  84. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +7 -14
  85. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +7 -2
  86. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +18 -27
  87. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +13 -18
  88. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +3 -8
  89. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +17 -28
  90. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +2 -6
  91. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +2 -5
  92. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +4 -13
  93. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +9 -10
  94. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +39 -44
  95. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +2 -5
  96. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +1 -6
  97. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +1 -7
  98. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +4 -13
  99. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +23 -7
  100. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +13 -38
  101. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +57 -133
  102. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +32 -11
  103. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +32 -9
  104. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +1 -8
  105. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +1 -6
  106. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +2 -8
  107. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +1 -8
  108. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +6 -26
  109. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -4
  110. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +1 -9
  111. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +5 -8
  112. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +40 -74
  113. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +9 -24
  114. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +36 -25
  115. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +3 -18
  116. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +5 -2
  117. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +30 -22
  118. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +21 -22
  119. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +21 -22
  120. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +49 -29
  121. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +49 -36
  122. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +4 -0
  123. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +1 -7
  124. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +11 -0
  125. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +4 -0
  126. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +13 -0
  127. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +18 -0
  128. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +27 -0
  129. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +9 -0
  130. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +15 -0
  131. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +39 -0
  132. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
  133. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +7 -21
  134. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +7 -15
  135. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +2 -11
  136. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +14 -22
  137. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +18 -27
  138. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +57 -49
  139. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +7 -13
  140. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +21 -16
  141. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +1 -4
  142. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +47 -31
  143. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +17 -14
  144. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +15 -20
  145. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -21
  146. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/parseXmlBody.d.ts +4 -13
  147. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +1 -6
  148. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +3 -3
  149. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +14 -32
  150. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +4 -2
  151. package/node_modules/@aws-sdk/core/package.json +3 -3
  152. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  153. package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
  154. package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  155. package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
  156. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  157. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  158. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  159. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  160. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  161. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  162. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  163. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  164. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  165. package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
  166. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  167. package/node_modules/@aws-sdk/token-providers/package.json +4 -4
  168. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1561 -337
  169. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -205
  170. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +1 -1
  171. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +113 -0
  172. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +103 -0
  173. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +621 -0
  174. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +602 -0
  175. package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +5 -1
  176. package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +5 -27
  177. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
  178. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
  179. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
  180. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
  181. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
  182. package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +5 -1
  183. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -27
  184. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
  185. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
  186. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
  187. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
  188. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
  189. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +5 -1
  190. package/node_modules/@smithy/core/package.json +2 -1
  191. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  192. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  193. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  194. package/node_modules/@smithy/signature-v4/package.json +2 -2
  195. package/package.json +5 -5
  196. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +0 -19
  197. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +0 -13
  198. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +0 -28
  199. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +0 -29
  200. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +0 -57
@@ -0,0 +1,621 @@
1
+ import { SerdeContext } from "@smithy/core/protocols";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
+ import { NumericValue, _parseEpochTimestamp, nv } from "@smithy/core/serde";
4
+ import { extendedFloat16, extendedFloat32, extendedFloat64, extendedOneByte, majorList, majorMap, majorNegativeInt64, majorSpecial, majorTag, majorUint64, majorUnstructuredByteString, majorUtf8String, minorIndefinite, specialFalse, specialNull, specialTrue, specialUndefined, } from "../cbor-types";
5
+ import { loadCborStructIterator } from "./CborShapeSerializer2";
6
+ export class CborShapeDeserializer2 extends SerdeContext {
7
+ read(schema, bytes) {
8
+ payload = bytes;
9
+ isBuffer = USE_BUFFER && bytes instanceof Buffer;
10
+ dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
11
+ pos = 0;
12
+ end = bytes.length;
13
+ cacheEpoch = (cacheEpoch + 1) & 0xffff;
14
+ return readValue(NormalizedSchema.of(schema));
15
+ }
16
+ readValue(_schema, value) {
17
+ return transformObject(NormalizedSchema.of(_schema), value);
18
+ }
19
+ }
20
+ const USE_BUFFER = typeof Buffer !== "undefined";
21
+ const textDecoder = new TextDecoder();
22
+ let payload = new Uint8Array(0);
23
+ let isBuffer = false;
24
+ let dataView = new DataView(new ArrayBuffer(0));
25
+ let pos = 0;
26
+ let end = 0;
27
+ const STRING_CACHE_SIZE = 2048;
28
+ const stringCache = new Array(STRING_CACHE_SIZE);
29
+ const stringCacheEpochs = new Uint16Array(STRING_CACHE_SIZE);
30
+ let cacheEpoch = 0;
31
+ function readValue(ns) {
32
+ if (pos >= end) {
33
+ throw new Error("unexpected end of CBOR payload.");
34
+ }
35
+ const major = (payload[pos] & 0b1110_0000) >> 5;
36
+ const minor = payload[pos] & 0b0001_1111;
37
+ if (minor === minorIndefinite && major >= 2 && major <= 5) {
38
+ return readIndefinite(ns, major);
39
+ }
40
+ switch (major) {
41
+ case majorUint64:
42
+ return readUnsignedInt();
43
+ case majorNegativeInt64:
44
+ return readNegativeInt();
45
+ case majorUnstructuredByteString:
46
+ return readByteString();
47
+ case majorUtf8String:
48
+ return readUtf8String();
49
+ case majorList:
50
+ return readList(ns);
51
+ case majorMap:
52
+ return readMap(ns);
53
+ case majorTag:
54
+ return readTag(ns);
55
+ case majorSpecial:
56
+ return readSpecial();
57
+ default:
58
+ throw new Error(`unexpected CBOR major type ${major}.`);
59
+ }
60
+ }
61
+ function readList(ns) {
62
+ const count = decodeCount();
63
+ const memberSchema = ns.isListSchema() ? ns.getValueSchema() : ns;
64
+ const list = Array(count);
65
+ for (let i = 0; i < count; ++i) {
66
+ list[i] = readValue(memberSchema);
67
+ }
68
+ return list;
69
+ }
70
+ function readMap(ns) {
71
+ const count = decodeCount();
72
+ if (ns.isStructSchema()) {
73
+ const startPos = pos;
74
+ return readStruct(ns, count, startPos);
75
+ }
76
+ const valueSchema = ns.isMapSchema() ? ns.getValueSchema() : ns;
77
+ const map = {};
78
+ for (let i = 0; i < count; ++i) {
79
+ const key = readUtf8String();
80
+ map[key] = readValue(valueSchema);
81
+ }
82
+ return map;
83
+ }
84
+ function readStruct(ns, count, startPos) {
85
+ const isUnion = ns.isUnionSchema();
86
+ const cache = loadCborStructIterator(ns);
87
+ const { memberSchemas, encodedKeys, memberNames } = cache;
88
+ const z = encodedKeys.length;
89
+ const result = {};
90
+ let unknownKey;
91
+ let unknownValue;
92
+ let unknownCount = 0;
93
+ let hasType = false;
94
+ let hint = 0;
95
+ for (let i = 0; i < count; ++i) {
96
+ const matchIdx = matchStructKey(encodedKeys, z, hint);
97
+ if (matchIdx >= 0) {
98
+ hint = matchIdx + 1;
99
+ if (hint >= z) {
100
+ hint = 0;
101
+ }
102
+ const val = readValue(memberSchemas[matchIdx]);
103
+ if (val != null) {
104
+ result[memberNames[matchIdx]] = val;
105
+ }
106
+ }
107
+ else {
108
+ const key = readUtf8String();
109
+ const val = readValue(NormalizedSchema.of(15));
110
+ if (key === "__type" && typeof val === "string") {
111
+ hasType = true;
112
+ }
113
+ else {
114
+ unknownKey = key;
115
+ unknownValue = val;
116
+ ++unknownCount;
117
+ }
118
+ }
119
+ }
120
+ if (isUnion) {
121
+ let resultEmpty = true;
122
+ for (const _ in result) {
123
+ resultEmpty = false;
124
+ break;
125
+ }
126
+ if (resultEmpty && unknownCount === 1) {
127
+ result.$unknown = [unknownKey, unknownValue];
128
+ }
129
+ }
130
+ else if (hasType) {
131
+ pos = startPos;
132
+ const docSchema = NormalizedSchema.of(15);
133
+ for (let i = 0; i < count; ++i) {
134
+ const key = readUtf8String();
135
+ const val = readValue(docSchema);
136
+ if (!(key in result)) {
137
+ result[key] = val;
138
+ }
139
+ }
140
+ }
141
+ return result;
142
+ }
143
+ function readTag(ns) {
144
+ const tagNum = decodeArgument();
145
+ const tagNumber = typeof tagNum === "bigint" ? Number(tagNum) : tagNum;
146
+ if (tagNumber === 1) {
147
+ const docSchema = NormalizedSchema.of(15);
148
+ const epochValue = readValue(docSchema);
149
+ return _parseEpochTimestamp(epochValue);
150
+ }
151
+ if (tagNumber === 2 || tagNumber === 3) {
152
+ const byteStr = readByteString();
153
+ let b = BigInt(0);
154
+ for (let i = 0; i < byteStr.length; ++i) {
155
+ b = (b << BigInt(8)) | BigInt(byteStr[i]);
156
+ }
157
+ return tagNumber === 3 ? -b - BigInt(1) : b;
158
+ }
159
+ if (tagNumber === 4) {
160
+ const docSchema = NormalizedSchema.of(15);
161
+ const pair = readValue(docSchema);
162
+ const [exponent, mantissa] = pair;
163
+ const normalizer = mantissa < 0 ? -1 : 1;
164
+ const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
165
+ let numericString;
166
+ const sign = mantissa < 0 ? "-" : "";
167
+ numericString =
168
+ exponent === 0
169
+ ? mantissaStr
170
+ : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
171
+ numericString = numericString.replace(/^0+/g, "");
172
+ if (numericString === "") {
173
+ numericString = "0";
174
+ }
175
+ if (numericString[0] === ".") {
176
+ numericString = "0" + numericString;
177
+ }
178
+ numericString = sign + numericString;
179
+ return nv(numericString);
180
+ }
181
+ const docSchema = NormalizedSchema.of(15);
182
+ const innerValue = readValue(docSchema);
183
+ return { tag: castBigInt(tagNum), value: innerValue };
184
+ }
185
+ function readIndefinite(ns, major) {
186
+ switch (major) {
187
+ case majorUtf8String:
188
+ return readUtf8StringIndefinite();
189
+ case majorUnstructuredByteString:
190
+ return readByteStringIndefinite();
191
+ case majorList:
192
+ return readListIndefinite(ns);
193
+ case majorMap:
194
+ return readMapIndefinite(ns);
195
+ default:
196
+ throw new Error(`unexpected indefinite length for major ${major}.`);
197
+ }
198
+ }
199
+ function readUtf8StringIndefinite() {
200
+ pos += 1;
201
+ const chunks = [];
202
+ let totalLen = 0;
203
+ while (pos < end) {
204
+ if (payload[pos] === 0xff) {
205
+ pos += 1;
206
+ const combined = new Uint8Array(totalLen);
207
+ let offset = 0;
208
+ for (let i = 0; i < chunks.length; ++i) {
209
+ combined.set(chunks[i], offset);
210
+ offset += chunks[i].length;
211
+ }
212
+ if (USE_BUFFER) {
213
+ return Buffer.from(combined.buffer, combined.byteOffset, combined.byteLength).toString("utf-8");
214
+ }
215
+ return textDecoder.decode(combined);
216
+ }
217
+ const bytes = readByteString();
218
+ chunks.push(bytes);
219
+ totalLen += bytes.length;
220
+ }
221
+ throw new Error("expected break marker.");
222
+ }
223
+ function readByteStringIndefinite() {
224
+ pos += 1;
225
+ const chunks = [];
226
+ let totalLen = 0;
227
+ while (pos < end) {
228
+ if (payload[pos] === 0xff) {
229
+ pos += 1;
230
+ const combined = new Uint8Array(totalLen);
231
+ let offset = 0;
232
+ for (let i = 0; i < chunks.length; ++i) {
233
+ combined.set(chunks[i], offset);
234
+ offset += chunks[i].length;
235
+ }
236
+ return combined;
237
+ }
238
+ const bytes = readByteString();
239
+ chunks.push(bytes);
240
+ totalLen += bytes.length;
241
+ }
242
+ throw new Error("expected break marker.");
243
+ }
244
+ function readListIndefinite(ns) {
245
+ pos += 1;
246
+ const memberSchema = ns.isListSchema() ? ns.getValueSchema() : ns;
247
+ const list = [];
248
+ while (pos < end) {
249
+ if (payload[pos] === 0xff) {
250
+ pos += 1;
251
+ return list;
252
+ }
253
+ list.push(readValue(memberSchema));
254
+ }
255
+ throw new Error("expected break marker.");
256
+ }
257
+ function readMapIndefinite(ns) {
258
+ pos += 1;
259
+ if (ns.isStructSchema()) {
260
+ const cache = loadCborStructIterator(ns);
261
+ const { memberSchemas, encodedKeys, memberNames } = cache;
262
+ const z = encodedKeys.length;
263
+ const isUnion = ns.isUnionSchema();
264
+ const result = {};
265
+ let unknownKey;
266
+ let unknownValue;
267
+ let unknownCount = 0;
268
+ let hint = 0;
269
+ while (pos < end) {
270
+ if (payload[pos] === 0xff) {
271
+ pos += 1;
272
+ if (isUnion) {
273
+ let resultEmpty = true;
274
+ for (const _ in result) {
275
+ resultEmpty = false;
276
+ break;
277
+ }
278
+ if (resultEmpty && unknownCount === 1) {
279
+ result.$unknown = [unknownKey, unknownValue];
280
+ }
281
+ }
282
+ return result;
283
+ }
284
+ const matchIdx = matchStructKey(encodedKeys, z, hint);
285
+ if (matchIdx >= 0) {
286
+ hint = matchIdx + 1;
287
+ if (hint >= z) {
288
+ hint = 0;
289
+ }
290
+ const val = readValue(memberSchemas[matchIdx]);
291
+ if (val != null) {
292
+ result[memberNames[matchIdx]] = val;
293
+ }
294
+ }
295
+ else {
296
+ const key = readUtf8String();
297
+ const val = readValue(NormalizedSchema.of(15));
298
+ if (key !== "__type") {
299
+ unknownKey = key;
300
+ unknownValue = val;
301
+ ++unknownCount;
302
+ }
303
+ }
304
+ }
305
+ throw new Error("expected break marker.");
306
+ }
307
+ const valueSchema = ns.isMapSchema() ? ns.getValueSchema() : ns;
308
+ const map = {};
309
+ while (pos < end) {
310
+ if (payload[pos] === 0xff) {
311
+ pos += 1;
312
+ return map;
313
+ }
314
+ const key = readUtf8String();
315
+ map[key] = readValue(valueSchema);
316
+ }
317
+ throw new Error("expected break marker.");
318
+ }
319
+ function matchStructKey(encodedKeys, z, hint) {
320
+ const hintKey = encodedKeys[hint];
321
+ if (pos + hintKey.length <= end && bytesMatch(pos, hintKey)) {
322
+ pos += hintKey.length;
323
+ return hint;
324
+ }
325
+ for (let i = 0; i < z; ++i) {
326
+ if (i === hint) {
327
+ continue;
328
+ }
329
+ const ek = encodedKeys[i];
330
+ if (pos + ek.length <= end && bytesMatch(pos, ek)) {
331
+ pos += ek.length;
332
+ return i;
333
+ }
334
+ }
335
+ return -1;
336
+ }
337
+ function bytesMatch(at, expected) {
338
+ const len = expected.length;
339
+ if (payload[at] !== expected[0]) {
340
+ return false;
341
+ }
342
+ for (let i = 1; i < len; ++i) {
343
+ if (payload[at + i] !== expected[i]) {
344
+ return false;
345
+ }
346
+ }
347
+ return true;
348
+ }
349
+ function decodeArgument() {
350
+ const minor = payload[pos] & 0b0001_1111;
351
+ if (minor < 24) {
352
+ pos += 1;
353
+ return minor;
354
+ }
355
+ switch (minor) {
356
+ case extendedOneByte:
357
+ if (end - pos < 2) {
358
+ overflow(1);
359
+ }
360
+ pos += 2;
361
+ return payload[pos - 1];
362
+ case extendedFloat16:
363
+ if (end - pos < 3) {
364
+ overflow(2);
365
+ }
366
+ pos += 3;
367
+ return dataView.getUint16(pos - 2);
368
+ case extendedFloat32:
369
+ if (end - pos < 5) {
370
+ overflow(4);
371
+ }
372
+ pos += 5;
373
+ return dataView.getUint32(pos - 4);
374
+ case extendedFloat64: {
375
+ if (end - pos < 9) {
376
+ overflow(8);
377
+ }
378
+ pos += 9;
379
+ const hi = dataView.getUint32(pos - 8);
380
+ if (hi < 0x00200000) {
381
+ return hi * 4294967296 + dataView.getUint32(pos - 4);
382
+ }
383
+ return dataView.getBigUint64(pos - 8);
384
+ }
385
+ default:
386
+ throw new Error(`unexpected minor value ${minor}.`);
387
+ }
388
+ }
389
+ function decodeCount() {
390
+ const val = decodeArgument();
391
+ return typeof val === "bigint" ? Number(val) : val;
392
+ }
393
+ function readUnsignedInt() {
394
+ const val = decodeArgument();
395
+ return castBigInt(val);
396
+ }
397
+ function readNegativeInt() {
398
+ const val = decodeArgument();
399
+ if (typeof val === "bigint") {
400
+ return BigInt(-1) - val;
401
+ }
402
+ return -1 - val;
403
+ }
404
+ function readByteString() {
405
+ const length = decodeCount();
406
+ if (end - pos < length) {
407
+ overflow(length);
408
+ }
409
+ const start = pos;
410
+ pos += length;
411
+ return payload.subarray(start, start + length);
412
+ }
413
+ function readUtf8String() {
414
+ const length = decodeCount();
415
+ if (end - pos < length) {
416
+ overflow(length);
417
+ }
418
+ const start = pos;
419
+ pos += length;
420
+ if (length < 24) {
421
+ return decodeUtf8Cached(start, length);
422
+ }
423
+ if (isBuffer) {
424
+ return payload.toString("utf-8", start, start + length);
425
+ }
426
+ return textDecoder.decode(payload.subarray(start, start + length));
427
+ }
428
+ function decodeUtf8Cached(at, length) {
429
+ let h = length;
430
+ for (let i = 0; i < length; ++i) {
431
+ h = (h * 31 + payload[at + i]) | 0;
432
+ }
433
+ const slot = (h >>> 0) & (STRING_CACHE_SIZE - 1);
434
+ const cached = stringCache[slot];
435
+ if (cached !== undefined && cached.length === length) {
436
+ let match = true;
437
+ for (let i = 0; i < length; ++i) {
438
+ if (cached.charCodeAt(i) !== payload[at + i]) {
439
+ match = false;
440
+ break;
441
+ }
442
+ }
443
+ if (match) {
444
+ stringCacheEpochs[slot] = cacheEpoch;
445
+ return cached;
446
+ }
447
+ }
448
+ const result = isBuffer
449
+ ? payload.toString("utf-8", at, at + length)
450
+ : textDecoder.decode(payload.subarray(at, at + length));
451
+ if (stringCacheEpochs[slot] !== cacheEpoch) {
452
+ stringCache[slot] = result;
453
+ stringCacheEpochs[slot] = cacheEpoch;
454
+ }
455
+ return result;
456
+ }
457
+ function readSpecial() {
458
+ const p = pos;
459
+ const minor = payload[p] & 0b0001_1111;
460
+ switch (minor) {
461
+ case specialTrue:
462
+ pos = p + 1;
463
+ return true;
464
+ case specialFalse:
465
+ pos = p + 1;
466
+ return false;
467
+ case specialNull:
468
+ pos = p + 1;
469
+ return null;
470
+ case specialUndefined:
471
+ pos = p + 1;
472
+ return null;
473
+ case extendedFloat16: {
474
+ if (end - p < 3) {
475
+ overflow(2);
476
+ }
477
+ pos = p + 3;
478
+ return bytesToFloat16(payload[p + 1], payload[p + 2]);
479
+ }
480
+ case extendedFloat32: {
481
+ if (end - p < 5) {
482
+ overflow(4);
483
+ }
484
+ pos = p + 5;
485
+ return dataView.getFloat32(p + 1);
486
+ }
487
+ case extendedFloat64: {
488
+ if (end - p < 9) {
489
+ overflow(8);
490
+ }
491
+ pos = p + 9;
492
+ return dataView.getFloat64(p + 1);
493
+ }
494
+ default:
495
+ throw new Error(`unexpected minor value ${minor} for major 7.`);
496
+ }
497
+ }
498
+ function bytesToFloat16(a, b) {
499
+ const sign = a >> 7;
500
+ const exponent = (a & 0b0111_1100) >> 2;
501
+ const fraction = ((a & 0b0000_0011) << 8) | b;
502
+ const scalar = sign === 0 ? 1 : -1;
503
+ if (exponent === 0b00000) {
504
+ if (fraction === 0) {
505
+ return 0;
506
+ }
507
+ return scalar * (Math.pow(2, 1 - 15) * (fraction / 1024));
508
+ }
509
+ else if (exponent === 0b11111) {
510
+ if (fraction === 0) {
511
+ return scalar * Infinity;
512
+ }
513
+ return NaN;
514
+ }
515
+ return scalar * (Math.pow(2, exponent - 15) * (1 + fraction / 1024));
516
+ }
517
+ function castBigInt(value) {
518
+ if (typeof value === "number") {
519
+ return value;
520
+ }
521
+ const num = Number(value);
522
+ if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {
523
+ return num;
524
+ }
525
+ return value;
526
+ }
527
+ function overflow(n) {
528
+ throw new Error(`CBOR: length ${n} greater than remaining buffer length.`);
529
+ }
530
+ function transformObject(ns, value) {
531
+ if (ns.isTimestampSchema()) {
532
+ if (typeof value === "number") {
533
+ return _parseEpochTimestamp(value);
534
+ }
535
+ if (typeof value === "object" && value !== null) {
536
+ if (value.tag === 1 && "value" in value) {
537
+ return _parseEpochTimestamp(value.value);
538
+ }
539
+ }
540
+ }
541
+ if (ns.isBlobSchema()) {
542
+ return value;
543
+ }
544
+ if (typeof value === "undefined" ||
545
+ typeof value === "boolean" ||
546
+ typeof value === "number" ||
547
+ typeof value === "string" ||
548
+ typeof value === "bigint" ||
549
+ typeof value === "symbol") {
550
+ return value;
551
+ }
552
+ if (typeof value !== "object" || value === null) {
553
+ return value;
554
+ }
555
+ if ("byteLength" in value) {
556
+ return value;
557
+ }
558
+ if (value instanceof Date) {
559
+ return value;
560
+ }
561
+ if (value instanceof NumericValue) {
562
+ return value;
563
+ }
564
+ if (ns.isDocumentSchema()) {
565
+ return value;
566
+ }
567
+ if (ns.isListSchema()) {
568
+ const memberSchema = ns.getValueSchema();
569
+ const out = [];
570
+ for (const item of value) {
571
+ out.push(transformObject(memberSchema, item));
572
+ }
573
+ return out;
574
+ }
575
+ const newObject = {};
576
+ if (ns.isMapSchema()) {
577
+ const targetSchema = ns.getValueSchema();
578
+ for (const key in value) {
579
+ newObject[key] = transformObject(targetSchema, value[key]);
580
+ }
581
+ }
582
+ else if (ns.isStructSchema()) {
583
+ const isUnion = ns.isUnionSchema();
584
+ let keys;
585
+ if (isUnion) {
586
+ keys = new Set();
587
+ for (const k in value) {
588
+ if (k !== "__type") {
589
+ keys.add(k);
590
+ }
591
+ }
592
+ }
593
+ for (const [key, memberSchema] of ns.structIterator()) {
594
+ if (isUnion) {
595
+ keys.delete(key);
596
+ }
597
+ if (value[key] != null) {
598
+ newObject[key] = transformObject(memberSchema, value[key]);
599
+ }
600
+ }
601
+ if (isUnion && keys?.size === 1) {
602
+ let newObjectEmpty = true;
603
+ for (const _ in newObject) {
604
+ newObjectEmpty = false;
605
+ break;
606
+ }
607
+ if (newObjectEmpty) {
608
+ const k = keys.values().next().value;
609
+ newObject.$unknown = [k, value[k]];
610
+ }
611
+ }
612
+ else if (typeof value.__type === "string") {
613
+ for (const k in value) {
614
+ if (!(k in newObject)) {
615
+ newObject[k] = value[k];
616
+ }
617
+ }
618
+ }
619
+ }
620
+ return newObject;
621
+ }