@cdklabs/cdk-ecs-codedeploy 0.0.449 → 0.0.451
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/api-canary/index.js +1 -1
- package/lib/ecs-appspec/index.js +1 -1
- package/lib/ecs-deployment/index.js +1 -1
- package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
- package/node_modules/@aws-sdk/client-codedeploy/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-codedeploy/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-codedeploy/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-codedeploy/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-codedeploy/package.json +6 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +66 -28
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +989 -72
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +7 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +28 -14
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.js +8 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.browser.js +9 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +5 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +12 -6
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js +1 -1
- 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} +14 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeSerializer.js → codec-v1/JsonShapeSerializer.js} +12 -2
- 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/codec-v2/JsonShapeDeserializer2.js +200 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +489 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js +18 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +22 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js +41 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +33 -13
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/writeKey.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +22 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.browser.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.d.ts +7 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +22 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/index.d.ts +2 -1
- 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/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/needsReviver.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +7 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +32 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +10 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +9 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- 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/{JsonCodec.d.ts → codec-v1/JsonCodec.d.ts} +3 -5
- 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/{JsonShapeDeserializer.d.ts → codec-v1/JsonShapeDeserializer.d.ts} +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/{JsonShapeSerializer.d.ts → codec-v1/JsonShapeSerializer.d.ts} +2 -2
- 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 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +11 -6
- 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/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +2 -0
- 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/@aws-sdk/xml-builder/dist-cjs/index.js +14 -4
- package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +14 -4
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1562 -338
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +34 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +34 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -205
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +1 -1
- 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-es/submodules/event-streams/EventStreamSerde.js +34 -11
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -2
- 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/submodules/event-streams/EventStreamSerde.d.ts +10 -2
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/constants.d.ts +1 -0
- 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/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +10 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/constants.d.ts +1 -0
- 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 +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +0 -135
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -17
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { Crc32 } = require("@smithy/core/checksum");
|
|
2
2
|
const { toHex, fromHex, toUtf8, fromUtf8 } = require("@smithy/core/serde");
|
|
3
|
+
const { TypeRegistry } = require("@smithy/core/schema");
|
|
3
4
|
|
|
4
5
|
class Int64 {
|
|
5
6
|
bytes;
|
|
@@ -591,12 +592,14 @@ class EventStreamSerde {
|
|
|
591
592
|
deserializer;
|
|
592
593
|
serdeContext;
|
|
593
594
|
defaultContentType;
|
|
594
|
-
|
|
595
|
+
compositeErrorRegistry;
|
|
596
|
+
constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {
|
|
595
597
|
this.marshaller = marshaller;
|
|
596
598
|
this.serializer = serializer;
|
|
597
599
|
this.deserializer = deserializer;
|
|
598
600
|
this.serdeContext = serdeContext;
|
|
599
601
|
this.defaultContentType = defaultContentType;
|
|
602
|
+
this.compositeErrorRegistry = compositeErrorRegistry;
|
|
600
603
|
}
|
|
601
604
|
async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
|
|
602
605
|
const marshaller = this.marshaller;
|
|
@@ -712,16 +715,9 @@ class EventStreamSerde {
|
|
|
712
715
|
}
|
|
713
716
|
}
|
|
714
717
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
if (body.byteLength === 0) {
|
|
721
|
-
return {
|
|
722
|
-
[unionMember]: {},
|
|
723
|
-
};
|
|
724
|
-
}
|
|
718
|
+
return {
|
|
719
|
+
[unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),
|
|
720
|
+
};
|
|
725
721
|
}
|
|
726
722
|
return {
|
|
727
723
|
[unionMember]: await this.deserializer.read(eventStreamSchema, body),
|
|
@@ -761,6 +757,33 @@ class EventStreamSerde {
|
|
|
761
757
|
},
|
|
762
758
|
};
|
|
763
759
|
}
|
|
760
|
+
async readEventMember(eventStreamSchema, body, hasBindings, out) {
|
|
761
|
+
let ErrCtor;
|
|
762
|
+
const staticStructuralSchema = eventStreamSchema.getSchema();
|
|
763
|
+
if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {
|
|
764
|
+
const namespace = staticStructuralSchema[1];
|
|
765
|
+
const nsRegistry = TypeRegistry.for(namespace);
|
|
766
|
+
this.compositeErrorRegistry?.copyFrom(nsRegistry);
|
|
767
|
+
ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);
|
|
768
|
+
}
|
|
769
|
+
const dataObject = hasBindings
|
|
770
|
+
? out
|
|
771
|
+
: body.byteLength === 0
|
|
772
|
+
? {}
|
|
773
|
+
: await this.deserializer.read(eventStreamSchema, body);
|
|
774
|
+
if (ErrCtor) {
|
|
775
|
+
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
776
|
+
const metadata = {};
|
|
777
|
+
const $fault = eventStreamSchema.getMergedTraits().error;
|
|
778
|
+
if ($fault) {
|
|
779
|
+
metadata.$fault = $fault;
|
|
780
|
+
}
|
|
781
|
+
return Object.assign(new ErrCtor({}), metadata, {
|
|
782
|
+
message,
|
|
783
|
+
}, dataObject);
|
|
784
|
+
}
|
|
785
|
+
return dataObject;
|
|
786
|
+
}
|
|
764
787
|
writeEventBody(unionMember, unionSchema, event) {
|
|
765
788
|
const serializer = this.serializer;
|
|
766
789
|
let eventType = unionMember;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { Crc32 } = require("@smithy/core/checksum");
|
|
2
2
|
const { toHex, fromHex, toUtf8, fromUtf8 } = require("@smithy/core/serde");
|
|
3
3
|
const { Readable } = require("node:stream");
|
|
4
|
+
const { TypeRegistry } = require("@smithy/core/schema");
|
|
4
5
|
|
|
5
6
|
class Int64 {
|
|
6
7
|
bytes;
|
|
@@ -616,12 +617,14 @@ class EventStreamSerde {
|
|
|
616
617
|
deserializer;
|
|
617
618
|
serdeContext;
|
|
618
619
|
defaultContentType;
|
|
619
|
-
|
|
620
|
+
compositeErrorRegistry;
|
|
621
|
+
constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {
|
|
620
622
|
this.marshaller = marshaller;
|
|
621
623
|
this.serializer = serializer;
|
|
622
624
|
this.deserializer = deserializer;
|
|
623
625
|
this.serdeContext = serdeContext;
|
|
624
626
|
this.defaultContentType = defaultContentType;
|
|
627
|
+
this.compositeErrorRegistry = compositeErrorRegistry;
|
|
625
628
|
}
|
|
626
629
|
async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
|
|
627
630
|
const marshaller = this.marshaller;
|
|
@@ -737,16 +740,9 @@ class EventStreamSerde {
|
|
|
737
740
|
}
|
|
738
741
|
}
|
|
739
742
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
|
-
if (body.byteLength === 0) {
|
|
746
|
-
return {
|
|
747
|
-
[unionMember]: {},
|
|
748
|
-
};
|
|
749
|
-
}
|
|
743
|
+
return {
|
|
744
|
+
[unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),
|
|
745
|
+
};
|
|
750
746
|
}
|
|
751
747
|
return {
|
|
752
748
|
[unionMember]: await this.deserializer.read(eventStreamSchema, body),
|
|
@@ -786,6 +782,33 @@ class EventStreamSerde {
|
|
|
786
782
|
},
|
|
787
783
|
};
|
|
788
784
|
}
|
|
785
|
+
async readEventMember(eventStreamSchema, body, hasBindings, out) {
|
|
786
|
+
let ErrCtor;
|
|
787
|
+
const staticStructuralSchema = eventStreamSchema.getSchema();
|
|
788
|
+
if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {
|
|
789
|
+
const namespace = staticStructuralSchema[1];
|
|
790
|
+
const nsRegistry = TypeRegistry.for(namespace);
|
|
791
|
+
this.compositeErrorRegistry?.copyFrom(nsRegistry);
|
|
792
|
+
ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);
|
|
793
|
+
}
|
|
794
|
+
const dataObject = hasBindings
|
|
795
|
+
? out
|
|
796
|
+
: body.byteLength === 0
|
|
797
|
+
? {}
|
|
798
|
+
: await this.deserializer.read(eventStreamSchema, body);
|
|
799
|
+
if (ErrCtor) {
|
|
800
|
+
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
801
|
+
const metadata = {};
|
|
802
|
+
const $fault = eventStreamSchema.getMergedTraits().error;
|
|
803
|
+
if ($fault) {
|
|
804
|
+
metadata.$fault = $fault;
|
|
805
|
+
}
|
|
806
|
+
return Object.assign(new ErrCtor({}), metadata, {
|
|
807
|
+
message,
|
|
808
|
+
}, dataObject);
|
|
809
|
+
}
|
|
810
|
+
return dataObject;
|
|
811
|
+
}
|
|
789
812
|
writeEventBody(unionMember, unionSchema, event) {
|
|
790
813
|
const serializer = this.serializer;
|
|
791
814
|
let eventType = unionMember;
|
|
@@ -155,6 +155,7 @@ class HttpProtocol extends SerdeContext {
|
|
|
155
155
|
deserializer: this.deserializer,
|
|
156
156
|
serdeContext: this.serdeContext,
|
|
157
157
|
defaultContentType: this.getDefaultContentType(),
|
|
158
|
+
compositeErrorRegistry: this.compositeErrorRegistry,
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
161
|
resolveEventStreamMarshaller(importedProvider) {
|
|
@@ -5,6 +5,7 @@ const { parseRfc7231DateTime, v4 } = require("@smithy/core/serde");
|
|
|
5
5
|
const isStreamingPayload = (request) => request?.body instanceof ReadableStream;
|
|
6
6
|
|
|
7
7
|
const CLOCK_SKEW_ERROR_CODES = [
|
|
8
|
+
"AccessDeniedException",
|
|
8
9
|
"AuthFailure",
|
|
9
10
|
"InvalidSignatureException",
|
|
10
11
|
"RequestExpired",
|
|
@@ -7,6 +7,7 @@ const isStreamingPayload = (request) => request?.body instanceof Readable ||
|
|
|
7
7
|
(typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream);
|
|
8
8
|
|
|
9
9
|
const CLOCK_SKEW_ERROR_CODES = [
|
|
10
|
+
"AccessDeniedException",
|
|
10
11
|
"AuthFailure",
|
|
11
12
|
"InvalidSignatureException",
|
|
12
13
|
"RequestExpired",
|
|
@@ -775,7 +775,7 @@ const splitHeader = (value) => {
|
|
|
775
775
|
});
|
|
776
776
|
};
|
|
777
777
|
|
|
778
|
-
const format =
|
|
778
|
+
const format = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
|
|
779
779
|
class NumericValue {
|
|
780
780
|
string;
|
|
781
781
|
type;
|
|
@@ -783,7 +783,7 @@ class NumericValue {
|
|
|
783
783
|
this.string = string;
|
|
784
784
|
this.type = type;
|
|
785
785
|
if (!format.test(string)) {
|
|
786
|
-
throw new Error(`@smithy/core/serde - NumericValue must
|
|
786
|
+
throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string}"`);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
789
|
toString() {
|
|
@@ -743,7 +743,7 @@ const splitHeader = (value) => {
|
|
|
743
743
|
});
|
|
744
744
|
};
|
|
745
745
|
|
|
746
|
-
const format =
|
|
746
|
+
const format = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
|
|
747
747
|
class NumericValue {
|
|
748
748
|
string;
|
|
749
749
|
type;
|
|
@@ -751,7 +751,7 @@ class NumericValue {
|
|
|
751
751
|
this.string = string;
|
|
752
752
|
this.type = type;
|
|
753
753
|
if (!format.test(string)) {
|
|
754
|
-
throw new Error(`@smithy/core/serde - NumericValue must
|
|
754
|
+
throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string}"`);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
toString() {
|
|
@@ -775,7 +775,7 @@ const splitHeader = (value) => {
|
|
|
775
775
|
});
|
|
776
776
|
};
|
|
777
777
|
|
|
778
|
-
const format =
|
|
778
|
+
const format = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
|
|
779
779
|
class NumericValue {
|
|
780
780
|
string;
|
|
781
781
|
type;
|
|
@@ -783,7 +783,7 @@ class NumericValue {
|
|
|
783
783
|
this.string = string;
|
|
784
784
|
this.type = type;
|
|
785
785
|
if (!format.test(string)) {
|
|
786
|
-
throw new Error(`@smithy/core/serde - NumericValue must
|
|
786
|
+
throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string}"`);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
789
|
toString() {
|
|
@@ -1,216 +1,15 @@
|
|
|
1
1
|
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cbor } from "./cbor";
|
|
5
|
-
import { dateToTag } from "./parseCborBody";
|
|
2
|
+
import { CborShapeSerializer2 } from "./codec-v2/CborShapeSerializer2";
|
|
3
|
+
import { CborShapeDeserializer2 } from "./codec-v2/CborShapeDeserializer2";
|
|
6
4
|
export class CborCodec extends SerdeContext {
|
|
7
5
|
createSerializer() {
|
|
8
|
-
const serializer = new
|
|
6
|
+
const serializer = new CborShapeSerializer2();
|
|
9
7
|
serializer.setSerdeContext(this.serdeContext);
|
|
10
8
|
return serializer;
|
|
11
9
|
}
|
|
12
10
|
createDeserializer() {
|
|
13
|
-
const deserializer = new
|
|
11
|
+
const deserializer = new CborShapeDeserializer2();
|
|
14
12
|
deserializer.setSerdeContext(this.serdeContext);
|
|
15
13
|
return deserializer;
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
export class CborShapeSerializer extends SerdeContext {
|
|
19
|
-
value;
|
|
20
|
-
write(schema, value) {
|
|
21
|
-
this.value = this.serialize(schema, value);
|
|
22
|
-
}
|
|
23
|
-
serialize(schema, source) {
|
|
24
|
-
const ns = NormalizedSchema.of(schema);
|
|
25
|
-
if (source == null) {
|
|
26
|
-
if (ns.isIdempotencyToken()) {
|
|
27
|
-
return generateIdempotencyToken();
|
|
28
|
-
}
|
|
29
|
-
return source;
|
|
30
|
-
}
|
|
31
|
-
if (ns.isBlobSchema()) {
|
|
32
|
-
if (typeof source === "string") {
|
|
33
|
-
return (this.serdeContext?.base64Decoder ?? fromBase64)(source);
|
|
34
|
-
}
|
|
35
|
-
return source;
|
|
36
|
-
}
|
|
37
|
-
if (ns.isTimestampSchema()) {
|
|
38
|
-
if (typeof source === "number" || typeof source === "bigint") {
|
|
39
|
-
return dateToTag(new Date((Number(source) / 1000) | 0));
|
|
40
|
-
}
|
|
41
|
-
return dateToTag(source);
|
|
42
|
-
}
|
|
43
|
-
if (typeof source === "function" || typeof source === "object") {
|
|
44
|
-
const sourceObject = source;
|
|
45
|
-
if (ns.isListSchema() && Array.isArray(sourceObject)) {
|
|
46
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
47
|
-
const newArray = [];
|
|
48
|
-
let i = 0;
|
|
49
|
-
for (const item of sourceObject) {
|
|
50
|
-
const value = this.serialize(ns.getValueSchema(), item);
|
|
51
|
-
if (value != null || sparse) {
|
|
52
|
-
newArray[i++] = value;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return newArray;
|
|
56
|
-
}
|
|
57
|
-
if (sourceObject instanceof Date) {
|
|
58
|
-
return dateToTag(sourceObject);
|
|
59
|
-
}
|
|
60
|
-
const newObject = {};
|
|
61
|
-
if (ns.isMapSchema()) {
|
|
62
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
63
|
-
for (const key in sourceObject) {
|
|
64
|
-
const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
|
|
65
|
-
if (value != null || sparse) {
|
|
66
|
-
newObject[key] = value;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (ns.isStructSchema()) {
|
|
71
|
-
for (const [key, memberSchema] of ns.structIterator()) {
|
|
72
|
-
const value = this.serialize(memberSchema, sourceObject[key]);
|
|
73
|
-
if (value != null) {
|
|
74
|
-
newObject[key] = value;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const isUnion = ns.isUnionSchema();
|
|
78
|
-
if (isUnion && Array.isArray(sourceObject.$unknown)) {
|
|
79
|
-
const [k, v] = sourceObject.$unknown;
|
|
80
|
-
newObject[k] = v;
|
|
81
|
-
}
|
|
82
|
-
else if (typeof sourceObject.__type === "string") {
|
|
83
|
-
for (const k in sourceObject) {
|
|
84
|
-
if (!(k in newObject)) {
|
|
85
|
-
newObject[k] = this.serialize(15, sourceObject[k]);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (ns.isDocumentSchema()) {
|
|
91
|
-
for (const key in sourceObject) {
|
|
92
|
-
newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else if (ns.isBigDecimalSchema()) {
|
|
96
|
-
return sourceObject;
|
|
97
|
-
}
|
|
98
|
-
return newObject;
|
|
99
|
-
}
|
|
100
|
-
return source;
|
|
101
|
-
}
|
|
102
|
-
flush() {
|
|
103
|
-
const buffer = cbor.serialize(this.value);
|
|
104
|
-
this.value = undefined;
|
|
105
|
-
return buffer;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
export class CborShapeDeserializer extends SerdeContext {
|
|
109
|
-
read(schema, bytes) {
|
|
110
|
-
const data = cbor.deserialize(bytes);
|
|
111
|
-
return this.readValue(schema, data);
|
|
112
|
-
}
|
|
113
|
-
readValue(_schema, value) {
|
|
114
|
-
const ns = NormalizedSchema.of(_schema);
|
|
115
|
-
if (ns.isTimestampSchema()) {
|
|
116
|
-
if (typeof value === "number") {
|
|
117
|
-
return _parseEpochTimestamp(value);
|
|
118
|
-
}
|
|
119
|
-
if (typeof value === "object") {
|
|
120
|
-
if (value.tag === 1 && "value" in value) {
|
|
121
|
-
return _parseEpochTimestamp(value.value);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (ns.isBlobSchema()) {
|
|
126
|
-
if (typeof value === "string") {
|
|
127
|
-
return (this.serdeContext?.base64Decoder ?? fromBase64)(value);
|
|
128
|
-
}
|
|
129
|
-
return value;
|
|
130
|
-
}
|
|
131
|
-
if (typeof value === "undefined" ||
|
|
132
|
-
typeof value === "boolean" ||
|
|
133
|
-
typeof value === "number" ||
|
|
134
|
-
typeof value === "string" ||
|
|
135
|
-
typeof value === "bigint" ||
|
|
136
|
-
typeof value === "symbol") {
|
|
137
|
-
return value;
|
|
138
|
-
}
|
|
139
|
-
else if (typeof value === "object") {
|
|
140
|
-
if (value === null) {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
if ("byteLength" in value) {
|
|
144
|
-
return value;
|
|
145
|
-
}
|
|
146
|
-
if (value instanceof Date) {
|
|
147
|
-
return value;
|
|
148
|
-
}
|
|
149
|
-
if (ns.isDocumentSchema()) {
|
|
150
|
-
return value;
|
|
151
|
-
}
|
|
152
|
-
if (ns.isListSchema()) {
|
|
153
|
-
const newArray = [];
|
|
154
|
-
const memberSchema = ns.getValueSchema();
|
|
155
|
-
for (const item of value) {
|
|
156
|
-
const itemValue = this.readValue(memberSchema, item);
|
|
157
|
-
newArray.push(itemValue);
|
|
158
|
-
}
|
|
159
|
-
return newArray;
|
|
160
|
-
}
|
|
161
|
-
const newObject = {};
|
|
162
|
-
if (ns.isMapSchema()) {
|
|
163
|
-
const targetSchema = ns.getValueSchema();
|
|
164
|
-
for (const key in value) {
|
|
165
|
-
const itemValue = this.readValue(targetSchema, value[key]);
|
|
166
|
-
newObject[key] = itemValue;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
else if (ns.isStructSchema()) {
|
|
170
|
-
const isUnion = ns.isUnionSchema();
|
|
171
|
-
let keys;
|
|
172
|
-
if (isUnion) {
|
|
173
|
-
keys = new Set();
|
|
174
|
-
for (const k in value) {
|
|
175
|
-
if (k !== "__type") {
|
|
176
|
-
keys.add(k);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
for (const [key, memberSchema] of ns.structIterator()) {
|
|
181
|
-
if (isUnion) {
|
|
182
|
-
keys.delete(key);
|
|
183
|
-
}
|
|
184
|
-
if (value[key] != null) {
|
|
185
|
-
newObject[key] = this.readValue(memberSchema, value[key]);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (isUnion && keys?.size === 1) {
|
|
189
|
-
let newObjectEmpty = true;
|
|
190
|
-
for (const _ in newObject) {
|
|
191
|
-
newObjectEmpty = false;
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
if (newObjectEmpty) {
|
|
195
|
-
const k = keys.values().next().value;
|
|
196
|
-
newObject.$unknown = [k, value[k]];
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else if (typeof value.__type === "string") {
|
|
200
|
-
for (const k in value) {
|
|
201
|
-
if (!(k in newObject)) {
|
|
202
|
-
newObject[k] = value[k];
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
else if (value instanceof NumericValue) {
|
|
208
|
-
return value;
|
|
209
|
-
}
|
|
210
|
-
return newObject;
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
return value;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -141,7 +141,7 @@ export function bytesToFloat16(a, b) {
|
|
|
141
141
|
}
|
|
142
142
|
function decodeMap(at, to) {
|
|
143
143
|
const mapDataLength = decodeCount(at, to);
|
|
144
|
-
if (mapDataLength <
|
|
144
|
+
if (mapDataLength < 25) {
|
|
145
145
|
return decodeMapSmall(at, to, mapDataLength);
|
|
146
146
|
}
|
|
147
147
|
return decodeMapLarge(at, to, mapDataLength);
|
|
@@ -59,7 +59,7 @@ export function encode(_input) {
|
|
|
59
59
|
ensureSpace(64);
|
|
60
60
|
}
|
|
61
61
|
if (typeof input === "number") {
|
|
62
|
-
if (Number.isInteger(input)) {
|
|
62
|
+
if (Number.isInteger(input) && input >= -0x20000000000000 && input <= 0x1fffffffffffff) {
|
|
63
63
|
const nonNegative = input >= 0;
|
|
64
64
|
const major = nonNegative ? majorUint64 : majorNegativeInt64;
|
|
65
65
|
const value = nonNegative ? input : -input - 1;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
3
|
+
import { NumericValue, _parseEpochTimestamp, fromBase64 } from "@smithy/core/serde";
|
|
4
|
+
import { cbor } from "../cbor";
|
|
5
|
+
export class CborShapeDeserializer extends SerdeContext {
|
|
6
|
+
read(schema, bytes) {
|
|
7
|
+
const data = cbor.deserialize(bytes);
|
|
8
|
+
return this.readValue(schema, data);
|
|
9
|
+
}
|
|
10
|
+
readValue(_schema, value) {
|
|
11
|
+
const ns = NormalizedSchema.of(_schema);
|
|
12
|
+
if (ns.isTimestampSchema()) {
|
|
13
|
+
if (typeof value === "number") {
|
|
14
|
+
return _parseEpochTimestamp(value);
|
|
15
|
+
}
|
|
16
|
+
if (typeof value === "object") {
|
|
17
|
+
if (value.tag === 1 && "value" in value) {
|
|
18
|
+
return _parseEpochTimestamp(value.value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (ns.isBlobSchema()) {
|
|
23
|
+
if (typeof value === "string") {
|
|
24
|
+
return (this.serdeContext?.base64Decoder ?? fromBase64)(value);
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
if (typeof value === "undefined" ||
|
|
29
|
+
typeof value === "boolean" ||
|
|
30
|
+
typeof value === "number" ||
|
|
31
|
+
typeof value === "string" ||
|
|
32
|
+
typeof value === "bigint" ||
|
|
33
|
+
typeof value === "symbol") {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
else if (typeof value === "object") {
|
|
37
|
+
if (value === null) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if ("byteLength" in value) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
if (value instanceof Date) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
if (ns.isDocumentSchema()) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
if (ns.isListSchema()) {
|
|
50
|
+
const newArray = [];
|
|
51
|
+
const memberSchema = ns.getValueSchema();
|
|
52
|
+
for (const item of value) {
|
|
53
|
+
const itemValue = this.readValue(memberSchema, item);
|
|
54
|
+
newArray.push(itemValue);
|
|
55
|
+
}
|
|
56
|
+
return newArray;
|
|
57
|
+
}
|
|
58
|
+
const newObject = {};
|
|
59
|
+
if (ns.isMapSchema()) {
|
|
60
|
+
const targetSchema = ns.getValueSchema();
|
|
61
|
+
for (const key in value) {
|
|
62
|
+
const itemValue = this.readValue(targetSchema, value[key]);
|
|
63
|
+
newObject[key] = itemValue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else if (ns.isStructSchema()) {
|
|
67
|
+
const isUnion = ns.isUnionSchema();
|
|
68
|
+
let keys;
|
|
69
|
+
if (isUnion) {
|
|
70
|
+
keys = new Set();
|
|
71
|
+
for (const k in value) {
|
|
72
|
+
if (k !== "__type") {
|
|
73
|
+
keys.add(k);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const [key, memberSchema] of ns.structIterator()) {
|
|
78
|
+
if (isUnion) {
|
|
79
|
+
keys.delete(key);
|
|
80
|
+
}
|
|
81
|
+
if (value[key] != null) {
|
|
82
|
+
newObject[key] = this.readValue(memberSchema, value[key]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (isUnion && keys?.size === 1) {
|
|
86
|
+
let newObjectEmpty = true;
|
|
87
|
+
for (const _ in newObject) {
|
|
88
|
+
newObjectEmpty = false;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
if (newObjectEmpty) {
|
|
92
|
+
const k = keys.values().next().value;
|
|
93
|
+
newObject.$unknown = [k, value[k]];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else if (typeof value.__type === "string") {
|
|
97
|
+
for (const k in value) {
|
|
98
|
+
if (!(k in newObject)) {
|
|
99
|
+
newObject[k] = value[k];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (value instanceof NumericValue) {
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
return newObject;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|