cdk-preflight 1.12.0 → 1.12.2
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/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormationClient.d.ts +2 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +6 -6
- package/node_modules/@aws-sdk/client-ec2/README.md +28 -0
- package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +499 -113
- package/node_modules/@aws-sdk/client-ec2/dist-es/EC2.js +10 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/GetCapacityManagerSupportabilityScoresCommand.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/GetImageFindingsCommand.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/GetTransitGatewayAttachmentNatConfigurationCommand.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/ModifyTransitGatewayAttachmentNatConfigurationCommand.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/index.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/enums.js +80 -29
- package/node_modules/@aws-sdk/client-ec2/dist-es/pagination/GetImageFindingsPaginator.js +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/pagination/index.js +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/schemas/schemas_0.js +365 -83
- package/node_modules/@aws-sdk/client-ec2/dist-types/EC2.d.ts +35 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/EC2Client.d.ts +8 -3
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CreateCapacityReservationFleetCommand.d.ts +82 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CreateCarrierGatewayCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CreateTransitGatewayRouteCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DeleteLaunchTemplateCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DeleteTransitGatewayRouteCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DeleteTransitGatewayRouteTableCommand.d.ts +5 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeCapacityReservationFleetsCommand.d.ts +81 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeFleetHistoryCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeImagesCommand.d.ts +9 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeInstanceStatusCommand.d.ts +5 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeNetworkInsightsAnalysesCommand.d.ts +48 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeReservedInstancesModificationsCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeReservedInstancesOfferingsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeTransitGatewayAttachmentsCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DisassociateTransitGatewayPolicyTableCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DisassociateTransitGatewayRouteTableCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetAllowedImagesSettingsCommand.d.ts +9 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMetricDataCommand.d.ts +2 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMetricDimensionsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerSupportabilityScoresCommand.d.ts +183 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetImageFindingsCommand.d.ts +90 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetNetworkInsightsAccessScopeAnalysisFindingsCommand.d.ts +19 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetTransitGatewayAttachmentNatConfigurationCommand.d.ts +82 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetVerifiedAccessEndpointTargetsCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetVerifiedAccessGroupPolicyCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetVpcResourcesBlockingEncryptionEnforcementCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetVpnConnectionDeviceSampleConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetVpnConnectionDeviceTypesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetVpnTunnelReplacementStatusCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ModifyTransitGatewayAttachmentNatConfigurationCommand.d.ts +107 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/RejectTransitGatewayPeeringAttachmentCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/RejectTransitGatewayVpcAttachmentCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/RejectVpcEndpointConnectionsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/RejectVpcPeeringConnectionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReleaseAddressCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReleaseHostsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReleaseIpamPoolAllocationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReplaceIamInstanceProfileAssociationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReplaceImageCriteriaInAllowedImagesSettingsCommand.d.ts +9 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReplaceTransitGatewayRouteCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/SearchTransitGatewayRoutesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/StartNetworkInsightsAnalysisCommand.d.ts +48 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/index.d.ts +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/enums.d.ts +192 -77
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_0.d.ts +165 -291
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_1.d.ts +1839 -1665
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_2.d.ts +25 -12
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_3.d.ts +27 -38
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_4.d.ts +241 -242
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_5.d.ts +247 -57
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_6.d.ts +537 -341
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_7.d.ts +389 -246
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_8.d.ts +360 -3
- package/node_modules/@aws-sdk/client-ec2/dist-types/pagination/GetImageFindingsPaginator.d.ts +7 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/pagination/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/schemas/schemas_0.d.ts +21 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2.d.ts +75 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2Client.d.ts +24 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/CreateCapacityReservationFleetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/CreateCarrierGatewayCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DeleteLaunchTemplateCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DescribeFleetHistoryCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DescribeReservedInstancesModificationsCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DescribeReservedInstancesOfferingsCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DisassociateTransitGatewayPolicyTableCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DisassociateTransitGatewayRouteTableCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetCapacityManagerSupportabilityScoresCommand.d.ts +42 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetImageFindingsCommand.d.ts +38 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetTransitGatewayAttachmentNatConfigurationCommand.d.ts +42 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetVerifiedAccessEndpointTargetsCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetVerifiedAccessGroupPolicyCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetVpcResourcesBlockingEncryptionEnforcementCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetVpnConnectionDeviceSampleConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetVpnConnectionDeviceTypesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetVpnTunnelReplacementStatusCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ModifyTransitGatewayAttachmentNatConfigurationCommand.d.ts +42 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/RejectTransitGatewayPeeringAttachmentCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/RejectTransitGatewayVpcAttachmentCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/RejectVpcEndpointConnectionsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/RejectVpcPeeringConnectionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ReleaseAddressCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ReleaseHostsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ReleaseIpamPoolAllocationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ReplaceIamInstanceProfileAssociationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/enums.d.ts +99 -35
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_0.d.ts +27 -60
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_1.d.ts +118 -69
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_2.d.ts +6 -6
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_3.d.ts +10 -9
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_4.d.ts +31 -34
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_5.d.ts +37 -14
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_6.d.ts +89 -68
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_7.d.ts +86 -64
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_8.d.ts +76 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/pagination/GetImageFindingsPaginator.d.ts +11 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/pagination/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/schemas/schemas_0.d.ts +21 -0
- package/node_modules/@aws-sdk/client-ec2/package.json +8 -8
- package/node_modules/@aws-sdk/client-lambda/README.md +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-cjs/index.js +9 -3
- package/node_modules/@aws-sdk/client-lambda/dist-es/models/enums.js +4 -0
- package/node_modules/@aws-sdk/client-lambda/dist-es/schemas/schemas_0.js +3 -2
- package/node_modules/@aws-sdk/client-lambda/dist-types/Lambda.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/LambdaClient.d.ts +3 -2
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/CreateEventSourceMappingCommand.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/DeleteEventSourceMappingCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/DeleteFunctionConcurrencyCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/GetEventSourceMappingCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/GetFunctionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/ListEventSourceMappingsCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/ListFunctionEventInvokeConfigsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/ListVersionsByFunctionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/PublishVersionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/PutFunctionConcurrencyCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/PutFunctionRecursionConfigCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/UpdateEventSourceMappingCommand.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/commands/UpdateFunctionUrlConfigCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/index.d.ts +1 -1
- package/node_modules/@aws-sdk/client-lambda/dist-types/models/enums.d.ts +12 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/models/models_0.d.ts +21 -16
- package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/models/enums.d.ts +6 -0
- package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/models/models_0.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lambda/package.json +7 -7
- package/node_modules/@aws-sdk/client-service-quotas/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-service-quotas/dist-types/ServiceQuotasClient.d.ts +2 -1
- package/node_modules/@aws-sdk/client-service-quotas/package.json +6 -6
- package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts +2 -1
- package/node_modules/@aws-sdk/client-sts/package.json +8 -8
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +38 -13
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +7 -7
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +104 -1549
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/getDefaultSocketTimeout.js +10 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.browser.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.native.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +1 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +2 -7
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/getDefaultSocketTimeout.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.native.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +3 -7
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +3 -8
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/getDefaultSocketTimeout.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +11 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
- package/node_modules/@aws-sdk/core/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
- 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 +5 -5
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +3 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +10 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +3 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +3 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +3 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +5 -59
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenWithIAMCommand.d.ts +5 -33
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +16 -9
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +8 -39
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/models_0.d.ts +36 -48
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
- package/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
- package/node_modules/@aws-sdk/token-providers/package.json +5 -5
- package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +3 -0
- package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +3 -0
- package/node_modules/@aws-sdk/types/package.json +1 -1
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +45 -53
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +52 -19
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +28 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +28 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +91 -58
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +53 -15
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +57 -17
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
- package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +12 -37
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +17 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js +10 -4
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +12 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js +35 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +6 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +8 -31
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +11 -8
- package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +17 -8
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/race.js +22 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
- package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
- package/node_modules/@smithy/core/dist-types/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +12 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
- package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/race.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +12 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/race.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +84 -29
- package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +23 -11
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +26 -2
- package/node_modules/@smithy/node-http-handler/dist-es/resolve-default-socket-timeout.js +4 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +30 -15
- package/node_modules/@smithy/node-http-handler/dist-types/resolve-default-socket-timeout.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +10 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/resolve-default-socket-timeout.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +10 -1
- package/node_modules/@smithy/node-http-handler/package.json +3 -3
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
- package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/node_modules/@smithy/types/dist-types/middleware.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +6 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/package.json +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -20
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +0 -160
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +0 -193
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -103
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -20
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +0 -200
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +0 -519
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -18
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -46
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -121
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js +0 -41
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +0 -89
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -15
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -14
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -29
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -51
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -13
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -30
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -60
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -21
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -15
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -11
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +0 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +0 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +0 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
- /package/node_modules/@smithy/core/dist-types/submodules/{protocols → serde}/writeKey.d.ts +0 -0
- /package/node_modules/@smithy/core/dist-types/ts3.4/submodules/{protocols → serde}/writeKey.d.ts +0 -0
package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/AbstractRpcV2Protocol.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, OperationSchema, SerdeFunctions } from "@smithy/types";
|
|
2
|
+
import { TypeRegistry } from "@smithy/core/schema";
|
|
3
|
+
import { RpcProtocol } from "./RpcProtocol";
|
|
4
|
+
/**
|
|
5
|
+
* Shared abstract base for the Smithy RPC v2 client protocols (JSON and CBOR).
|
|
6
|
+
*
|
|
7
|
+
* Factors out the request-framing flow and response status handling that are
|
|
8
|
+
* identical across both RPC v2 protocols. Concrete protocols supply their
|
|
9
|
+
* codec, error handling, content type, shape id, and the two per-protocol
|
|
10
|
+
* request details via {@link getSmithyProtocolHeaderValue} and
|
|
11
|
+
* {@link applyEmptyBody}.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class AbstractRpcV2Protocol extends RpcProtocol {
|
|
16
|
+
/**
|
|
17
|
+
* @override
|
|
18
|
+
*/
|
|
19
|
+
protected compositeErrorRegistry: TypeRegistry;
|
|
20
|
+
constructor({ defaultNamespace, errorTypeRegistries, }: {
|
|
21
|
+
defaultNamespace: string;
|
|
22
|
+
errorTypeRegistries?: TypeRegistry[];
|
|
23
|
+
});
|
|
24
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
|
25
|
+
/**
|
|
26
|
+
* @override
|
|
27
|
+
*
|
|
28
|
+
* Per the Smithy RPC v2 specification, the only successful response status
|
|
29
|
+
* code is 200; any other status code MUST be handled as an error.
|
|
30
|
+
*/
|
|
31
|
+
protected isErrorResponse(statusCode: number): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @returns the value of the `smithy-protocol` header for this protocol,
|
|
34
|
+
* e.g. `rpc-v2-json` or `rpc-v2-cbor`.
|
|
35
|
+
*/
|
|
36
|
+
protected abstract getSmithyProtocolHeaderValue(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Applies this protocol's representation of an empty request body when the
|
|
39
|
+
* operation has a non-unit input but produced no serialized body. Called
|
|
40
|
+
* only for non-unit inputs.
|
|
41
|
+
*
|
|
42
|
+
* @param request - the request being serialized, mutated in place.
|
|
43
|
+
*/
|
|
44
|
+
protected abstract applyEmptyBody(request: IHttpRequest): void;
|
|
45
|
+
}
|
|
@@ -13,4 +13,16 @@ export declare abstract class RpcProtocol extends HttpProtocol {
|
|
|
13
13
|
protected compositeErrorRegistry: TypeRegistry;
|
|
14
14
|
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
|
15
15
|
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
|
16
|
+
/**
|
|
17
|
+
* Determines whether a response status code indicates an error response that
|
|
18
|
+
* should be routed to {@link handleError} rather than deserialized as output.
|
|
19
|
+
*
|
|
20
|
+
* The default treats any status code of 300 or greater as an error,
|
|
21
|
+
* preserving the historical behavior for RPC-over-HTTP protocols. Subclasses
|
|
22
|
+
* whose specification is stricter SHOULD override this.
|
|
23
|
+
*
|
|
24
|
+
* @param statusCode - the HTTP response status code.
|
|
25
|
+
* @returns true if the response should be handled as an error.
|
|
26
|
+
*/
|
|
27
|
+
protected isErrorResponse(statusCode: number): boolean;
|
|
16
28
|
}
|
|
@@ -3,6 +3,7 @@ export { extendedEncodeURIComponent } from "./extended-encode-uri-component";
|
|
|
3
3
|
export { HttpBindingProtocol } from "./HttpBindingProtocol";
|
|
4
4
|
export { HttpProtocol } from "./HttpProtocol";
|
|
5
5
|
export { RpcProtocol } from "./RpcProtocol";
|
|
6
|
+
export { AbstractRpcV2Protocol } from "./AbstractRpcV2Protocol";
|
|
6
7
|
export { RequestBuilder, requestBuilder } from "./requestBuilder";
|
|
7
8
|
export { resolvedPath } from "./resolve-path";
|
|
8
9
|
export { FromStringShapeDeserializer } from "./serde/FromStringShapeDeserializer";
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
|
1
|
+
import { AbstractRpcV2Protocol } from "../AbstractRpcV2Protocol";
|
|
2
|
+
import { HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
|
4
3
|
import { JsonCodec2 } from "./codec-v2/JsonCodec2";
|
|
5
4
|
/**
|
|
6
5
|
* Client protocol for Smithy RPCv2 JSON.
|
|
7
6
|
*
|
|
8
7
|
* @public
|
|
9
8
|
*/
|
|
10
|
-
export declare class SmithyRpcV2JsonProtocol extends
|
|
11
|
-
/**
|
|
12
|
-
* @override
|
|
13
|
-
*/
|
|
14
|
-
protected compositeErrorRegistry: TypeRegistry;
|
|
9
|
+
export declare class SmithyRpcV2JsonProtocol extends AbstractRpcV2Protocol {
|
|
15
10
|
private codec;
|
|
16
11
|
protected serializer: ShapeSerializer<string | Uint8Array>;
|
|
17
12
|
protected deserializer: ShapeDeserializer<string | Uint8Array>;
|
|
18
|
-
constructor({ defaultNamespace, errorTypeRegistries, }: {
|
|
19
|
-
defaultNamespace: string;
|
|
20
|
-
errorTypeRegistries?: TypeRegistry[];
|
|
21
|
-
});
|
|
22
13
|
getShapeId(): string;
|
|
23
14
|
getPayloadCodec(): JsonCodec2;
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
protected getSmithyProtocolHeaderValue(): string;
|
|
16
|
+
protected applyEmptyBody(request: IHttpRequest): void;
|
|
26
17
|
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
|
27
18
|
protected getDefaultContentType(): string;
|
|
28
19
|
}
|
|
@@ -24,6 +24,7 @@ export declare const getHttpHandlerExtensionConfiguration: <HandlerConfig extend
|
|
|
24
24
|
logger?: Logger;
|
|
25
25
|
}>(runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig> & {
|
|
26
26
|
logger?: Logger;
|
|
27
|
+
defaultSocketTimeout?: number;
|
|
27
28
|
}) => {
|
|
28
29
|
setHttpHandler(handler: HttpHandler<HandlerConfig>): void;
|
|
29
30
|
httpHandler(): HttpHandler<HandlerConfig>;
|
|
@@ -40,3 +40,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
|
40
40
|
export declare const v4: () => string;
|
|
41
41
|
export declare const generateIdempotencyToken: () => string;
|
|
42
42
|
export { hasOwn } from "@smithy/core/transport";
|
|
43
|
+
export { writeKey } from "./writeKey";
|
|
@@ -38,3 +38,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
|
38
38
|
export declare const v4: () => string;
|
|
39
39
|
export declare const generateIdempotencyToken: () => string;
|
|
40
40
|
export { hasOwn } from "@smithy/core/transport";
|
|
41
|
+
export { writeKey } from "./writeKey";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.39.0",
|
|
4
4
|
"homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
243
243
|
},
|
|
244
244
|
"dependencies": {
|
|
245
|
-
"@smithy/types": "^4.
|
|
245
|
+
"@smithy/types": "^4.20.0",
|
|
246
246
|
"tslib": "^2.6.2"
|
|
247
247
|
},
|
|
248
248
|
"devDependencies": {
|
|
@@ -31,8 +31,9 @@ const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
|
|
|
31
31
|
const getTransformedHeaders = (headers) => {
|
|
32
32
|
const transformedHeaders = {};
|
|
33
33
|
for (const name in headers) {
|
|
34
|
-
if (!hasOwn(headers, name))
|
|
34
|
+
if (!hasOwn(headers, name)) {
|
|
35
35
|
continue;
|
|
36
|
+
}
|
|
36
37
|
const headerValues = headers[name];
|
|
37
38
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
38
39
|
}
|
|
@@ -123,27 +124,47 @@ const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs
|
|
|
123
124
|
return timing.setTimeout(registerListener, deferTimeMs);
|
|
124
125
|
};
|
|
125
126
|
|
|
127
|
+
const resolveDefaultSocketTimeout = (config) => {
|
|
128
|
+
const value = config?.defaultSocketTimeout;
|
|
129
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;
|
|
130
|
+
};
|
|
131
|
+
|
|
126
132
|
const DEFER_EVENT_LISTENER_TIME = 3000;
|
|
127
|
-
const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
request.socket
|
|
136
|
-
|
|
133
|
+
const setSocketTimeout = (request, reject, timeoutInMs = 0, isServiceDefault = false) => {
|
|
134
|
+
if (!Number.isFinite(timeoutInMs) || timeoutInMs <= 0) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
let response;
|
|
138
|
+
request.once("response", (res) => (response = res));
|
|
139
|
+
const onTimeout = () => {
|
|
140
|
+
if (response?.complete) {
|
|
141
|
+
request.socket?.destroy();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const error = Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (${isServiceDefault ? "service default socket timeout" : "configured by client requestHandler"}).`), { name: "TimeoutError" });
|
|
145
|
+
response?.destroy(error);
|
|
146
|
+
request.destroy();
|
|
147
|
+
reject(error);
|
|
148
|
+
};
|
|
149
|
+
const registerTimeout = () => {
|
|
150
|
+
const { socket } = request;
|
|
151
|
+
if (!socket) {
|
|
152
|
+
request.once("socket", registerTimeout);
|
|
153
|
+
}
|
|
154
|
+
else if (socket.connecting) {
|
|
155
|
+
socket.once("connect", registerTimeout);
|
|
137
156
|
}
|
|
138
157
|
else {
|
|
139
|
-
|
|
158
|
+
socket.setTimeout(timeoutInMs, onTimeout);
|
|
159
|
+
request.on("close", () => socket.removeListener("timeout", onTimeout));
|
|
140
160
|
}
|
|
141
161
|
};
|
|
142
|
-
if (
|
|
143
|
-
registerTimeout(
|
|
144
|
-
return
|
|
162
|
+
if (timeoutInMs < 6000) {
|
|
163
|
+
registerTimeout();
|
|
164
|
+
return;
|
|
145
165
|
}
|
|
146
|
-
|
|
166
|
+
const deferralId = timing.setTimeout(registerTimeout, DEFER_EVENT_LISTENER_TIME);
|
|
167
|
+
request.once("close", () => timing.clearTimeout(deferralId));
|
|
147
168
|
};
|
|
148
169
|
|
|
149
170
|
const MIN_WAIT_TIME = 6_000;
|
|
@@ -234,8 +255,9 @@ class NodeHttpHandler {
|
|
|
234
255
|
}
|
|
235
256
|
if (sockets && requests) {
|
|
236
257
|
for (const origin in sockets) {
|
|
237
|
-
if (!hasOwn(sockets, origin))
|
|
258
|
+
if (!hasOwn(sockets, origin)) {
|
|
238
259
|
continue;
|
|
260
|
+
}
|
|
239
261
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
240
262
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
241
263
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
@@ -281,13 +303,11 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
281
303
|
let socketWarningTimeoutId = -1;
|
|
282
304
|
let connectionTimeoutId = -1;
|
|
283
305
|
let requestTimeoutId = -1;
|
|
284
|
-
let socketTimeoutId = -1;
|
|
285
306
|
let keepAliveTimeoutId = -1;
|
|
286
307
|
const clearTimeouts = () => {
|
|
287
308
|
timing.clearTimeout(socketWarningTimeoutId);
|
|
288
309
|
timing.clearTimeout(connectionTimeoutId);
|
|
289
310
|
timing.clearTimeout(requestTimeoutId);
|
|
290
|
-
timing.clearTimeout(socketTimeoutId);
|
|
291
311
|
timing.clearTimeout(keepAliveTimeoutId);
|
|
292
312
|
};
|
|
293
313
|
const resolve = async (arg) => {
|
|
@@ -383,7 +403,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
383
403
|
const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout;
|
|
384
404
|
connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout);
|
|
385
405
|
requestTimeoutId = setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, logger ?? console);
|
|
386
|
-
|
|
406
|
+
const defaultSocketTimeout = config.socketTimeout === undefined ? resolveDefaultSocketTimeout(config) : undefined;
|
|
407
|
+
if (defaultSocketTimeout) {
|
|
408
|
+
setSocketTimeout(req, reject, defaultSocketTimeout, true);
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
setSocketTimeout(req, reject, config.socketTimeout);
|
|
412
|
+
}
|
|
387
413
|
const httpAgent = nodeHttpsOptions.agent;
|
|
388
414
|
if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
|
|
389
415
|
keepAliveTimeoutId = setSocketKeepAlive(req, {
|
|
@@ -400,11 +426,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
400
426
|
updateHttpClientConfig(key, value) {
|
|
401
427
|
this.config = undefined;
|
|
402
428
|
this.configProvider = this.configProvider.then((config) => {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
429
|
+
switch (key) {
|
|
430
|
+
case Symbol.for("logger"):
|
|
431
|
+
key = "logger";
|
|
432
|
+
value = config.logger ?? value;
|
|
433
|
+
break;
|
|
434
|
+
case Symbol.for("@smithy/defaultSocketTimeout"):
|
|
435
|
+
key = "defaultSocketTimeout";
|
|
436
|
+
value = resolveDefaultSocketTimeout(config) ?? value;
|
|
437
|
+
break;
|
|
408
438
|
}
|
|
409
439
|
return {
|
|
410
440
|
...config,
|
|
@@ -419,13 +449,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
419
449
|
const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {};
|
|
420
450
|
const keepAlive = true;
|
|
421
451
|
const maxSockets = 50;
|
|
452
|
+
let httpAgentPromise;
|
|
422
453
|
return {
|
|
423
454
|
connectionTimeout,
|
|
424
455
|
requestTimeout,
|
|
425
456
|
socketTimeout,
|
|
457
|
+
defaultSocketTimeout: resolveDefaultSocketTimeout(options),
|
|
426
458
|
socketAcquisitionWarningTimeout,
|
|
427
459
|
throwOnRequestTimeout,
|
|
428
|
-
httpAgentProvider: async () => {
|
|
460
|
+
httpAgentProvider: () => (httpAgentPromise ??= (async () => {
|
|
429
461
|
const node_http = require('node:http');
|
|
430
462
|
const { Agent, request } = node_http.default ?? node_http;
|
|
431
463
|
hRequest = request;
|
|
@@ -435,7 +467,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
435
467
|
return httpAgent;
|
|
436
468
|
}
|
|
437
469
|
return new hAgent({ keepAlive, maxSockets, ...httpAgent });
|
|
438
|
-
},
|
|
470
|
+
})()),
|
|
439
471
|
httpsAgent: (() => {
|
|
440
472
|
if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") {
|
|
441
473
|
this.externalAgent = true;
|
|
@@ -710,7 +742,8 @@ class NodeHttp2Handler {
|
|
|
710
742
|
}
|
|
711
743
|
async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) {
|
|
712
744
|
if (!this.config) {
|
|
713
|
-
|
|
745
|
+
const config = await this.configProvider;
|
|
746
|
+
this.config = { ...config, defaultSocketTimeout: resolveDefaultSocketTimeout(config) };
|
|
714
747
|
const { disableConcurrentStreams, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config;
|
|
715
748
|
this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);
|
|
716
749
|
if (maxConcurrentStreams) {
|
|
@@ -720,9 +753,12 @@ class NodeHttp2Handler {
|
|
|
720
753
|
this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions);
|
|
721
754
|
}
|
|
722
755
|
}
|
|
723
|
-
const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
|
|
756
|
+
const { requestTimeout: configRequestTimeout, disableConcurrentStreams, sessionTimeout } = this.config;
|
|
724
757
|
const useIsolatedSession = disableConcurrentStreams || isEventStream;
|
|
725
758
|
const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
|
|
759
|
+
const defaultSocketTimeout = effectiveRequestTimeout === undefined && sessionTimeout === undefined
|
|
760
|
+
? this.config.defaultSocketTimeout
|
|
761
|
+
: undefined;
|
|
726
762
|
return new Promise((_resolve, _reject) => {
|
|
727
763
|
let fulfilled = false;
|
|
728
764
|
let writeRequestBodyPromise = undefined;
|
|
@@ -785,6 +821,19 @@ class NodeHttp2Handler {
|
|
|
785
821
|
rejectWithDestroy(timeoutError);
|
|
786
822
|
});
|
|
787
823
|
}
|
|
824
|
+
else if (defaultSocketTimeout) {
|
|
825
|
+
clientHttp2Stream.setTimeout(defaultSocketTimeout, () => {
|
|
826
|
+
const timeoutError = new Error(`Stream timed out because of no activity for ${defaultSocketTimeout} ms`);
|
|
827
|
+
timeoutError.name = "TimeoutError";
|
|
828
|
+
fulfilled = true;
|
|
829
|
+
reject(timeoutError);
|
|
830
|
+
clientHttp2Stream.destroy(timeoutError);
|
|
831
|
+
if (useIsolatedSession) {
|
|
832
|
+
ref.destroy();
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
clientHttp2Stream.once("response", () => clientHttp2Stream.setTimeout(defaultSocketTimeout));
|
|
836
|
+
}
|
|
788
837
|
if (abortSignal) {
|
|
789
838
|
const onAbort = () => {
|
|
790
839
|
clientHttp2Stream.close();
|
|
@@ -843,6 +892,12 @@ class NodeHttp2Handler {
|
|
|
843
892
|
updateHttpClientConfig(key, value) {
|
|
844
893
|
this.config = undefined;
|
|
845
894
|
this.configProvider = this.configProvider.then((config) => {
|
|
895
|
+
switch (key) {
|
|
896
|
+
case Symbol.for("@smithy/defaultSocketTimeout"):
|
|
897
|
+
key = "defaultSocketTimeout";
|
|
898
|
+
value = resolveDefaultSocketTimeout(config) ?? value;
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
846
901
|
return {
|
|
847
902
|
...config,
|
|
848
903
|
[key]: value,
|
|
@@ -2,8 +2,9 @@ import { hasOwn } from "@smithy/core/serde";
|
|
|
2
2
|
const getTransformedHeaders = (headers) => {
|
|
3
3
|
const transformedHeaders = {};
|
|
4
4
|
for (const name in headers) {
|
|
5
|
-
if (!hasOwn(headers, name))
|
|
5
|
+
if (!hasOwn(headers, name)) {
|
|
6
6
|
continue;
|
|
7
|
+
}
|
|
7
8
|
const headerValues = headers[name];
|
|
8
9
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
9
10
|
}
|
|
@@ -7,6 +7,7 @@ import { node_https } from "./node-https";
|
|
|
7
7
|
import { setConnectionTimeout } from "./set-connection-timeout";
|
|
8
8
|
import { setRequestTimeout } from "./set-request-timeout";
|
|
9
9
|
import { setSocketKeepAlive } from "./set-socket-keep-alive";
|
|
10
|
+
import { resolveDefaultSocketTimeout } from "./resolve-default-socket-timeout";
|
|
10
11
|
import { setSocketTimeout } from "./set-socket-timeout";
|
|
11
12
|
import { timing } from "./timing";
|
|
12
13
|
import { writeRequestBody } from "./write-request-body";
|
|
@@ -36,8 +37,9 @@ export class NodeHttpHandler {
|
|
|
36
37
|
}
|
|
37
38
|
if (sockets && requests) {
|
|
38
39
|
for (const origin in sockets) {
|
|
39
|
-
if (!hasOwn(sockets, origin))
|
|
40
|
+
if (!hasOwn(sockets, origin)) {
|
|
40
41
|
continue;
|
|
42
|
+
}
|
|
41
43
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
42
44
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
43
45
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
@@ -83,13 +85,11 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
83
85
|
let socketWarningTimeoutId = -1;
|
|
84
86
|
let connectionTimeoutId = -1;
|
|
85
87
|
let requestTimeoutId = -1;
|
|
86
|
-
let socketTimeoutId = -1;
|
|
87
88
|
let keepAliveTimeoutId = -1;
|
|
88
89
|
const clearTimeouts = () => {
|
|
89
90
|
timing.clearTimeout(socketWarningTimeoutId);
|
|
90
91
|
timing.clearTimeout(connectionTimeoutId);
|
|
91
92
|
timing.clearTimeout(requestTimeoutId);
|
|
92
|
-
timing.clearTimeout(socketTimeoutId);
|
|
93
93
|
timing.clearTimeout(keepAliveTimeoutId);
|
|
94
94
|
};
|
|
95
95
|
const resolve = async (arg) => {
|
|
@@ -185,7 +185,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
185
185
|
const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout;
|
|
186
186
|
connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout);
|
|
187
187
|
requestTimeoutId = setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, logger ?? console);
|
|
188
|
-
|
|
188
|
+
const defaultSocketTimeout = config.socketTimeout === undefined ? resolveDefaultSocketTimeout(config) : undefined;
|
|
189
|
+
if (defaultSocketTimeout) {
|
|
190
|
+
setSocketTimeout(req, reject, defaultSocketTimeout, true);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
setSocketTimeout(req, reject, config.socketTimeout);
|
|
194
|
+
}
|
|
189
195
|
const httpAgent = nodeHttpsOptions.agent;
|
|
190
196
|
if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
|
|
191
197
|
keepAliveTimeoutId = setSocketKeepAlive(req, {
|
|
@@ -202,11 +208,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
202
208
|
updateHttpClientConfig(key, value) {
|
|
203
209
|
this.config = undefined;
|
|
204
210
|
this.configProvider = this.configProvider.then((config) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
switch (key) {
|
|
212
|
+
case Symbol.for("logger"):
|
|
213
|
+
key = "logger";
|
|
214
|
+
value = config.logger ?? value;
|
|
215
|
+
break;
|
|
216
|
+
case Symbol.for("@smithy/defaultSocketTimeout"):
|
|
217
|
+
key = "defaultSocketTimeout";
|
|
218
|
+
value = resolveDefaultSocketTimeout(config) ?? value;
|
|
219
|
+
break;
|
|
210
220
|
}
|
|
211
221
|
return {
|
|
212
222
|
...config,
|
|
@@ -221,13 +231,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
221
231
|
const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {};
|
|
222
232
|
const keepAlive = true;
|
|
223
233
|
const maxSockets = 50;
|
|
234
|
+
let httpAgentPromise;
|
|
224
235
|
return {
|
|
225
236
|
connectionTimeout,
|
|
226
237
|
requestTimeout,
|
|
227
238
|
socketTimeout,
|
|
239
|
+
defaultSocketTimeout: resolveDefaultSocketTimeout(options),
|
|
228
240
|
socketAcquisitionWarningTimeout,
|
|
229
241
|
throwOnRequestTimeout,
|
|
230
|
-
httpAgentProvider: async () => {
|
|
242
|
+
httpAgentProvider: () => (httpAgentPromise ??= (async () => {
|
|
231
243
|
const node_http = await import("node:http");
|
|
232
244
|
const { Agent, request } = node_http.default ?? node_http;
|
|
233
245
|
hRequest = request;
|
|
@@ -237,7 +249,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
237
249
|
return httpAgent;
|
|
238
250
|
}
|
|
239
251
|
return new hAgent({ keepAlive, maxSockets, ...httpAgent });
|
|
240
|
-
},
|
|
252
|
+
})()),
|
|
241
253
|
httpsAgent: (() => {
|
|
242
254
|
if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") {
|
|
243
255
|
this.externalAgent = true;
|
|
@@ -3,6 +3,7 @@ import { buildAbortError } from "./build-abort-error";
|
|
|
3
3
|
import { getTransformedHeaders } from "./get-transformed-headers";
|
|
4
4
|
import { node_http2 } from "./node-http2";
|
|
5
5
|
import { NodeHttp2ConnectionManager } from "./node-http2-connection-manager";
|
|
6
|
+
import { resolveDefaultSocketTimeout } from "./resolve-default-socket-timeout";
|
|
6
7
|
import { writeRequestBody } from "./write-request-body";
|
|
7
8
|
const { constants } = node_http2;
|
|
8
9
|
export class NodeHttp2Handler {
|
|
@@ -35,7 +36,8 @@ export class NodeHttp2Handler {
|
|
|
35
36
|
}
|
|
36
37
|
async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) {
|
|
37
38
|
if (!this.config) {
|
|
38
|
-
|
|
39
|
+
const config = await this.configProvider;
|
|
40
|
+
this.config = { ...config, defaultSocketTimeout: resolveDefaultSocketTimeout(config) };
|
|
39
41
|
const { disableConcurrentStreams, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config;
|
|
40
42
|
this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);
|
|
41
43
|
if (maxConcurrentStreams) {
|
|
@@ -45,9 +47,12 @@ export class NodeHttp2Handler {
|
|
|
45
47
|
this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
|
|
50
|
+
const { requestTimeout: configRequestTimeout, disableConcurrentStreams, sessionTimeout } = this.config;
|
|
49
51
|
const useIsolatedSession = disableConcurrentStreams || isEventStream;
|
|
50
52
|
const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
|
|
53
|
+
const defaultSocketTimeout = effectiveRequestTimeout === undefined && sessionTimeout === undefined
|
|
54
|
+
? this.config.defaultSocketTimeout
|
|
55
|
+
: undefined;
|
|
51
56
|
return new Promise((_resolve, _reject) => {
|
|
52
57
|
let fulfilled = false;
|
|
53
58
|
let writeRequestBodyPromise = undefined;
|
|
@@ -110,6 +115,19 @@ export class NodeHttp2Handler {
|
|
|
110
115
|
rejectWithDestroy(timeoutError);
|
|
111
116
|
});
|
|
112
117
|
}
|
|
118
|
+
else if (defaultSocketTimeout) {
|
|
119
|
+
clientHttp2Stream.setTimeout(defaultSocketTimeout, () => {
|
|
120
|
+
const timeoutError = new Error(`Stream timed out because of no activity for ${defaultSocketTimeout} ms`);
|
|
121
|
+
timeoutError.name = "TimeoutError";
|
|
122
|
+
fulfilled = true;
|
|
123
|
+
reject(timeoutError);
|
|
124
|
+
clientHttp2Stream.destroy(timeoutError);
|
|
125
|
+
if (useIsolatedSession) {
|
|
126
|
+
ref.destroy();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
clientHttp2Stream.once("response", () => clientHttp2Stream.setTimeout(defaultSocketTimeout));
|
|
130
|
+
}
|
|
113
131
|
if (abortSignal) {
|
|
114
132
|
const onAbort = () => {
|
|
115
133
|
clientHttp2Stream.close();
|
|
@@ -168,6 +186,12 @@ export class NodeHttp2Handler {
|
|
|
168
186
|
updateHttpClientConfig(key, value) {
|
|
169
187
|
this.config = undefined;
|
|
170
188
|
this.configProvider = this.configProvider.then((config) => {
|
|
189
|
+
switch (key) {
|
|
190
|
+
case Symbol.for("@smithy/defaultSocketTimeout"):
|
|
191
|
+
key = "defaultSocketTimeout";
|
|
192
|
+
value = resolveDefaultSocketTimeout(config) ?? value;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
171
195
|
return {
|
|
172
196
|
...config,
|
|
173
197
|
[key]: value,
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
import { timing } from "./timing";
|
|
2
2
|
const DEFER_EVENT_LISTENER_TIME = 3000;
|
|
3
|
-
export const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
request.socket
|
|
12
|
-
|
|
3
|
+
export const setSocketTimeout = (request, reject, timeoutInMs = 0, isServiceDefault = false) => {
|
|
4
|
+
if (!Number.isFinite(timeoutInMs) || timeoutInMs <= 0) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
let response;
|
|
8
|
+
request.once("response", (res) => (response = res));
|
|
9
|
+
const onTimeout = () => {
|
|
10
|
+
if (response?.complete) {
|
|
11
|
+
request.socket?.destroy();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const error = Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (${isServiceDefault ? "service default socket timeout" : "configured by client requestHandler"}).`), { name: "TimeoutError" });
|
|
15
|
+
response?.destroy(error);
|
|
16
|
+
request.destroy();
|
|
17
|
+
reject(error);
|
|
18
|
+
};
|
|
19
|
+
const registerTimeout = () => {
|
|
20
|
+
const { socket } = request;
|
|
21
|
+
if (!socket) {
|
|
22
|
+
request.once("socket", registerTimeout);
|
|
23
|
+
}
|
|
24
|
+
else if (socket.connecting) {
|
|
25
|
+
socket.once("connect", registerTimeout);
|
|
13
26
|
}
|
|
14
27
|
else {
|
|
15
|
-
|
|
28
|
+
socket.setTimeout(timeoutInMs, onTimeout);
|
|
29
|
+
request.on("close", () => socket.removeListener("timeout", onTimeout));
|
|
16
30
|
}
|
|
17
31
|
};
|
|
18
|
-
if (
|
|
19
|
-
registerTimeout(
|
|
20
|
-
return
|
|
32
|
+
if (timeoutInMs < 6000) {
|
|
33
|
+
registerTimeout();
|
|
34
|
+
return;
|
|
21
35
|
}
|
|
22
|
-
|
|
36
|
+
const deferralId = timing.setTimeout(registerTimeout, DEFER_EVENT_LISTENER_TIME);
|
|
37
|
+
request.once("close", () => timing.clearTimeout(deferralId));
|
|
23
38
|
};
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import type { ClientRequest } from "node:http";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Sets a rolling socket idle timeout that stays armed through the response body. Timeouts of
|
|
4
|
+
* 6000 ms or more register after 3000 ms, so requests that finish sooner skip the socket
|
|
5
|
+
* listener, and may fire up to 3000 ms late. The timeout is not cancelled on headers. It is
|
|
6
|
+
* removed, or its deferral cleared, when the request closes.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
* @param isServiceDefault - whether timeoutInMs is the service default, which labels the error.
|
|
10
|
+
*/
|
|
11
|
+
export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, isServiceDefault?: boolean) => void;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { ClientRequest } from "node:http";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Sets a rolling socket idle timeout that stays armed through the response body. Timeouts of
|
|
4
|
+
* 6000 ms or more register after 3000 ms, so requests that finish sooner skip the socket
|
|
5
|
+
* listener, and may fire up to 3000 ms late. The timeout is not cancelled on headers. It is
|
|
6
|
+
* removed, or its deferral cleared, when the request closes.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
* @param isServiceDefault - whether timeoutInMs is the service default, which labels the error.
|
|
10
|
+
*/
|
|
11
|
+
export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, isServiceDefault?: boolean) => void;
|