@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
|
@@ -193,56 +193,6 @@ class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
const _toStr = (val) => {
|
|
197
|
-
if (val == null) {
|
|
198
|
-
return val;
|
|
199
|
-
}
|
|
200
|
-
if (typeof val === "number" || typeof val === "bigint") {
|
|
201
|
-
const warning = new Error(`Received number ${val} where a string was expected.`);
|
|
202
|
-
warning.name = "Warning";
|
|
203
|
-
console.warn(warning);
|
|
204
|
-
return String(val);
|
|
205
|
-
}
|
|
206
|
-
if (typeof val === "boolean") {
|
|
207
|
-
const warning = new Error(`Received boolean ${val} where a string was expected.`);
|
|
208
|
-
warning.name = "Warning";
|
|
209
|
-
console.warn(warning);
|
|
210
|
-
return String(val);
|
|
211
|
-
}
|
|
212
|
-
return val;
|
|
213
|
-
};
|
|
214
|
-
const _toBool = (val) => {
|
|
215
|
-
if (val == null) {
|
|
216
|
-
return val;
|
|
217
|
-
}
|
|
218
|
-
if (typeof val === "string") {
|
|
219
|
-
const lowercase = val.toLowerCase();
|
|
220
|
-
if (val !== "" && lowercase !== "false" && lowercase !== "true") {
|
|
221
|
-
const warning = new Error(`Received string "${val}" where a boolean was expected.`);
|
|
222
|
-
warning.name = "Warning";
|
|
223
|
-
console.warn(warning);
|
|
224
|
-
}
|
|
225
|
-
return val !== "" && lowercase !== "false";
|
|
226
|
-
}
|
|
227
|
-
return val;
|
|
228
|
-
};
|
|
229
|
-
const _toNum = (val) => {
|
|
230
|
-
if (val == null) {
|
|
231
|
-
return val;
|
|
232
|
-
}
|
|
233
|
-
if (typeof val === "string") {
|
|
234
|
-
const num = Number(val);
|
|
235
|
-
if (num.toString() !== val) {
|
|
236
|
-
const warning = new Error(`Received string "${val}" where a number was expected.`);
|
|
237
|
-
warning.name = "Warning";
|
|
238
|
-
console.warn(warning);
|
|
239
|
-
return val;
|
|
240
|
-
}
|
|
241
|
-
return num;
|
|
242
|
-
}
|
|
243
|
-
return val;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
196
|
class SerdeContextConfig {
|
|
247
197
|
serdeContext;
|
|
248
198
|
setSerdeContext(serdeContext) {
|
|
@@ -281,12 +231,18 @@ function jsonReviver(key, value, context) {
|
|
|
281
231
|
if (context?.source) {
|
|
282
232
|
const numericString = context.source;
|
|
283
233
|
if (typeof value === "number") {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (
|
|
234
|
+
const inSafeRange = value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER;
|
|
235
|
+
if (!inSafeRange || numericString !== String(value)) {
|
|
236
|
+
if (inSafeRange && /[eE]/.test(numericString) && String(Number(numericString)) === String(value)) {
|
|
237
|
+
return value;
|
|
238
|
+
}
|
|
239
|
+
if (isFractionalNumeric(numericString)) {
|
|
287
240
|
return new NumericValue(numericString, "bigDecimal");
|
|
288
241
|
}
|
|
289
242
|
else {
|
|
243
|
+
if (/[eE]/.test(numericString)) {
|
|
244
|
+
return BigInt(Number(numericString));
|
|
245
|
+
}
|
|
290
246
|
return BigInt(numericString);
|
|
291
247
|
}
|
|
292
248
|
}
|
|
@@ -294,25 +250,114 @@ function jsonReviver(key, value, context) {
|
|
|
294
250
|
}
|
|
295
251
|
return value;
|
|
296
252
|
}
|
|
253
|
+
function isFractionalNumeric(s) {
|
|
254
|
+
const dotIndex = s.indexOf(".");
|
|
255
|
+
if (dotIndex === -1) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
const eIndex = s.search(/[eE]/);
|
|
259
|
+
if (eIndex === -1) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
const fracDigits = eIndex - dotIndex - 1;
|
|
263
|
+
const exp = parseInt(s.slice(eIndex + 1), 10);
|
|
264
|
+
return exp < fracDigits;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const REVIVER_SYMBOL = Symbol.for("@aws-sdk/reviver");
|
|
268
|
+
function needsReviver(schema) {
|
|
269
|
+
const ns = NormalizedSchema.of(schema);
|
|
270
|
+
const raw = ns.getSchema();
|
|
271
|
+
if (Array.isArray(raw) && ns.isStructSchema()) {
|
|
272
|
+
if (REVIVER_SYMBOL in raw) {
|
|
273
|
+
return raw[REVIVER_SYMBOL];
|
|
274
|
+
}
|
|
275
|
+
const result = _check(ns, new Set());
|
|
276
|
+
raw[REVIVER_SYMBOL] = result;
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
return _check(ns, new Set());
|
|
280
|
+
}
|
|
281
|
+
function _check(ns, seen) {
|
|
282
|
+
const raw = ns.getSchema();
|
|
283
|
+
if (seen.has(raw)) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
seen.add(raw);
|
|
287
|
+
if (ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
if (ns.isStructSchema()) {
|
|
291
|
+
for (const [, memberSchema] of ns.structIterator()) {
|
|
292
|
+
if (_check(memberSchema, seen)) {
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else if (ns.isListSchema() || ns.isMapSchema()) {
|
|
298
|
+
if (_check(ns.getValueSchema(), seen)) {
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
else if (ns.isDocumentSchema()) {
|
|
303
|
+
return true;
|
|
304
|
+
}
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
297
307
|
|
|
298
308
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? toUtf8)(body));
|
|
299
309
|
|
|
300
|
-
|
|
301
|
-
|
|
310
|
+
let canParseBuffer;
|
|
311
|
+
function detectBufferParsing() {
|
|
312
|
+
if (canParseBuffer === undefined) {
|
|
302
313
|
try {
|
|
303
|
-
|
|
314
|
+
if (typeof Buffer !== "function") {
|
|
315
|
+
canParseBuffer = false;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
const result = JSON.parse(Buffer.from([0x7b, 0x7d]));
|
|
319
|
+
canParseBuffer = result !== null && typeof result === "object";
|
|
320
|
+
}
|
|
304
321
|
}
|
|
305
|
-
catch
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
322
|
+
catch {
|
|
323
|
+
canParseBuffer = false;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return canParseBuffer;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
async function parseJsonBody(streamBody, context, schema) {
|
|
330
|
+
let parsingInput;
|
|
331
|
+
if (detectBufferParsing() && typeof streamBody?.[Symbol.asyncIterator] === "function") {
|
|
332
|
+
const buffer = await collectBody(streamBody, context);
|
|
333
|
+
if (typeof Buffer === "function") {
|
|
334
|
+
if (Buffer.isBuffer(buffer)) {
|
|
335
|
+
parsingInput = buffer;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
parsingInput = Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
310
339
|
}
|
|
311
|
-
throw e;
|
|
312
340
|
}
|
|
313
341
|
}
|
|
314
|
-
|
|
315
|
-
|
|
342
|
+
if (!parsingInput) {
|
|
343
|
+
parsingInput = await collectBodyString(streamBody, context);
|
|
344
|
+
}
|
|
345
|
+
if (parsingInput.length === 0) {
|
|
346
|
+
return {};
|
|
347
|
+
}
|
|
348
|
+
const reviver = schema && needsReviver(schema) ? jsonReviver : undefined;
|
|
349
|
+
try {
|
|
350
|
+
return JSON.parse(parsingInput, reviver);
|
|
351
|
+
}
|
|
352
|
+
catch (e) {
|
|
353
|
+
if (e?.name === "SyntaxError") {
|
|
354
|
+
Object.defineProperty(e, "$responseBodyText", {
|
|
355
|
+
value: typeof parsingInput === "string" ? parsingInput : parsingInput.toString("utf8"),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
throw e;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
316
361
|
const parseJsonErrorBody = async (errorBody, context) => {
|
|
317
362
|
const value = await parseJsonBody(errorBody, context);
|
|
318
363
|
value.message = value.message ?? value.Message;
|
|
@@ -366,6 +411,10 @@ const loadErrorCode = ({ headers }, data, order) => {
|
|
|
366
411
|
}
|
|
367
412
|
};
|
|
368
413
|
|
|
414
|
+
function writeKey(obj) {
|
|
415
|
+
Object.defineProperty(obj, "__proto__", { value: undefined, writable: true, enumerable: true, configurable: true });
|
|
416
|
+
}
|
|
417
|
+
|
|
369
418
|
class JsonShapeDeserializer extends SerdeContextConfig {
|
|
370
419
|
settings;
|
|
371
420
|
constructor(settings) {
|
|
@@ -373,7 +422,8 @@ class JsonShapeDeserializer extends SerdeContextConfig {
|
|
|
373
422
|
this.settings = settings;
|
|
374
423
|
}
|
|
375
424
|
async read(schema, data) {
|
|
376
|
-
|
|
425
|
+
const reviver = needsReviver(schema) ? jsonReviver : undefined;
|
|
426
|
+
return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
|
|
377
427
|
}
|
|
378
428
|
readObject(schema, data) {
|
|
379
429
|
return this._read(schema, data);
|
|
@@ -434,6 +484,9 @@ class JsonShapeDeserializer extends SerdeContextConfig {
|
|
|
434
484
|
const mapMember = ns.getValueSchema();
|
|
435
485
|
const out = {};
|
|
436
486
|
for (const _k in value) {
|
|
487
|
+
if (_k === "__proto__") {
|
|
488
|
+
writeKey(out);
|
|
489
|
+
}
|
|
437
490
|
out[_k] = this._read(mapMember, value[_k]);
|
|
438
491
|
}
|
|
439
492
|
return out;
|
|
@@ -492,6 +545,9 @@ class JsonShapeDeserializer extends SerdeContextConfig {
|
|
|
492
545
|
if (isObject) {
|
|
493
546
|
const out = Array.isArray(value) ? [] : {};
|
|
494
547
|
for (const k in value) {
|
|
548
|
+
if (k === "__proto__") {
|
|
549
|
+
writeKey(out);
|
|
550
|
+
}
|
|
495
551
|
const v = value[k];
|
|
496
552
|
if (v instanceof NumericValue) {
|
|
497
553
|
out[k] = v;
|
|
@@ -617,6 +673,9 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
617
673
|
const { $unknown } = record;
|
|
618
674
|
if (Array.isArray($unknown)) {
|
|
619
675
|
const [k, v] = $unknown;
|
|
676
|
+
if (k === "__proto__") {
|
|
677
|
+
writeKey(out);
|
|
678
|
+
}
|
|
620
679
|
out[k] = this._write(15, v);
|
|
621
680
|
}
|
|
622
681
|
}
|
|
@@ -649,6 +708,9 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
649
708
|
for (const _k in value) {
|
|
650
709
|
const _v = value[_k];
|
|
651
710
|
if (sparse || _v != null) {
|
|
711
|
+
if (_k === "__proto__") {
|
|
712
|
+
writeKey(out);
|
|
713
|
+
}
|
|
652
714
|
out[_k] = this._write(mapMember, _v);
|
|
653
715
|
}
|
|
654
716
|
}
|
|
@@ -714,6 +776,9 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
714
776
|
const out = Array.isArray(value) ? [] : {};
|
|
715
777
|
for (const k in value) {
|
|
716
778
|
const v = value[k];
|
|
779
|
+
if (k === "__proto__") {
|
|
780
|
+
writeKey(out);
|
|
781
|
+
}
|
|
717
782
|
if (v instanceof NumericValue) {
|
|
718
783
|
this.useReplacer = true;
|
|
719
784
|
out[k] = v;
|
|
@@ -947,15 +1012,801 @@ class AwsRestJsonProtocol extends HttpBindingProtocol {
|
|
|
947
1012
|
}
|
|
948
1013
|
}
|
|
949
1014
|
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1015
|
+
class JsonShapeDeserializer2 extends SerdeContextConfig {
|
|
1016
|
+
settings;
|
|
1017
|
+
constructor(settings) {
|
|
1018
|
+
super();
|
|
1019
|
+
this.settings = settings;
|
|
953
1020
|
}
|
|
954
|
-
|
|
955
|
-
|
|
1021
|
+
async read(schema, data) {
|
|
1022
|
+
const reviver = needsReviver(schema) ? jsonReviver : undefined;
|
|
1023
|
+
let parsed;
|
|
1024
|
+
if (typeof data === "string") {
|
|
1025
|
+
if (data.length === 0) {
|
|
1026
|
+
return {};
|
|
1027
|
+
}
|
|
1028
|
+
parsed = JSON.parse(data, reviver);
|
|
1029
|
+
}
|
|
1030
|
+
else if (data instanceof Uint8Array && detectBufferParsing()) {
|
|
1031
|
+
if (data.byteLength === 0) {
|
|
1032
|
+
return {};
|
|
1033
|
+
}
|
|
1034
|
+
const buf = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
1035
|
+
parsed = JSON.parse(buf, reviver);
|
|
1036
|
+
}
|
|
1037
|
+
else {
|
|
1038
|
+
parsed = await parseJsonBody(data, this.serdeContext, schema);
|
|
1039
|
+
}
|
|
1040
|
+
return this._read(schema, parsed);
|
|
956
1041
|
}
|
|
957
|
-
|
|
958
|
-
|
|
1042
|
+
readObject(schema, data) {
|
|
1043
|
+
return this._read(schema, data);
|
|
1044
|
+
}
|
|
1045
|
+
_read(schema, value) {
|
|
1046
|
+
const isObject = value !== null && typeof value === "object";
|
|
1047
|
+
const ns = NormalizedSchema.of(schema);
|
|
1048
|
+
if (isObject) {
|
|
1049
|
+
if (ns.isStructSchema()) {
|
|
1050
|
+
return this._readStruct(ns, value);
|
|
1051
|
+
}
|
|
1052
|
+
if (Array.isArray(value) && ns.isListSchema()) {
|
|
1053
|
+
const listMember = ns.getValueSchema();
|
|
1054
|
+
if (this.needsTransform(listMember)) {
|
|
1055
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1056
|
+
value[i] = this._read(listMember, value[i]);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
return value;
|
|
1060
|
+
}
|
|
1061
|
+
if (ns.isMapSchema()) {
|
|
1062
|
+
const mapMember = ns.getValueSchema();
|
|
1063
|
+
const map = value;
|
|
1064
|
+
if (this.needsTransform(mapMember)) {
|
|
1065
|
+
for (const k in map) {
|
|
1066
|
+
if (k === "__proto__") {
|
|
1067
|
+
writeKey(map);
|
|
1068
|
+
}
|
|
1069
|
+
map[k] = this._read(mapMember, map[k]);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
return map;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
if (ns.isBlobSchema() && typeof value === "string") {
|
|
1076
|
+
return fromBase64(value);
|
|
1077
|
+
}
|
|
1078
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
1079
|
+
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
|
|
1080
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
1081
|
+
if (isJson) {
|
|
1082
|
+
return LazyJsonString.from(value);
|
|
1083
|
+
}
|
|
1084
|
+
return value;
|
|
1085
|
+
}
|
|
1086
|
+
if (ns.isTimestampSchema() && value != null) {
|
|
1087
|
+
const format = determineTimestampFormat(ns, this.settings);
|
|
1088
|
+
switch (format) {
|
|
1089
|
+
case 5:
|
|
1090
|
+
return parseRfc3339DateTimeWithOffset(value);
|
|
1091
|
+
case 6:
|
|
1092
|
+
return parseRfc7231DateTime(value);
|
|
1093
|
+
case 7:
|
|
1094
|
+
return parseEpochTimestamp(value);
|
|
1095
|
+
default:
|
|
1096
|
+
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
|
|
1097
|
+
return new Date(value);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
|
|
1101
|
+
return BigInt(value);
|
|
1102
|
+
}
|
|
1103
|
+
if (ns.isBigDecimalSchema() && value != undefined) {
|
|
1104
|
+
if (value instanceof NumericValue) {
|
|
1105
|
+
return value;
|
|
1106
|
+
}
|
|
1107
|
+
const untyped = value;
|
|
1108
|
+
if (untyped.type === "bigDecimal" && "string" in untyped) {
|
|
1109
|
+
return new NumericValue(untyped.string, untyped.type);
|
|
1110
|
+
}
|
|
1111
|
+
return new NumericValue(String(value), "bigDecimal");
|
|
1112
|
+
}
|
|
1113
|
+
if (ns.isNumericSchema() && typeof value === "string") {
|
|
1114
|
+
switch (value) {
|
|
1115
|
+
case "Infinity":
|
|
1116
|
+
return Infinity;
|
|
1117
|
+
case "-Infinity":
|
|
1118
|
+
return -Infinity;
|
|
1119
|
+
case "NaN":
|
|
1120
|
+
return NaN;
|
|
1121
|
+
}
|
|
1122
|
+
return value;
|
|
1123
|
+
}
|
|
1124
|
+
if (ns.isDocumentSchema()) {
|
|
1125
|
+
if (isObject) {
|
|
1126
|
+
if (Array.isArray(value)) {
|
|
1127
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1128
|
+
const v = value[i];
|
|
1129
|
+
if (!(v instanceof NumericValue)) {
|
|
1130
|
+
value[i] = this._read(ns, v);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
else {
|
|
1135
|
+
const doc = value;
|
|
1136
|
+
for (const k in doc) {
|
|
1137
|
+
if (k === "__proto__") {
|
|
1138
|
+
writeKey(doc);
|
|
1139
|
+
}
|
|
1140
|
+
const v = doc[k];
|
|
1141
|
+
if (!(v instanceof NumericValue)) {
|
|
1142
|
+
doc[k] = this._read(ns, v);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
return value;
|
|
1149
|
+
}
|
|
1150
|
+
_readStruct(ns, record) {
|
|
1151
|
+
const union = ns.isUnionSchema();
|
|
1152
|
+
const out = {};
|
|
1153
|
+
let nameMap;
|
|
1154
|
+
const hasType = typeof record.__type === "string";
|
|
1155
|
+
const { jsonName } = this.settings;
|
|
1156
|
+
if (jsonName && hasType) {
|
|
1157
|
+
nameMap = {};
|
|
1158
|
+
}
|
|
1159
|
+
let unionSerde;
|
|
1160
|
+
if (union) {
|
|
1161
|
+
unionSerde = new UnionSerde(record, out);
|
|
1162
|
+
}
|
|
1163
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
1164
|
+
let fromKey = memberName;
|
|
1165
|
+
if (jsonName) {
|
|
1166
|
+
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
|
|
1167
|
+
if (hasType) {
|
|
1168
|
+
nameMap[fromKey] = memberName;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
if (union) {
|
|
1172
|
+
unionSerde.mark(fromKey);
|
|
1173
|
+
}
|
|
1174
|
+
if (record[fromKey] != null) {
|
|
1175
|
+
out[memberName] = this._read(memberSchema, record[fromKey]);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
if (union) {
|
|
1179
|
+
unionSerde.writeUnknown();
|
|
1180
|
+
}
|
|
1181
|
+
else if (hasType) {
|
|
1182
|
+
for (const k in record) {
|
|
1183
|
+
const v = record[k];
|
|
1184
|
+
const t = jsonName ? (nameMap[k] ?? k) : k;
|
|
1185
|
+
if (!(t in out)) {
|
|
1186
|
+
out[t] = v;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
return out;
|
|
1191
|
+
}
|
|
1192
|
+
needsTransform(ns) {
|
|
1193
|
+
if (ns.isBlobSchema() || ns.isTimestampSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
|
|
1194
|
+
return true;
|
|
1195
|
+
}
|
|
1196
|
+
if (ns.isDocumentSchema() || ns.isStructSchema() || ns.isListSchema() || ns.isMapSchema()) {
|
|
1197
|
+
return true;
|
|
1198
|
+
}
|
|
1199
|
+
if (ns.isStringSchema() && ns.getMergedTraits().mediaType) {
|
|
1200
|
+
return true;
|
|
1201
|
+
}
|
|
1202
|
+
return false;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
class JsonBytesStringAdapter extends Uint8Array {
|
|
1207
|
+
string = null;
|
|
1208
|
+
static allocUnsafe(bytes) {
|
|
1209
|
+
if (typeof Buffer === "function") {
|
|
1210
|
+
const buffer = Buffer.allocUnsafe(bytes);
|
|
1211
|
+
return new JsonBytesStringAdapter(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
1212
|
+
}
|
|
1213
|
+
return new JsonBytesStringAdapter(bytes);
|
|
1214
|
+
}
|
|
1215
|
+
toString() {
|
|
1216
|
+
return this.s();
|
|
1217
|
+
}
|
|
1218
|
+
valueOf() {
|
|
1219
|
+
return this.s();
|
|
1220
|
+
}
|
|
1221
|
+
includes(searchString, position) {
|
|
1222
|
+
if (typeof searchString === "string") {
|
|
1223
|
+
return this.s().includes(searchString, position);
|
|
1224
|
+
}
|
|
1225
|
+
return Uint8Array.prototype.includes.call(this, searchString, position);
|
|
1226
|
+
}
|
|
1227
|
+
indexOf(searchString, position) {
|
|
1228
|
+
if (typeof searchString === "string") {
|
|
1229
|
+
return this.s().indexOf(searchString, position);
|
|
1230
|
+
}
|
|
1231
|
+
return Uint8Array.prototype.indexOf.call(this, searchString, position);
|
|
1232
|
+
}
|
|
1233
|
+
lastIndexOf(searchString, position) {
|
|
1234
|
+
if (typeof searchString === "string") {
|
|
1235
|
+
return this.s().lastIndexOf(searchString, position);
|
|
1236
|
+
}
|
|
1237
|
+
const fn = Uint8Array.prototype.lastIndexOf;
|
|
1238
|
+
if (position !== undefined) {
|
|
1239
|
+
return fn.call(this, searchString, position);
|
|
1240
|
+
}
|
|
1241
|
+
return fn.call(this, searchString);
|
|
1242
|
+
}
|
|
1243
|
+
startsWith(searchString, position) {
|
|
1244
|
+
return this.s().startsWith(searchString, position);
|
|
1245
|
+
}
|
|
1246
|
+
endsWith(searchString, endPosition) {
|
|
1247
|
+
return this.s().endsWith(searchString, endPosition);
|
|
1248
|
+
}
|
|
1249
|
+
match(regexp) {
|
|
1250
|
+
return this.s().match(regexp);
|
|
1251
|
+
}
|
|
1252
|
+
replace(searchValue, replaceValue) {
|
|
1253
|
+
return this.s().replace(searchValue, replaceValue);
|
|
1254
|
+
}
|
|
1255
|
+
search(regexp) {
|
|
1256
|
+
return this.s().search(regexp);
|
|
1257
|
+
}
|
|
1258
|
+
split(separator, limit) {
|
|
1259
|
+
return this.s().split(separator, limit);
|
|
1260
|
+
}
|
|
1261
|
+
substring(start, end) {
|
|
1262
|
+
return this.s().substring(start, end);
|
|
1263
|
+
}
|
|
1264
|
+
trim() {
|
|
1265
|
+
return this.s().trim();
|
|
1266
|
+
}
|
|
1267
|
+
trimStart() {
|
|
1268
|
+
return this.s().trimStart();
|
|
1269
|
+
}
|
|
1270
|
+
trimEnd() {
|
|
1271
|
+
return this.s().trimEnd();
|
|
1272
|
+
}
|
|
1273
|
+
charAt(pos) {
|
|
1274
|
+
return this.s().charAt(pos);
|
|
1275
|
+
}
|
|
1276
|
+
charCodeAt(index) {
|
|
1277
|
+
return this.s().charCodeAt(index);
|
|
1278
|
+
}
|
|
1279
|
+
padStart(maxLength, fillString) {
|
|
1280
|
+
return this.s().padStart(maxLength, fillString);
|
|
1281
|
+
}
|
|
1282
|
+
padEnd(maxLength, fillString) {
|
|
1283
|
+
return this.s().padEnd(maxLength, fillString);
|
|
1284
|
+
}
|
|
1285
|
+
repeat(count) {
|
|
1286
|
+
return this.s().repeat(count);
|
|
1287
|
+
}
|
|
1288
|
+
toUpperCase() {
|
|
1289
|
+
return this.s().toUpperCase();
|
|
1290
|
+
}
|
|
1291
|
+
toLowerCase() {
|
|
1292
|
+
return this.s().toLowerCase();
|
|
1293
|
+
}
|
|
1294
|
+
s() {
|
|
1295
|
+
if (this.string == null) {
|
|
1296
|
+
const n = Date.now();
|
|
1297
|
+
if (n > warned + 60_000) {
|
|
1298
|
+
console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. " +
|
|
1299
|
+
"It has been automatically converted to string. In a future version this will throw an error.");
|
|
1300
|
+
warned = n;
|
|
1301
|
+
}
|
|
1302
|
+
this.string = toUtf8(this);
|
|
1303
|
+
}
|
|
1304
|
+
return this.string;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
var warned = 0;
|
|
1308
|
+
|
|
1309
|
+
const encoder = new TextEncoder();
|
|
1310
|
+
const OPEN_BRACE = 0x7b;
|
|
1311
|
+
const CLOSE_BRACE = 0x7d;
|
|
1312
|
+
const OPEN_BRACKET = 0x5b;
|
|
1313
|
+
const CLOSE_BRACKET = 0x5d;
|
|
1314
|
+
const QUOTE = 0x22;
|
|
1315
|
+
const COLON = 0x3a;
|
|
1316
|
+
const COMMA = 0x2c;
|
|
1317
|
+
const BACKSLASH = 0x5c;
|
|
1318
|
+
const TRUE = new Uint8Array([0x74, 0x72, 0x75, 0x65]);
|
|
1319
|
+
const FALSE = new Uint8Array([0x66, 0x61, 0x6c, 0x73, 0x65]);
|
|
1320
|
+
const NULL = new Uint8Array([0x6e, 0x75, 0x6c, 0x6c]);
|
|
1321
|
+
const ESCAPE_TABLE = new Array(128).fill(null);
|
|
1322
|
+
ESCAPE_TABLE[0x08] = "b";
|
|
1323
|
+
ESCAPE_TABLE[0x09] = "t";
|
|
1324
|
+
ESCAPE_TABLE[0x0a] = "n";
|
|
1325
|
+
ESCAPE_TABLE[0x0c] = "f";
|
|
1326
|
+
ESCAPE_TABLE[0x0d] = "r";
|
|
1327
|
+
ESCAPE_TABLE[0x22] = '"';
|
|
1328
|
+
ESCAPE_TABLE[0x5c] = "\\";
|
|
1329
|
+
for (let i = 0; i < 0x20; i++) {
|
|
1330
|
+
if (ESCAPE_TABLE[i] === null) {
|
|
1331
|
+
ESCAPE_TABLE[i] = "u00" + i.toString(16).padStart(2, "0");
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
const INITIAL_BUFFER_SIZE = 2048;
|
|
1335
|
+
function alloc(size) {
|
|
1336
|
+
return JsonBytesStringAdapter.allocUnsafe(size);
|
|
1337
|
+
}
|
|
1338
|
+
class JsonShapeSerializer2 extends SerdeContextConfig {
|
|
1339
|
+
settings;
|
|
1340
|
+
json;
|
|
1341
|
+
i = 0;
|
|
1342
|
+
rootSchema;
|
|
1343
|
+
rawValue;
|
|
1344
|
+
passthrough = false;
|
|
1345
|
+
constructor(settings) {
|
|
1346
|
+
super();
|
|
1347
|
+
this.settings = settings;
|
|
1348
|
+
this.json = alloc(INITIAL_BUFFER_SIZE);
|
|
1349
|
+
}
|
|
1350
|
+
write(schema, value) {
|
|
1351
|
+
this.i = 0;
|
|
1352
|
+
this.rawValue = value;
|
|
1353
|
+
this.rootSchema = NormalizedSchema.of(schema);
|
|
1354
|
+
this.passthrough = this.rootSchema.isBlobSchema() || this.rootSchema.isStringSchema();
|
|
1355
|
+
if (!this.passthrough) {
|
|
1356
|
+
this.writeValue(this.rootSchema, value, undefined);
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
writeDiscriminatedDocument(schema, value) {
|
|
1360
|
+
this.i = 0;
|
|
1361
|
+
this.rootSchema = NormalizedSchema.of(schema);
|
|
1362
|
+
const ns = this.rootSchema;
|
|
1363
|
+
if (ns.isStructSchema() && value != null && typeof value === "object") {
|
|
1364
|
+
this.writeValue(ns, value, undefined);
|
|
1365
|
+
const prefix = `"__type":"${ns.getName(true) ?? "Unknown"}",`;
|
|
1366
|
+
const z = prefix.length;
|
|
1367
|
+
this.ensure(z);
|
|
1368
|
+
this.json.copyWithin(1 + z, 1, this.i);
|
|
1369
|
+
encoder.encodeInto(prefix, this.json.subarray(1));
|
|
1370
|
+
this.i += z;
|
|
1371
|
+
}
|
|
1372
|
+
else {
|
|
1373
|
+
this.writeValue(ns, value, undefined);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
flush() {
|
|
1377
|
+
this.rootSchema = undefined;
|
|
1378
|
+
const finalPosition = this.i;
|
|
1379
|
+
this.i = 0;
|
|
1380
|
+
const raw = this.rawValue;
|
|
1381
|
+
this.rawValue = undefined;
|
|
1382
|
+
if (finalPosition === 0) {
|
|
1383
|
+
return raw;
|
|
1384
|
+
}
|
|
1385
|
+
const result = this.json.subarray(0, finalPosition);
|
|
1386
|
+
this.json = alloc(INITIAL_BUFFER_SIZE);
|
|
1387
|
+
return result;
|
|
1388
|
+
}
|
|
1389
|
+
ensure(byteCount) {
|
|
1390
|
+
const { i, json } = this;
|
|
1391
|
+
if (i + byteCount > json.length) {
|
|
1392
|
+
let newSize = json.length * 2;
|
|
1393
|
+
while (newSize < i + byteCount) {
|
|
1394
|
+
newSize *= 2;
|
|
1395
|
+
}
|
|
1396
|
+
const next = alloc(newSize);
|
|
1397
|
+
next.set(this.json);
|
|
1398
|
+
this.json = next;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
writeAscii(s) {
|
|
1402
|
+
const z = s.length;
|
|
1403
|
+
this.ensure(z);
|
|
1404
|
+
let { i, json } = this;
|
|
1405
|
+
for (let j = 0; j < z; ++j) {
|
|
1406
|
+
json[i] = s.charCodeAt(j);
|
|
1407
|
+
i += 1;
|
|
1408
|
+
}
|
|
1409
|
+
this.i = i;
|
|
1410
|
+
}
|
|
1411
|
+
writeAsciiQuoted(s) {
|
|
1412
|
+
const z = s.length;
|
|
1413
|
+
this.ensure(z + 4);
|
|
1414
|
+
let { json, i } = this;
|
|
1415
|
+
json[i++] = QUOTE;
|
|
1416
|
+
for (let j = 0; j < z; ++j) {
|
|
1417
|
+
json[i++] = s.charCodeAt(j);
|
|
1418
|
+
}
|
|
1419
|
+
json[i++] = QUOTE;
|
|
1420
|
+
this.i = i;
|
|
1421
|
+
}
|
|
1422
|
+
writeJsonString(s) {
|
|
1423
|
+
this.ensure(s.length * 3 + 2);
|
|
1424
|
+
this.json[this.i++] = QUOTE;
|
|
1425
|
+
const z = s.length;
|
|
1426
|
+
for (let j = 0; j < z; ++j) {
|
|
1427
|
+
const c = s.charCodeAt(j);
|
|
1428
|
+
if (c > 0x22 && c < 0x5c) {
|
|
1429
|
+
this.json[this.i++] = c;
|
|
1430
|
+
}
|
|
1431
|
+
else if (c < 0x80) {
|
|
1432
|
+
const esc = ESCAPE_TABLE[c];
|
|
1433
|
+
if (esc !== null) {
|
|
1434
|
+
this.ensure(esc.length + 1);
|
|
1435
|
+
this.json[this.i++] = BACKSLASH;
|
|
1436
|
+
for (let k = 0; k < esc.length; k++) {
|
|
1437
|
+
this.json[this.i++] = esc.charCodeAt(k);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
else {
|
|
1441
|
+
this.json[this.i++] = c;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
else if (c >= 0xd800 && c <= 0xdbff) {
|
|
1445
|
+
const next = j + 1 < z ? s.charCodeAt(j + 1) : 0;
|
|
1446
|
+
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
1447
|
+
this.ensure(4);
|
|
1448
|
+
const { written } = encoder.encodeInto(s.substring(j, j + 2), this.json.subarray(this.i));
|
|
1449
|
+
this.i += written;
|
|
1450
|
+
++j;
|
|
1451
|
+
}
|
|
1452
|
+
else {
|
|
1453
|
+
this.ensure(6);
|
|
1454
|
+
this.writeUnicodeEscape(c);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
else if (c >= 0xdc00 && c <= 0xdfff) {
|
|
1458
|
+
this.ensure(6);
|
|
1459
|
+
this.writeUnicodeEscape(c);
|
|
1460
|
+
}
|
|
1461
|
+
else {
|
|
1462
|
+
let { i, json } = this;
|
|
1463
|
+
if (c < 0x800) {
|
|
1464
|
+
json[i++] = 0xc0 | (c >> 6);
|
|
1465
|
+
json[i++] = 0x80 | (c & 0x3f);
|
|
1466
|
+
}
|
|
1467
|
+
else {
|
|
1468
|
+
json[i++] = 0xe0 | (c >> 12);
|
|
1469
|
+
json[i++] = 0x80 | ((c >> 6) & 0x3f);
|
|
1470
|
+
json[i++] = 0x80 | (c & 0x3f);
|
|
1471
|
+
}
|
|
1472
|
+
this.i = i;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
this.json[this.i++] = QUOTE;
|
|
1476
|
+
}
|
|
1477
|
+
writeUnicodeEscape(code) {
|
|
1478
|
+
let { json, i } = this;
|
|
1479
|
+
json[i++] = BACKSLASH;
|
|
1480
|
+
json[i++] = 0x75;
|
|
1481
|
+
const hex = code.toString(16).padStart(4, "0");
|
|
1482
|
+
for (let j = 0; j < 4; ++j) {
|
|
1483
|
+
json[i++] = hex.charCodeAt(j);
|
|
1484
|
+
}
|
|
1485
|
+
this.i = i;
|
|
1486
|
+
}
|
|
1487
|
+
static B64 = (() => {
|
|
1488
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1489
|
+
const table = new Uint8Array(64);
|
|
1490
|
+
for (let i = 0; i < 64; ++i) {
|
|
1491
|
+
table[i] = chars.charCodeAt(i);
|
|
1492
|
+
}
|
|
1493
|
+
return table;
|
|
1494
|
+
})();
|
|
1495
|
+
writeBase64(data) {
|
|
1496
|
+
const b64Len = Math.ceil(data.length / 3) * 4;
|
|
1497
|
+
this.ensure(b64Len + 2);
|
|
1498
|
+
const json = this.json;
|
|
1499
|
+
const B64 = JsonShapeSerializer2.B64;
|
|
1500
|
+
let i = this.i;
|
|
1501
|
+
json[i++] = QUOTE;
|
|
1502
|
+
const len = data.length;
|
|
1503
|
+
const remainder = len % 3;
|
|
1504
|
+
const mainLen = len - remainder;
|
|
1505
|
+
for (let j = 0; j < mainLen; j += 3) {
|
|
1506
|
+
const a = data[j];
|
|
1507
|
+
const b = data[j + 1];
|
|
1508
|
+
const c = data[j + 2];
|
|
1509
|
+
json[i++] = B64[a >> 2];
|
|
1510
|
+
json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
|
|
1511
|
+
json[i++] = B64[((b & 0x0f) << 2) | (c >> 6)];
|
|
1512
|
+
json[i++] = B64[c & 0x3f];
|
|
1513
|
+
}
|
|
1514
|
+
if (remainder === 2) {
|
|
1515
|
+
const a = data[mainLen];
|
|
1516
|
+
const b = data[mainLen + 1];
|
|
1517
|
+
json[i++] = B64[a >> 2];
|
|
1518
|
+
json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
|
|
1519
|
+
json[i++] = B64[(b & 0x0f) << 2];
|
|
1520
|
+
json[i++] = 0x3d;
|
|
1521
|
+
}
|
|
1522
|
+
else if (remainder === 1) {
|
|
1523
|
+
const a = data[mainLen];
|
|
1524
|
+
json[i++] = B64[a >> 2];
|
|
1525
|
+
json[i++] = B64[(a & 0x03) << 4];
|
|
1526
|
+
json[i++] = 0x3d;
|
|
1527
|
+
json[i++] = 0x3d;
|
|
1528
|
+
}
|
|
1529
|
+
json[i++] = QUOTE;
|
|
1530
|
+
this.i = i;
|
|
1531
|
+
}
|
|
1532
|
+
writeValue(schema, value, container) {
|
|
1533
|
+
if (value == null) {
|
|
1534
|
+
if (container?.isStructSchema()) {
|
|
1535
|
+
if (value === undefined) {
|
|
1536
|
+
const ns = NormalizedSchema.of(schema);
|
|
1537
|
+
if (ns.isIdempotencyToken()) {
|
|
1538
|
+
this.writeAsciiQuoted(generateIdempotencyToken());
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
this.ensure(4);
|
|
1545
|
+
this.json.set(NULL, this.i);
|
|
1546
|
+
this.i += 4;
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
const ns = NormalizedSchema.of(schema);
|
|
1550
|
+
const isObject = typeof value === "object";
|
|
1551
|
+
if (ns.isStringSchema()) {
|
|
1552
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
1553
|
+
if (mediaType) {
|
|
1554
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
1555
|
+
if (isJson) {
|
|
1556
|
+
this.writeJsonString(LazyJsonString.from(value).toString());
|
|
1557
|
+
return;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (isObject) {
|
|
1562
|
+
if (ns.isStructSchema()) {
|
|
1563
|
+
this.writeStruct(ns, value);
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
|
|
1567
|
+
this.writeList(ns, value, ns.isDocumentSchema());
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
if (ns.isMapSchema()) {
|
|
1571
|
+
this.writeMap(ns, value, false);
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
|
|
1575
|
+
this.writeBase64(value);
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
1579
|
+
this.writeTimestamp(ns, value);
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
if (value instanceof NumericValue) {
|
|
1583
|
+
this.writeAscii(value.string);
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
if (ns.isDocumentSchema()) {
|
|
1587
|
+
if (Array.isArray(value)) {
|
|
1588
|
+
this.writeList(ns, value, true);
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
this.writeMap(ns, value, true);
|
|
1592
|
+
}
|
|
1593
|
+
return;
|
|
1594
|
+
}
|
|
1595
|
+
const json = JSON.stringify(value);
|
|
1596
|
+
this.writeAscii(json);
|
|
1597
|
+
return;
|
|
1598
|
+
}
|
|
1599
|
+
if (typeof value === "string") {
|
|
1600
|
+
if (ns.isBlobSchema()) {
|
|
1601
|
+
const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
1602
|
+
this.writeAsciiQuoted(b64);
|
|
1603
|
+
return;
|
|
1604
|
+
}
|
|
1605
|
+
this.writeJsonString(value);
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
if (typeof value === "number") {
|
|
1609
|
+
if (ns.isNumericSchema() && (Math.abs(value) === Infinity || isNaN(value))) {
|
|
1610
|
+
this.writeAsciiQuoted(String(value));
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
const numStr = String(value);
|
|
1614
|
+
this.writeAscii(numStr);
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
if (typeof value === "boolean") {
|
|
1618
|
+
this.ensure(5);
|
|
1619
|
+
let { i, json } = this;
|
|
1620
|
+
if (value) {
|
|
1621
|
+
json.set(TRUE, i);
|
|
1622
|
+
i += 4;
|
|
1623
|
+
}
|
|
1624
|
+
else {
|
|
1625
|
+
json.set(FALSE, i);
|
|
1626
|
+
i += 5;
|
|
1627
|
+
}
|
|
1628
|
+
this.i = i;
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
if (typeof value === "bigint") {
|
|
1632
|
+
this.writeAscii(value.toString());
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1635
|
+
this.writeAscii(String(value));
|
|
1636
|
+
}
|
|
1637
|
+
writeStruct(ns, value) {
|
|
1638
|
+
this.ensure(2);
|
|
1639
|
+
this.json[this.i++] = OPEN_BRACE;
|
|
1640
|
+
let wroteAny = false;
|
|
1641
|
+
const hasType = typeof value.__type === "string";
|
|
1642
|
+
let writtenKeys;
|
|
1643
|
+
if (hasType) {
|
|
1644
|
+
writtenKeys = new Set();
|
|
1645
|
+
}
|
|
1646
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
1647
|
+
const item = value[memberName];
|
|
1648
|
+
if (item == null && !memberSchema.isIdempotencyToken()) {
|
|
1649
|
+
continue;
|
|
1650
|
+
}
|
|
1651
|
+
if (wroteAny) {
|
|
1652
|
+
this.ensure(1);
|
|
1653
|
+
this.json[this.i++] = COMMA;
|
|
1654
|
+
}
|
|
1655
|
+
wroteAny = true;
|
|
1656
|
+
const targetKey = this.settings.jsonName ? (memberSchema.getMergedTraits().jsonName ?? memberName) : memberName;
|
|
1657
|
+
if (writtenKeys) {
|
|
1658
|
+
writtenKeys.add(memberName);
|
|
1659
|
+
writtenKeys.add(targetKey);
|
|
1660
|
+
}
|
|
1661
|
+
this.writeAsciiQuoted(targetKey);
|
|
1662
|
+
this.json[this.i++] = COLON;
|
|
1663
|
+
this.writeValue(memberSchema, item, ns);
|
|
1664
|
+
}
|
|
1665
|
+
if (!wroteAny && ns.isUnionSchema()) {
|
|
1666
|
+
const { $unknown } = value;
|
|
1667
|
+
if (Array.isArray($unknown)) {
|
|
1668
|
+
const [k, v] = $unknown;
|
|
1669
|
+
this.writeAsciiQuoted(k);
|
|
1670
|
+
this.ensure(1);
|
|
1671
|
+
this.json[this.i++] = COLON;
|
|
1672
|
+
this.writeValue(15, v, ns);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
else if (hasType) {
|
|
1676
|
+
for (const k in value) {
|
|
1677
|
+
if (writtenKeys.has(k)) {
|
|
1678
|
+
continue;
|
|
1679
|
+
}
|
|
1680
|
+
writtenKeys.add(k);
|
|
1681
|
+
const v = value[k];
|
|
1682
|
+
if (wroteAny) {
|
|
1683
|
+
this.ensure(1);
|
|
1684
|
+
this.json[this.i++] = COMMA;
|
|
1685
|
+
}
|
|
1686
|
+
wroteAny = true;
|
|
1687
|
+
this.writeAsciiQuoted(k);
|
|
1688
|
+
this.ensure(1);
|
|
1689
|
+
this.json[this.i++] = COLON;
|
|
1690
|
+
this.writeValue(15, v, undefined);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
this.ensure(1);
|
|
1694
|
+
this.json[this.i++] = CLOSE_BRACE;
|
|
1695
|
+
}
|
|
1696
|
+
writeList(ns, value, isDocument) {
|
|
1697
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
1698
|
+
const valueSchema = ns.getValueSchema();
|
|
1699
|
+
if (!isDocument) {
|
|
1700
|
+
if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
|
|
1701
|
+
const json = sparse ? JSON.stringify(value) : JSON.stringify(value.filter((_) => _ != null));
|
|
1702
|
+
this.ensure(json.length * 3);
|
|
1703
|
+
this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
this.ensure(2);
|
|
1708
|
+
this.json[this.i++] = OPEN_BRACKET;
|
|
1709
|
+
let wroteFirstItem = false;
|
|
1710
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1711
|
+
const item = value[i];
|
|
1712
|
+
if (isDocument ? item === undefined : item == null && !sparse) {
|
|
1713
|
+
continue;
|
|
1714
|
+
}
|
|
1715
|
+
if (wroteFirstItem) {
|
|
1716
|
+
this.ensure(1);
|
|
1717
|
+
this.json[this.i++] = COMMA;
|
|
1718
|
+
}
|
|
1719
|
+
this.writeValue(valueSchema, item, undefined);
|
|
1720
|
+
wroteFirstItem = true;
|
|
1721
|
+
}
|
|
1722
|
+
this.ensure(1);
|
|
1723
|
+
this.json[this.i++] = CLOSE_BRACKET;
|
|
1724
|
+
}
|
|
1725
|
+
writeMap(ns, value, isDocument) {
|
|
1726
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
1727
|
+
const valueSchema = ns.getValueSchema();
|
|
1728
|
+
if (!isDocument) {
|
|
1729
|
+
if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
|
|
1730
|
+
let input = value;
|
|
1731
|
+
if (sparse) {
|
|
1732
|
+
input = {};
|
|
1733
|
+
for (const k in value) {
|
|
1734
|
+
if (k === "__proto__") {
|
|
1735
|
+
writeKey(input);
|
|
1736
|
+
}
|
|
1737
|
+
input[k] = value[k] ?? null;
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
const json = JSON.stringify(input);
|
|
1741
|
+
this.ensure(json.length * 3);
|
|
1742
|
+
this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
this.ensure(2);
|
|
1747
|
+
this.json[this.i++] = OPEN_BRACE;
|
|
1748
|
+
let first = true;
|
|
1749
|
+
for (const k in value) {
|
|
1750
|
+
const v = value[k];
|
|
1751
|
+
if (isDocument ? v === undefined : v == null && !sparse) {
|
|
1752
|
+
continue;
|
|
1753
|
+
}
|
|
1754
|
+
if (!first) {
|
|
1755
|
+
this.ensure(1);
|
|
1756
|
+
this.json[this.i++] = COMMA;
|
|
1757
|
+
}
|
|
1758
|
+
first = false;
|
|
1759
|
+
this.writeJsonString(k);
|
|
1760
|
+
this.ensure(1);
|
|
1761
|
+
this.json[this.i++] = COLON;
|
|
1762
|
+
this.writeValue(valueSchema, v, undefined);
|
|
1763
|
+
}
|
|
1764
|
+
this.ensure(1);
|
|
1765
|
+
this.json[this.i++] = CLOSE_BRACE;
|
|
1766
|
+
}
|
|
1767
|
+
writeTimestamp(ns, value) {
|
|
1768
|
+
const format = determineTimestampFormat(ns, this.settings);
|
|
1769
|
+
switch (format) {
|
|
1770
|
+
case 5: {
|
|
1771
|
+
const iso = value.toISOString().replace(".000Z", "Z");
|
|
1772
|
+
this.writeAsciiQuoted(iso);
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
case 6: {
|
|
1776
|
+
this.writeAsciiQuoted(dateToUtcString(value));
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
case 7: {
|
|
1780
|
+
const epochSecs = String(value.getTime() / 1000);
|
|
1781
|
+
this.writeAscii(epochSecs);
|
|
1782
|
+
return;
|
|
1783
|
+
}
|
|
1784
|
+
default: {
|
|
1785
|
+
const epochSecs = String(value.getTime() / 1000);
|
|
1786
|
+
this.writeAscii(epochSecs);
|
|
1787
|
+
return;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
class JsonCodec2 extends SerdeContextConfig {
|
|
1794
|
+
settings;
|
|
1795
|
+
constructor(settings) {
|
|
1796
|
+
super();
|
|
1797
|
+
this.settings = settings;
|
|
1798
|
+
}
|
|
1799
|
+
createSerializer() {
|
|
1800
|
+
const serializer = new JsonShapeSerializer2(this.settings);
|
|
1801
|
+
serializer.setSerdeContext(this.serdeContext);
|
|
1802
|
+
return serializer;
|
|
1803
|
+
}
|
|
1804
|
+
createDeserializer() {
|
|
1805
|
+
const deserializer = new JsonShapeDeserializer2(this.settings);
|
|
1806
|
+
deserializer.setSerdeContext(this.serdeContext);
|
|
1807
|
+
return deserializer;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
959
1810
|
|
|
960
1811
|
class XmlShapeDeserializer extends SerdeContextConfig {
|
|
961
1812
|
settings;
|
|
@@ -1037,6 +1888,9 @@ class XmlShapeDeserializer extends SerdeContextConfig {
|
|
|
1037
1888
|
for (const entry of entries) {
|
|
1038
1889
|
const key = entry[keyProperty];
|
|
1039
1890
|
const value = entry[valueProperty];
|
|
1891
|
+
if (key === "__proto__") {
|
|
1892
|
+
writeKey(buffer);
|
|
1893
|
+
}
|
|
1040
1894
|
buffer[key] = this.readSchema(memberNs, value);
|
|
1041
1895
|
}
|
|
1042
1896
|
return buffer;
|
|
@@ -1886,6 +2740,66 @@ class AwsRestXmlProtocol extends HttpBindingProtocol {
|
|
|
1886
2740
|
}
|
|
1887
2741
|
}
|
|
1888
2742
|
|
|
2743
|
+
const awsExpectUnion = (value) => {
|
|
2744
|
+
if (value == null) {
|
|
2745
|
+
return undefined;
|
|
2746
|
+
}
|
|
2747
|
+
if (typeof value === "object" && "__type" in value) {
|
|
2748
|
+
delete value.__type;
|
|
2749
|
+
}
|
|
2750
|
+
return expectUnion(value);
|
|
2751
|
+
};
|
|
2752
|
+
|
|
2753
|
+
const _toStr = (val) => {
|
|
2754
|
+
if (val == null) {
|
|
2755
|
+
return val;
|
|
2756
|
+
}
|
|
2757
|
+
if (typeof val === "number" || typeof val === "bigint") {
|
|
2758
|
+
const warning = new Error(`Received number ${val} where a string was expected.`);
|
|
2759
|
+
warning.name = "Warning";
|
|
2760
|
+
console.warn(warning);
|
|
2761
|
+
return String(val);
|
|
2762
|
+
}
|
|
2763
|
+
if (typeof val === "boolean") {
|
|
2764
|
+
const warning = new Error(`Received boolean ${val} where a string was expected.`);
|
|
2765
|
+
warning.name = "Warning";
|
|
2766
|
+
console.warn(warning);
|
|
2767
|
+
return String(val);
|
|
2768
|
+
}
|
|
2769
|
+
return val;
|
|
2770
|
+
};
|
|
2771
|
+
const _toBool = (val) => {
|
|
2772
|
+
if (val == null) {
|
|
2773
|
+
return val;
|
|
2774
|
+
}
|
|
2775
|
+
if (typeof val === "string") {
|
|
2776
|
+
const lowercase = val.toLowerCase();
|
|
2777
|
+
if (val !== "" && lowercase !== "false" && lowercase !== "true") {
|
|
2778
|
+
const warning = new Error(`Received string "${val}" where a boolean was expected.`);
|
|
2779
|
+
warning.name = "Warning";
|
|
2780
|
+
console.warn(warning);
|
|
2781
|
+
}
|
|
2782
|
+
return val !== "" && lowercase !== "false";
|
|
2783
|
+
}
|
|
2784
|
+
return val;
|
|
2785
|
+
};
|
|
2786
|
+
const _toNum = (val) => {
|
|
2787
|
+
if (val == null) {
|
|
2788
|
+
return val;
|
|
2789
|
+
}
|
|
2790
|
+
if (typeof val === "string") {
|
|
2791
|
+
const num = Number(val);
|
|
2792
|
+
if (num.toString() !== val) {
|
|
2793
|
+
const warning = new Error(`Received string "${val}" where a number was expected.`);
|
|
2794
|
+
warning.name = "Warning";
|
|
2795
|
+
console.warn(warning);
|
|
2796
|
+
return val;
|
|
2797
|
+
}
|
|
2798
|
+
return num;
|
|
2799
|
+
}
|
|
2800
|
+
return val;
|
|
2801
|
+
};
|
|
2802
|
+
|
|
1889
2803
|
exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol;
|
|
1890
2804
|
exports.AwsJson1_0Protocol = AwsJson1_0Protocol;
|
|
1891
2805
|
exports.AwsJson1_1Protocol = AwsJson1_1Protocol;
|
|
@@ -1895,8 +2809,11 @@ exports.AwsRestJsonProtocol = AwsRestJsonProtocol;
|
|
|
1895
2809
|
exports.AwsRestXmlProtocol = AwsRestXmlProtocol;
|
|
1896
2810
|
exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol;
|
|
1897
2811
|
exports.JsonCodec = JsonCodec;
|
|
2812
|
+
exports.JsonCodec2 = JsonCodec2;
|
|
1898
2813
|
exports.JsonShapeDeserializer = JsonShapeDeserializer;
|
|
2814
|
+
exports.JsonShapeDeserializer2 = JsonShapeDeserializer2;
|
|
1899
2815
|
exports.JsonShapeSerializer = JsonShapeSerializer;
|
|
2816
|
+
exports.JsonShapeSerializer2 = JsonShapeSerializer2;
|
|
1900
2817
|
exports.QueryShapeSerializer = QueryShapeSerializer;
|
|
1901
2818
|
exports.XmlCodec = XmlCodec;
|
|
1902
2819
|
exports.XmlShapeDeserializer = XmlShapeDeserializer;
|