@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.
- package/.jsii +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +2 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/enums.js +1 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/DescribeChangeSetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/models_0.d.ts +7 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudformation/package.json +6 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +856 -57
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +8 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonCodec.js → codec-v1/JsonCodec.js} +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeDeserializer.js → codec-v1/JsonShapeDeserializer.js} +6 -6
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeSerializer.js → codec-v1/JsonShapeSerializer.js} +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +103 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +20 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{experimental/BufferJsonShapeDeserializer.js → codec-v2/JsonShapeDeserializer2.js} +38 -18
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{experimental/ByteJsonShapeSerializer.js → codec-v2/JsonShapeSerializer2.js} +66 -60
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +9 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonCodec.d.ts → codec-v1/JsonCodec.d.ts} +4 -8
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeDeserializer.d.ts → codec-v1/JsonShapeDeserializer.d.ts} +3 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeSerializer.d.ts → codec-v1/JsonShapeSerializer.d.ts} +3 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{experimental/BufferJsonShapeDeserializer.d.ts → codec-v2/JsonShapeDeserializer2.d.ts} +4 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{experimental/ByteJsonShapeSerializer.d.ts → codec-v2/JsonShapeSerializer2.d.ts} +19 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +4 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +61 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +13 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +4 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +5 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +16 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +4 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +107 -47
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +112 -39
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +107 -48
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +13 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +25 -35
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +14 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +2 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +16 -20
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +21 -44
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +8 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +14 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +7 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +6 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +6 -12
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +6 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +4 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +2 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +28 -38
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -638
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +29 -56
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +6 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +12 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +4 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +7 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +18 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +13 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +3 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +17 -28
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +4 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +9 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +39 -44
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +1 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +1 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +4 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +23 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +13 -38
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +57 -133
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +32 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +32 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +1 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +1 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +2 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +1 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +6 -26
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +1 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +5 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +40 -74
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +9 -24
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +36 -25
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +3 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +30 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +21 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +21 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +49 -29
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +49 -36
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +1 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +18 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +27 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +9 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +39 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +7 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +7 -15
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +2 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +14 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +18 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +57 -49
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +7 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +21 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +47 -31
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +17 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +15 -20
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/parseXmlBody.d.ts +4 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +1 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +3 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +14 -32
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +4 -2
- package/node_modules/@aws-sdk/core/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1561 -337
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -205
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +113 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +103 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +621 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +602 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +5 -1
- package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +5 -27
- package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +5 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -27
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +5 -1
- package/node_modules/@smithy/core/package.json +2 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/package.json +5 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +0 -19
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +0 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +0 -28
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +0 -29
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +0 -57
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
3
|
+
import { NumericValue, fromBase64, generateIdempotencyToken } from "@smithy/core/serde";
|
|
4
|
+
import { extendedFloat16, extendedFloat32, extendedFloat64, majorList, majorMap, majorNegativeInt64, majorSpecial, majorTag, majorUint64, majorUnstructuredByteString, majorUtf8String, specialFalse, specialNull, specialTrue, tagSymbol, } from "../cbor-types";
|
|
5
|
+
export class CborShapeSerializer2 extends SerdeContext {
|
|
6
|
+
write(schema, value) {
|
|
7
|
+
cursor = 0;
|
|
8
|
+
const ns = NormalizedSchema.of(schema);
|
|
9
|
+
writeValue(ns, value, undefined, this.serdeContext);
|
|
10
|
+
}
|
|
11
|
+
flush() {
|
|
12
|
+
const result = buf.subarray(0, cursor);
|
|
13
|
+
cursor = 0;
|
|
14
|
+
buf = allocUnsafe(INITIAL_BUFFER_SIZE);
|
|
15
|
+
view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function advanceSinglePassEncodingEpoch() {
|
|
20
|
+
encodeCacheEpoch = (encodeCacheEpoch + 1) & 0xffff;
|
|
21
|
+
encodeCacheSaturated = false;
|
|
22
|
+
}
|
|
23
|
+
const CBOR_STRUCT_CACHE = Symbol.for("@smithy/cbor-struct-cache");
|
|
24
|
+
export function loadCborStructIterator(ns) {
|
|
25
|
+
const schema = ns.getSchema();
|
|
26
|
+
const existing = schema[CBOR_STRUCT_CACHE];
|
|
27
|
+
if (existing) {
|
|
28
|
+
return existing;
|
|
29
|
+
}
|
|
30
|
+
const memberNames = [];
|
|
31
|
+
const memberSchemas = [];
|
|
32
|
+
for (const [name, memberSchema] of ns.structIterator()) {
|
|
33
|
+
memberNames.push(name);
|
|
34
|
+
memberSchemas.push(memberSchema);
|
|
35
|
+
}
|
|
36
|
+
const encodedKeys = new Array(memberNames.length);
|
|
37
|
+
for (let i = 0; i < memberNames.length; ++i) {
|
|
38
|
+
encodedKeys[i] = encodeCborStringKey(memberNames[i]);
|
|
39
|
+
}
|
|
40
|
+
const cache = { memberNames, memberSchemas, encodedKeys };
|
|
41
|
+
schema[CBOR_STRUCT_CACHE] = cache;
|
|
42
|
+
return cache;
|
|
43
|
+
}
|
|
44
|
+
function encodeCborStringKey(s) {
|
|
45
|
+
let utf8Bytes;
|
|
46
|
+
if (USE_BUFFER) {
|
|
47
|
+
utf8Bytes = Buffer.from(s, "utf-8");
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
utf8Bytes = new TextEncoder().encode(s);
|
|
51
|
+
}
|
|
52
|
+
const byteLen = utf8Bytes.length;
|
|
53
|
+
let headerSize;
|
|
54
|
+
if (byteLen < 24) {
|
|
55
|
+
headerSize = 1;
|
|
56
|
+
}
|
|
57
|
+
else if (byteLen < 256) {
|
|
58
|
+
headerSize = 2;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
headerSize = 3;
|
|
62
|
+
}
|
|
63
|
+
const result = new Uint8Array(headerSize + byteLen);
|
|
64
|
+
if (headerSize === 1) {
|
|
65
|
+
result[0] = (majorUtf8String << 5) | byteLen;
|
|
66
|
+
}
|
|
67
|
+
else if (headerSize === 2) {
|
|
68
|
+
result[0] = (majorUtf8String << 5) | 24;
|
|
69
|
+
result[1] = byteLen;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
result[0] = (majorUtf8String << 5) | extendedFloat16;
|
|
73
|
+
result[1] = byteLen >> 8;
|
|
74
|
+
result[2] = byteLen & 0xff;
|
|
75
|
+
}
|
|
76
|
+
result.set(utf8Bytes, headerSize);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
const USE_BUFFER = typeof Buffer !== "undefined";
|
|
80
|
+
const textEncoder = new TextEncoder();
|
|
81
|
+
const INITIAL_BUFFER_SIZE = 2048;
|
|
82
|
+
let buf = USE_BUFFER ? Buffer.allocUnsafe(INITIAL_BUFFER_SIZE) : new Uint8Array(INITIAL_BUFFER_SIZE);
|
|
83
|
+
let view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
84
|
+
let cursor = 0;
|
|
85
|
+
const STRING_CACHE_MAX = 2048;
|
|
86
|
+
const stringEncodeCache = new Map();
|
|
87
|
+
let encodeCacheEpoch = 0;
|
|
88
|
+
let encodeCacheSaturated = false;
|
|
89
|
+
function allocUnsafe(size) {
|
|
90
|
+
return USE_BUFFER ? Buffer.allocUnsafe(size) : new Uint8Array(size);
|
|
91
|
+
}
|
|
92
|
+
function writeValue(ns, value, container, serdeContext) {
|
|
93
|
+
if (value == null) {
|
|
94
|
+
if (value === undefined && ns.isIdempotencyToken()) {
|
|
95
|
+
writeString(generateIdempotencyToken());
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
ensure(1);
|
|
99
|
+
buf[cursor++] = (majorSpecial << 5) | specialNull;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (ns.isUnitSchema()) {
|
|
103
|
+
ensure(1);
|
|
104
|
+
encodeHeader(majorMap, 0);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const isObject = typeof value === "object";
|
|
108
|
+
if (isObject) {
|
|
109
|
+
if (ns.isBlobSchema()) {
|
|
110
|
+
if (value instanceof Uint8Array) {
|
|
111
|
+
writeBytes(value);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (ns.isTimestampSchema()) {
|
|
116
|
+
if (value instanceof Date) {
|
|
117
|
+
writeTimestamp(value);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (ns.isStructSchema()) {
|
|
122
|
+
writeStruct(ns, value, serdeContext);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
|
|
126
|
+
writeList(ns, value, ns.isDocumentSchema(), serdeContext);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (ns.isMapSchema()) {
|
|
130
|
+
writeMap(ns, value, false, serdeContext);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (value instanceof Date) {
|
|
134
|
+
writeTimestamp(value);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (value instanceof Uint8Array) {
|
|
138
|
+
writeBytes(value);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (value instanceof NumericValue) {
|
|
142
|
+
writeNumericValue(value);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (value[tagSymbol]) {
|
|
146
|
+
const tagged = value;
|
|
147
|
+
writeTag(tagged.tag, tagged.value);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (ns.isDocumentSchema()) {
|
|
151
|
+
if (Array.isArray(value)) {
|
|
152
|
+
writeList(ns, value, true, serdeContext);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
writeMap(ns, value, true, serdeContext);
|
|
156
|
+
}
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (ns.isBigDecimalSchema()) {
|
|
160
|
+
writeUntypedValue(value);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
writeMap(ns, value, true, serdeContext);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (typeof value === "string") {
|
|
167
|
+
if (ns.isBlobSchema()) {
|
|
168
|
+
const bytes = (serdeContext?.base64Decoder ?? fromBase64)(value);
|
|
169
|
+
writeBytes(bytes);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
writeString(value);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (typeof value === "number") {
|
|
176
|
+
ensure(9);
|
|
177
|
+
if (Number.isInteger(value) && value >= -0x20000000000000 && value <= 0x1fffffffffffff) {
|
|
178
|
+
writeInteger(value);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
writeFloat64(value);
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (typeof value === "boolean") {
|
|
186
|
+
ensure(1);
|
|
187
|
+
buf[cursor++] = (majorSpecial << 5) | (value ? specialTrue : specialFalse);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (typeof value === "bigint") {
|
|
191
|
+
writeBigInt(value);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
writeString(String(value));
|
|
195
|
+
}
|
|
196
|
+
function writeStruct(ns, value, serdeContext) {
|
|
197
|
+
if (ns.isUnionSchema()) {
|
|
198
|
+
let wrote = false;
|
|
199
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
200
|
+
const item = value[memberName];
|
|
201
|
+
if (item != null) {
|
|
202
|
+
ensure(9);
|
|
203
|
+
encodeHeader(majorMap, 1);
|
|
204
|
+
writeString(memberName);
|
|
205
|
+
writeValue(memberSchema, item, ns, serdeContext);
|
|
206
|
+
wrote = true;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (!wrote) {
|
|
211
|
+
const { $unknown } = value;
|
|
212
|
+
if (Array.isArray($unknown)) {
|
|
213
|
+
ensure(9);
|
|
214
|
+
encodeHeader(majorMap, 1);
|
|
215
|
+
writeString($unknown[0]);
|
|
216
|
+
writeUntypedValue($unknown[1]);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
ensure(9);
|
|
220
|
+
encodeHeader(majorMap, 0);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const cache = loadCborStructIterator(ns);
|
|
226
|
+
const { memberNames, memberSchemas, encodedKeys } = cache;
|
|
227
|
+
const z = memberNames.length;
|
|
228
|
+
let headerSize;
|
|
229
|
+
if (z < 24) {
|
|
230
|
+
headerSize = 1;
|
|
231
|
+
}
|
|
232
|
+
else if (z < 256) {
|
|
233
|
+
headerSize = 2;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
headerSize = 3;
|
|
237
|
+
}
|
|
238
|
+
ensure(headerSize);
|
|
239
|
+
const headerPos = cursor;
|
|
240
|
+
cursor += headerSize;
|
|
241
|
+
let count = 0;
|
|
242
|
+
for (let i = 0; i < z; ++i) {
|
|
243
|
+
const item = value[memberNames[i]];
|
|
244
|
+
if (item == null && !memberSchemas[i].isIdempotencyToken()) {
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const key = encodedKeys[i];
|
|
248
|
+
ensure(key.length);
|
|
249
|
+
buf.set(key, cursor);
|
|
250
|
+
cursor += key.length;
|
|
251
|
+
writeValue(memberSchemas[i], item, ns, serdeContext);
|
|
252
|
+
++count;
|
|
253
|
+
}
|
|
254
|
+
if (typeof value.__type === "string") {
|
|
255
|
+
for (const k in value) {
|
|
256
|
+
if (!memberNames.includes(k)) {
|
|
257
|
+
writeString(k);
|
|
258
|
+
writeUntypedValue(value[k]);
|
|
259
|
+
++count;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (headerSize === 1) {
|
|
264
|
+
buf[headerPos] = (majorMap << 5) | count;
|
|
265
|
+
}
|
|
266
|
+
else if (headerSize === 2) {
|
|
267
|
+
buf[headerPos] = (majorMap << 5) | 24;
|
|
268
|
+
buf[headerPos + 1] = count;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
buf[headerPos] = (majorMap << 5) | extendedFloat16;
|
|
272
|
+
buf[headerPos + 1] = count >> 8;
|
|
273
|
+
buf[headerPos + 2] = count & 0xff;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function writeList(ns, value, isDocument, serdeContext) {
|
|
277
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
278
|
+
const valueSchema = ns.getValueSchema();
|
|
279
|
+
if (isDocument || sparse) {
|
|
280
|
+
const items = [];
|
|
281
|
+
for (let i = 0; i < value.length; ++i) {
|
|
282
|
+
const item = value[i];
|
|
283
|
+
if (isDocument) {
|
|
284
|
+
if (item !== undefined) {
|
|
285
|
+
items.push(item);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
if (item != null || sparse) {
|
|
290
|
+
items.push(item);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
ensure(9);
|
|
295
|
+
encodeHeader(majorList, items.length);
|
|
296
|
+
for (let i = 0; i < items.length; ++i) {
|
|
297
|
+
writeValue(valueSchema, items[i], undefined, serdeContext);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
let count = 0;
|
|
302
|
+
for (let i = 0; i < value.length; ++i) {
|
|
303
|
+
if (value[i] != null) {
|
|
304
|
+
++count;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
ensure(9);
|
|
308
|
+
encodeHeader(majorList, count);
|
|
309
|
+
for (let i = 0; i < value.length; ++i) {
|
|
310
|
+
if (value[i] != null) {
|
|
311
|
+
writeValue(valueSchema, value[i], undefined, serdeContext);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
function writeMap(ns, value, isDocument, serdeContext) {
|
|
317
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
318
|
+
const valueSchema = ns.getValueSchema();
|
|
319
|
+
const keys = [];
|
|
320
|
+
for (const k in value) {
|
|
321
|
+
const v = value[k];
|
|
322
|
+
if (isDocument ? v !== undefined : v != null || sparse) {
|
|
323
|
+
keys.push(k);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
ensure(9);
|
|
327
|
+
encodeHeader(majorMap, keys.length);
|
|
328
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
329
|
+
const k = keys[i];
|
|
330
|
+
writeString(k);
|
|
331
|
+
writeValue(valueSchema, value[k], undefined, serdeContext);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function writeUntypedValue(value) {
|
|
335
|
+
if (value == null) {
|
|
336
|
+
ensure(1);
|
|
337
|
+
buf[cursor++] = (majorSpecial << 5) | specialNull;
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (typeof value === "string") {
|
|
341
|
+
writeString(value);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (typeof value === "number") {
|
|
345
|
+
ensure(9);
|
|
346
|
+
if (Number.isInteger(value) && value >= -0x20000000000000 && value <= 0x1fffffffffffff) {
|
|
347
|
+
writeInteger(value);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
writeFloat64(value);
|
|
351
|
+
}
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
if (typeof value === "boolean") {
|
|
355
|
+
ensure(1);
|
|
356
|
+
buf[cursor++] = (majorSpecial << 5) | (value ? specialTrue : specialFalse);
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
if (typeof value === "bigint") {
|
|
360
|
+
writeBigInt(value);
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
if (value instanceof Uint8Array) {
|
|
364
|
+
writeBytes(value);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (value instanceof Date) {
|
|
368
|
+
writeTimestamp(value);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (value instanceof NumericValue) {
|
|
372
|
+
writeNumericValue(value);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (value[tagSymbol]) {
|
|
376
|
+
const tagged = value;
|
|
377
|
+
writeTag(tagged.tag, tagged.value);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (Array.isArray(value)) {
|
|
381
|
+
ensure(9);
|
|
382
|
+
encodeHeader(majorList, value.length);
|
|
383
|
+
for (let i = 0; i < value.length; ++i) {
|
|
384
|
+
writeUntypedValue(value[i]);
|
|
385
|
+
}
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (typeof value === "object") {
|
|
389
|
+
const keys = Object.keys(value);
|
|
390
|
+
ensure(9);
|
|
391
|
+
encodeHeader(majorMap, keys.length);
|
|
392
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
393
|
+
writeString(keys[i]);
|
|
394
|
+
writeUntypedValue(value[keys[i]]);
|
|
395
|
+
}
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
writeString(String(value));
|
|
399
|
+
}
|
|
400
|
+
function ensure(n) {
|
|
401
|
+
if (cursor + n > buf.length) {
|
|
402
|
+
let newSize = buf.length * 2;
|
|
403
|
+
while (newSize < cursor + n) {
|
|
404
|
+
newSize *= 2;
|
|
405
|
+
}
|
|
406
|
+
const next = allocUnsafe(newSize);
|
|
407
|
+
next.set(buf.subarray(0, cursor));
|
|
408
|
+
buf = next;
|
|
409
|
+
view = new DataView(next.buffer, next.byteOffset, next.byteLength);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function encodeHeader(major, value) {
|
|
413
|
+
if (value < 24) {
|
|
414
|
+
buf[cursor++] = (major << 5) | value;
|
|
415
|
+
}
|
|
416
|
+
else if (value < 256) {
|
|
417
|
+
buf[cursor++] = (major << 5) | 24;
|
|
418
|
+
buf[cursor++] = value;
|
|
419
|
+
}
|
|
420
|
+
else if (value < 65536) {
|
|
421
|
+
buf[cursor++] = (major << 5) | extendedFloat16;
|
|
422
|
+
buf[cursor++] = value >> 8;
|
|
423
|
+
buf[cursor++] = value & 0xff;
|
|
424
|
+
}
|
|
425
|
+
else if (value < 4294967296) {
|
|
426
|
+
buf[cursor++] = (major << 5) | extendedFloat32;
|
|
427
|
+
view.setUint32(cursor, value);
|
|
428
|
+
cursor += 4;
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
buf[cursor++] = (major << 5) | extendedFloat64;
|
|
432
|
+
const hi = (value / 4294967296) | 0;
|
|
433
|
+
const lo = (value - hi * 4294967296) | 0;
|
|
434
|
+
view.setUint32(cursor, hi);
|
|
435
|
+
view.setUint32(cursor + 4, lo);
|
|
436
|
+
cursor += 8;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function encodeBigHeader(major, value) {
|
|
440
|
+
const n = Number(value);
|
|
441
|
+
if (n < 4294967296) {
|
|
442
|
+
encodeHeader(major, n);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
buf[cursor++] = (major << 5) | extendedFloat64;
|
|
446
|
+
view.setBigUint64(cursor, value);
|
|
447
|
+
cursor += 8;
|
|
448
|
+
}
|
|
449
|
+
function writeString(s) {
|
|
450
|
+
const len = s.length;
|
|
451
|
+
if (len <= 23) {
|
|
452
|
+
const cached = stringEncodeCache.get(s);
|
|
453
|
+
if (cached) {
|
|
454
|
+
ensure(cached.bytes.length);
|
|
455
|
+
buf.set(cached.bytes, cursor);
|
|
456
|
+
cursor += cached.bytes.length;
|
|
457
|
+
cached.epoch = encodeCacheEpoch;
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const start = cursor;
|
|
461
|
+
writeStringUncached(s, len);
|
|
462
|
+
const end = cursor;
|
|
463
|
+
const bytes = Uint8Array.prototype.slice.call(buf, start, end);
|
|
464
|
+
if (stringEncodeCache.size >= STRING_CACHE_MAX) {
|
|
465
|
+
if (encodeCacheSaturated) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
let evicted = 0;
|
|
469
|
+
for (const [key, entry] of stringEncodeCache) {
|
|
470
|
+
if (evicted >= 1024) {
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
if (entry.epoch !== encodeCacheEpoch) {
|
|
474
|
+
stringEncodeCache.delete(key);
|
|
475
|
+
++evicted;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (evicted === 0) {
|
|
479
|
+
encodeCacheSaturated = true;
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
if (stringEncodeCache.size < STRING_CACHE_MAX) {
|
|
484
|
+
stringEncodeCache.set(s, { epoch: encodeCacheEpoch, bytes });
|
|
485
|
+
}
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
writeStringUncached(s, len);
|
|
489
|
+
}
|
|
490
|
+
function writeStringUncached(s, len) {
|
|
491
|
+
if (USE_BUFFER) {
|
|
492
|
+
const maxBytes = len * 3;
|
|
493
|
+
ensure(maxBytes + 9);
|
|
494
|
+
const byteLen = Buffer.byteLength(s);
|
|
495
|
+
encodeHeader(majorUtf8String, byteLen);
|
|
496
|
+
cursor += buf.write(s, cursor);
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
const maxBytes = len * 3;
|
|
500
|
+
ensure(maxBytes + 9);
|
|
501
|
+
const headerPos = cursor;
|
|
502
|
+
const result = textEncoder.encodeInto(s, buf.subarray(headerPos + 9));
|
|
503
|
+
const byteLen = result.written;
|
|
504
|
+
let headerSize;
|
|
505
|
+
if (byteLen < 24) {
|
|
506
|
+
headerSize = 1;
|
|
507
|
+
}
|
|
508
|
+
else if (byteLen < 256) {
|
|
509
|
+
headerSize = 2;
|
|
510
|
+
}
|
|
511
|
+
else if (byteLen < 65536) {
|
|
512
|
+
headerSize = 3;
|
|
513
|
+
}
|
|
514
|
+
else if (byteLen < 4294967296) {
|
|
515
|
+
headerSize = 5;
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
headerSize = 9;
|
|
519
|
+
}
|
|
520
|
+
if (headerSize < 9) {
|
|
521
|
+
buf.copyWithin(headerPos + headerSize, headerPos + 9, headerPos + 9 + byteLen);
|
|
522
|
+
}
|
|
523
|
+
cursor = headerPos;
|
|
524
|
+
encodeHeader(majorUtf8String, byteLen);
|
|
525
|
+
cursor += byteLen;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
function writeFloat64(value) {
|
|
529
|
+
ensure(9);
|
|
530
|
+
buf[cursor++] = (majorSpecial << 5) | extendedFloat64;
|
|
531
|
+
view.setFloat64(cursor, value);
|
|
532
|
+
cursor += 8;
|
|
533
|
+
}
|
|
534
|
+
function writeInteger(value) {
|
|
535
|
+
ensure(9);
|
|
536
|
+
const nonNegative = value >= 0;
|
|
537
|
+
const major = nonNegative ? majorUint64 : majorNegativeInt64;
|
|
538
|
+
const abs = nonNegative ? value : -value - 1;
|
|
539
|
+
encodeHeader(major, abs);
|
|
540
|
+
}
|
|
541
|
+
function writeBigInt(value) {
|
|
542
|
+
const nonNegative = value >= 0;
|
|
543
|
+
const major = nonNegative ? majorUint64 : majorNegativeInt64;
|
|
544
|
+
const abs = nonNegative ? value : -value - BigInt(1);
|
|
545
|
+
if (abs < BigInt("18446744073709551616")) {
|
|
546
|
+
ensure(9);
|
|
547
|
+
encodeBigHeader(major, abs);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
const binaryStr = abs.toString(2);
|
|
551
|
+
const byteLen = Math.ceil(binaryStr.length / 8);
|
|
552
|
+
const bigIntBytes = new Uint8Array(byteLen);
|
|
553
|
+
let b = abs;
|
|
554
|
+
for (let i = byteLen - 1; i >= 0; --i) {
|
|
555
|
+
bigIntBytes[i] = Number(b & BigInt(255));
|
|
556
|
+
b >>= BigInt(8);
|
|
557
|
+
}
|
|
558
|
+
ensure(byteLen + 16);
|
|
559
|
+
buf[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011;
|
|
560
|
+
encodeHeader(majorUnstructuredByteString, byteLen);
|
|
561
|
+
buf.set(bigIntBytes, cursor);
|
|
562
|
+
cursor += byteLen;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function writeBytes(data) {
|
|
566
|
+
ensure(data.length + 9);
|
|
567
|
+
encodeHeader(majorUnstructuredByteString, data.length);
|
|
568
|
+
buf.set(data, cursor);
|
|
569
|
+
cursor += data.length;
|
|
570
|
+
}
|
|
571
|
+
function writeTag(tagValue, innerValue) {
|
|
572
|
+
ensure(9);
|
|
573
|
+
if (typeof tagValue === "bigint") {
|
|
574
|
+
encodeBigHeader(majorTag, tagValue);
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
encodeHeader(majorTag, tagValue);
|
|
578
|
+
}
|
|
579
|
+
writeUntypedValue(innerValue);
|
|
580
|
+
}
|
|
581
|
+
function writeNumericValue(nv) {
|
|
582
|
+
const decimalIndex = nv.string.indexOf(".");
|
|
583
|
+
const exponent = decimalIndex === -1 ? 0 : decimalIndex - nv.string.length + 1;
|
|
584
|
+
const mantissa = BigInt(nv.string.replace(".", ""));
|
|
585
|
+
ensure(9);
|
|
586
|
+
buf[cursor++] = 0b110_00100;
|
|
587
|
+
encodeHeader(majorList, 2);
|
|
588
|
+
ensure(9);
|
|
589
|
+
writeInteger(exponent);
|
|
590
|
+
writeBigInt(mantissa);
|
|
591
|
+
}
|
|
592
|
+
function writeTimestamp(date) {
|
|
593
|
+
ensure(18);
|
|
594
|
+
encodeHeader(majorTag, 1);
|
|
595
|
+
const epochSecs = date.getTime() / 1000;
|
|
596
|
+
if (Number.isInteger(epochSecs)) {
|
|
597
|
+
writeInteger(epochSecs);
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
writeFloat64(epochSecs);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
@@ -2,4 +2,8 @@ export { cbor } from "./cbor";
|
|
|
2
2
|
export { tag, tagSymbol } from "./cbor-types";
|
|
3
3
|
export { buildHttpRpcRequest, checkCborResponse, dateToTag, loadSmithyRpcV2CborErrorCode, parseCborBody, parseCborErrorBody, } from "./parseCborBody";
|
|
4
4
|
export { SmithyRpcV2CborProtocol } from "./SmithyRpcV2CborProtocol";
|
|
5
|
-
export { CborCodec
|
|
5
|
+
export { CborCodec } from "./CborCodec";
|
|
6
|
+
export { CborShapeSerializer } from "./codec-v1/CborShapeSerializer";
|
|
7
|
+
export { CborShapeDeserializer } from "./codec-v1/CborShapeDeserializer";
|
|
8
|
+
export { CborShapeSerializer2 } from "./codec-v2/CborShapeSerializer2";
|
|
9
|
+
export { CborShapeDeserializer2 } from "./codec-v2/CborShapeDeserializer2";
|
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
-
import type { Codec
|
|
2
|
+
import type { Codec } from "@smithy/types";
|
|
3
|
+
import { CborShapeSerializer2 } from "./codec-v2/CborShapeSerializer2";
|
|
4
|
+
import { CborShapeDeserializer2 } from "./codec-v2/CborShapeDeserializer2";
|
|
3
5
|
/**
|
|
4
6
|
* @public
|
|
5
7
|
*/
|
|
6
8
|
export declare class CborCodec extends SerdeContext implements Codec<Uint8Array, Uint8Array> {
|
|
7
|
-
createSerializer():
|
|
8
|
-
createDeserializer():
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class CborShapeSerializer extends SerdeContext implements ShapeSerializer {
|
|
14
|
-
private value;
|
|
15
|
-
write(schema: Schema, value: unknown): void;
|
|
16
|
-
/**
|
|
17
|
-
* Recursive serializer transform that copies and prepares the user input object
|
|
18
|
-
* for CBOR serialization.
|
|
19
|
-
*/
|
|
20
|
-
serialize(schema: Schema, source: unknown): any;
|
|
21
|
-
flush(): Uint8Array;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export declare class CborShapeDeserializer extends SerdeContext implements ShapeDeserializer {
|
|
27
|
-
read(schema: Schema, bytes: Uint8Array): any;
|
|
28
|
-
/**
|
|
29
|
-
* Public because it's called by the protocol implementation to deserialize errors.
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
readValue(_schema: Schema, value: any): any;
|
|
9
|
+
createSerializer(): CborShapeSerializer2;
|
|
10
|
+
createDeserializer(): CborShapeDeserializer2;
|
|
33
11
|
}
|
|
@@ -13,8 +13,8 @@ export declare class SmithyRpcV2CborProtocol extends RpcProtocol {
|
|
|
13
13
|
*/
|
|
14
14
|
protected compositeErrorRegistry: TypeRegistry;
|
|
15
15
|
private codec;
|
|
16
|
-
protected serializer: import("
|
|
17
|
-
protected deserializer: import("
|
|
16
|
+
protected serializer: import(".").CborShapeSerializer2;
|
|
17
|
+
protected deserializer: import(".").CborShapeDeserializer2;
|
|
18
18
|
constructor({ defaultNamespace, errorTypeRegistries, }: {
|
|
19
19
|
defaultNamespace: string;
|
|
20
20
|
errorTypeRegistries?: TypeRegistry[];
|
package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
+
import type { Schema, ShapeDeserializer } from "@smithy/types";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class CborShapeDeserializer extends SerdeContext implements ShapeDeserializer {
|
|
7
|
+
read(schema: Schema, bytes: Uint8Array): any;
|
|
8
|
+
/**
|
|
9
|
+
* Public because it's called by the protocol implementation to deserialize errors.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
readValue(_schema: Schema, value: any): any;
|
|
13
|
+
}
|
package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
+
import type { Schema, ShapeSerializer } from "@smithy/types";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class CborShapeSerializer extends SerdeContext implements ShapeSerializer {
|
|
7
|
+
private value;
|
|
8
|
+
write(schema: Schema, value: unknown): void;
|
|
9
|
+
/**
|
|
10
|
+
* Recursive serializer transform that copies and prepares the user input object
|
|
11
|
+
* for CBOR serialization.
|
|
12
|
+
*/
|
|
13
|
+
serialize(schema: Schema, source: unknown): any;
|
|
14
|
+
flush(): Uint8Array;
|
|
15
|
+
}
|