@cdk8s/awscdk-resolver 0.0.375 → 0.0.376
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 +2 -2
- package/lib/resolve.js +1 -1
- package/node_modules/@smithy/abort-controller/dist-cjs/index.js +28 -80
- package/node_modules/@smithy/abort-controller/dist-es/AbortController.js +1 -3
- package/node_modules/@smithy/abort-controller/dist-es/AbortSignal.js +2 -2
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/dist-cjs/index.js +158 -215
- package/node_modules/@smithy/config-resolver/package.json +5 -5
- package/node_modules/@smithy/core/dist-cjs/index.js +308 -412
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +957 -969
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +198 -249
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +793 -895
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +617 -811
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +584 -680
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +18 -18
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +9 -7
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +3 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +3 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +16 -8
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +14 -14
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +1 -1
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +4 -2
- package/node_modules/@smithy/core/package.json +11 -11
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +340 -412
- package/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js +2 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +190 -238
- package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -0
- package/node_modules/@smithy/fetch-http-handler/package.json +6 -6
- package/node_modules/@smithy/hash-node/dist-cjs/index.js +38 -63
- package/node_modules/@smithy/hash-node/dist-es/index.js +3 -0
- package/node_modules/@smithy/hash-node/package.json +4 -4
- package/node_modules/@smithy/invalid-dependency/dist-cjs/index.js +7 -38
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +4 -30
- package/node_modules/@smithy/is-array-buffer/package.json +1 -1
- package/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +39 -64
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +1 -1
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +219 -277
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +327 -380
- package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.browser.js +1 -1
- package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +2 -2
- package/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js +1 -0
- package/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js +5 -1
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +89 -118
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/dist-cjs/index.js +274 -297
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/dist-cjs/index.js +51 -98
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +663 -771
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +5 -3
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +4 -2
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +3 -1
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -4
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +3 -1
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/dist-cjs/index.js +105 -158
- package/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js +1 -1
- package/node_modules/@smithy/property-provider/dist-es/ProviderError.js +2 -1
- package/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js +1 -1
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/dist-cjs/index.js +154 -246
- package/node_modules/@smithy/protocol-http/dist-es/Field.js +3 -0
- package/node_modules/@smithy/protocol-http/dist-es/Fields.js +2 -1
- package/node_modules/@smithy/protocol-http/dist-es/httpRequest.js +11 -0
- package/node_modules/@smithy/protocol-http/dist-es/httpResponse.js +4 -0
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/dist-cjs/index.js +21 -47
- package/node_modules/@smithy/querystring-builder/package.json +3 -3
- package/node_modules/@smithy/querystring-parser/dist-cjs/index.js +22 -48
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +70 -103
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +171 -210
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +1 -1
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +525 -648
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +1 -1
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +6 -0
- package/node_modules/@smithy/signature-v4/package.json +8 -8
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +554 -747
- package/node_modules/@smithy/smithy-client/dist-es/client.js +4 -1
- package/node_modules/@smithy/smithy-client/dist-es/command.js +17 -18
- package/node_modules/@smithy/smithy-client/dist-es/exceptions.js +4 -0
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-cjs/index.js +80 -133
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/dist-cjs/index.js +20 -46
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-base64/dist-cjs/index.js +16 -24
- package/node_modules/@smithy/util-base64/package.json +3 -3
- package/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js +26 -50
- package/node_modules/@smithy/util-body-length-browser/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +27 -50
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +17 -44
- package/node_modules/@smithy/util-buffer-from/package.json +2 -2
- package/node_modules/@smithy/util-config-provider/dist-cjs/index.js +26 -56
- package/node_modules/@smithy/util-config-provider/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/index.js +9 -22
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +4 -5
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js +2 -2
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +65 -110
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +445 -526
- package/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js +3 -2
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +29 -58
- package/node_modules/@smithy/util-hex-encoding/package.json +1 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/index.js +11 -40
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +260 -340
- package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +4 -1
- package/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js +1 -0
- package/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js +17 -8
- package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +5 -3
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js +3 -2
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +7 -3
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +2 -3
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +1 -1
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +2 -3
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.js +4 -8
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +83 -93
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +3 -7
- package/node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js +3 -2
- package/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js +5 -0
- package/node_modules/@smithy/util-stream/dist-es/headStream.js +3 -6
- package/node_modules/@smithy/util-stream/package.json +8 -8
- package/node_modules/@smithy/util-uri-escape/dist-cjs/index.js +6 -40
- package/node_modules/@smithy/util-uri-escape/package.json +1 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/index.js +27 -60
- package/node_modules/@smithy/util-utf8/package.json +2 -2
- package/node_modules/@smithy/util-waiter/dist-cjs/index.js +152 -189
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/node_modules/@smithy/uuid/dist-cjs/index.js +33 -42
- package/node_modules/@smithy/uuid/package.json +1 -1
- package/package.json +3 -3
- package/node_modules/@smithy/abort-controller/dist-cjs/AbortController.js +0 -1
- package/node_modules/@smithy/abort-controller/dist-cjs/AbortSignal.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/index.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/config.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/getRealRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/index.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/isFipsRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariant.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/PartitionHash.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/RegionHash.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getRegionInfo.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/index.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/Endpoint.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointMode.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/error/InstanceMetadataV1FallbackError.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromContainerMetadata.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromInstanceMetadata.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/index.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/retry.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/create-request.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/fetch-http-handler.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/request-timeout.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/stream-collector.js +0 -1
- package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidFunction.js +0 -1
- package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidProvider.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js +0 -1
- package/node_modules/@smithy/middleware-stack/dist-cjs/MiddlewareStack.js +0 -1
- package/node_modules/@smithy/middleware-stack/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/configLoader.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromEnv.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromSharedConfigFiles.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromStatic.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/getSelectorName.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/get-transformed-headers.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-manager.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-pool.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/readable.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/server.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-connection-timeout.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-keep-alive.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-timeout.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/collector.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/index.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/readable.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/timing.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/write-request-body.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/CredentialsProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/ProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/TokenProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/chain.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/fromStatic.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/memoize.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/Field.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/Fields.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/httpExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/index.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/service-error-classification/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/externalDataInterceptor.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigFilepath.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getProfileName.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSsoSessionData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/mergeConfigFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseIni.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseKnownFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/HeaderFormatter.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4Base.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/credentialDerivation.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalHeaders.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalQuery.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getPayloadHash.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/headerUtil.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/moveHeadersToQuery.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/prepareRequest.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/signature-v4a-container.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/suite.fixture.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/utilDate.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/abort-handler.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/abort.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpApiKeyAuth.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthScheme.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthSchemeProvider.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpSigner.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/IdentityProviderConfig.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/auth.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/blob/blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/checksum.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/client.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/command.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/config.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/manager.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/pool.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/crypto.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/downlevel-ts3.4/transform/type-transform.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/encode.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoint.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/shared.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/eventStream.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/checksum.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/defaultExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/retry.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/externals-check/browser-externals-check.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/feature-ids.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/http/httpHandlerInitialization.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/http.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/apiKeyIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/identity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/tokenIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/logger.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/middleware.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/pagination.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/profile.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/response.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/retry.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/schema.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/sentinels.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/traits.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/serde.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/shapes.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/signature.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/stream.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-common-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-output-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transfer.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/client-method-transforms.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/client-payload-blob-type-narrow.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/exact.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/mutable.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/no-undefined.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/type-transform.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/uri.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/util.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/waiter.js +0 -1
- package/node_modules/@smithy/util-body-length-browser/dist-cjs/calculateBodyLength.js +0 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/calculateBodyLength.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/booleanSelector.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/numberSelector.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/cache/EndpointCache.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/debugId.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/toDebugString.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/getEndpointUrlConfig.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/booleanEquals.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttr.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttrPathList.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isIpAddress.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isSet.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isValidHostLabel.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/not.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/parseURL.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/stringEquals.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/substring.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/uriEncode.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/resolveEndpoint.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointError.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/RuleSetObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/shared.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/callFunction.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/customEndpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/endpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateCondition.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateConditions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateErrorRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateExpression.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateRules.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTemplate.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTreeRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointHeaders.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperties.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperty.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointUrl.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getReferenceValue.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/index.js +0 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/getSmithyContext.js +0 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/DefaultRateLimiter.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/config.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryBackoffStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryToken.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/util-stream/dist-cjs/blob/Uint8ArrayBlobAdapter.js +0 -1
- package/node_modules/@smithy/util-stream/dist-cjs/blob/transforms.js +0 -1
- package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri-path.js +0 -1
- package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.browser.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUint8Array.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.browser.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/createWaiter.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/poller.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/index.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/sleep.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/validate.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/waiter.js +0 -1
- package/node_modules/@smithy/uuid/dist-cjs/randomUUID.browser.js +0 -1
- package/node_modules/@smithy/uuid/dist-cjs/v4.js +0 -1
|
@@ -1,358 +1,278 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
AdaptiveRetryStrategy: () => AdaptiveRetryStrategy,
|
|
24
|
-
ConfiguredRetryStrategy: () => ConfiguredRetryStrategy,
|
|
25
|
-
DEFAULT_MAX_ATTEMPTS: () => DEFAULT_MAX_ATTEMPTS,
|
|
26
|
-
DEFAULT_RETRY_DELAY_BASE: () => DEFAULT_RETRY_DELAY_BASE,
|
|
27
|
-
DEFAULT_RETRY_MODE: () => DEFAULT_RETRY_MODE,
|
|
28
|
-
DefaultRateLimiter: () => DefaultRateLimiter,
|
|
29
|
-
INITIAL_RETRY_TOKENS: () => INITIAL_RETRY_TOKENS,
|
|
30
|
-
INVOCATION_ID_HEADER: () => INVOCATION_ID_HEADER,
|
|
31
|
-
MAXIMUM_RETRY_DELAY: () => MAXIMUM_RETRY_DELAY,
|
|
32
|
-
NO_RETRY_INCREMENT: () => NO_RETRY_INCREMENT,
|
|
33
|
-
REQUEST_HEADER: () => REQUEST_HEADER,
|
|
34
|
-
RETRY_COST: () => RETRY_COST,
|
|
35
|
-
RETRY_MODES: () => RETRY_MODES,
|
|
36
|
-
StandardRetryStrategy: () => StandardRetryStrategy,
|
|
37
|
-
THROTTLING_RETRY_DELAY_BASE: () => THROTTLING_RETRY_DELAY_BASE,
|
|
38
|
-
TIMEOUT_RETRY_COST: () => TIMEOUT_RETRY_COST
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(index_exports);
|
|
3
|
+
var serviceErrorClassification = require('@smithy/service-error-classification');
|
|
41
4
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var DEFAULT_RETRY_MODE = "standard" /* STANDARD */;
|
|
5
|
+
exports.RETRY_MODES = void 0;
|
|
6
|
+
(function (RETRY_MODES) {
|
|
7
|
+
RETRY_MODES["STANDARD"] = "standard";
|
|
8
|
+
RETRY_MODES["ADAPTIVE"] = "adaptive";
|
|
9
|
+
})(exports.RETRY_MODES || (exports.RETRY_MODES = {}));
|
|
10
|
+
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
11
|
+
const DEFAULT_RETRY_MODE = exports.RETRY_MODES.STANDARD;
|
|
50
12
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*/
|
|
81
|
-
this.setTimeoutFn = setTimeout;
|
|
82
|
-
}
|
|
83
|
-
getCurrentTimeInSeconds() {
|
|
84
|
-
return Date.now() / 1e3;
|
|
85
|
-
}
|
|
86
|
-
async getSendToken() {
|
|
87
|
-
return this.acquireTokenBucket(1);
|
|
88
|
-
}
|
|
89
|
-
async acquireTokenBucket(amount) {
|
|
90
|
-
if (!this.enabled) {
|
|
91
|
-
return;
|
|
13
|
+
class DefaultRateLimiter {
|
|
14
|
+
static setTimeoutFn = setTimeout;
|
|
15
|
+
beta;
|
|
16
|
+
minCapacity;
|
|
17
|
+
minFillRate;
|
|
18
|
+
scaleConstant;
|
|
19
|
+
smooth;
|
|
20
|
+
currentCapacity = 0;
|
|
21
|
+
enabled = false;
|
|
22
|
+
lastMaxRate = 0;
|
|
23
|
+
measuredTxRate = 0;
|
|
24
|
+
requestCount = 0;
|
|
25
|
+
fillRate;
|
|
26
|
+
lastThrottleTime;
|
|
27
|
+
lastTimestamp = 0;
|
|
28
|
+
lastTxRateBucket;
|
|
29
|
+
maxCapacity;
|
|
30
|
+
timeWindow = 0;
|
|
31
|
+
constructor(options) {
|
|
32
|
+
this.beta = options?.beta ?? 0.7;
|
|
33
|
+
this.minCapacity = options?.minCapacity ?? 1;
|
|
34
|
+
this.minFillRate = options?.minFillRate ?? 0.5;
|
|
35
|
+
this.scaleConstant = options?.scaleConstant ?? 0.4;
|
|
36
|
+
this.smooth = options?.smooth ?? 0.8;
|
|
37
|
+
const currentTimeInSeconds = this.getCurrentTimeInSeconds();
|
|
38
|
+
this.lastThrottleTime = currentTimeInSeconds;
|
|
39
|
+
this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
|
|
40
|
+
this.fillRate = this.minFillRate;
|
|
41
|
+
this.maxCapacity = this.minCapacity;
|
|
92
42
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const delay = (amount - this.currentCapacity) / this.fillRate * 1e3;
|
|
96
|
-
await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
|
|
43
|
+
getCurrentTimeInSeconds() {
|
|
44
|
+
return Date.now() / 1000;
|
|
97
45
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
refillTokenBucket() {
|
|
101
|
-
const timestamp = this.getCurrentTimeInSeconds();
|
|
102
|
-
if (!this.lastTimestamp) {
|
|
103
|
-
this.lastTimestamp = timestamp;
|
|
104
|
-
return;
|
|
46
|
+
async getSendToken() {
|
|
47
|
+
return this.acquireTokenBucket(1);
|
|
105
48
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.calculateTimeWindow();
|
|
117
|
-
this.lastThrottleTime = this.getCurrentTimeInSeconds();
|
|
118
|
-
calculatedRate = this.cubicThrottle(rateToUse);
|
|
119
|
-
this.enableTokenBucket();
|
|
120
|
-
} else {
|
|
121
|
-
this.calculateTimeWindow();
|
|
122
|
-
calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
|
|
49
|
+
async acquireTokenBucket(amount) {
|
|
50
|
+
if (!this.enabled) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.refillTokenBucket();
|
|
54
|
+
if (amount > this.currentCapacity) {
|
|
55
|
+
const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000;
|
|
56
|
+
await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));
|
|
57
|
+
}
|
|
58
|
+
this.currentCapacity = this.currentCapacity - amount;
|
|
123
59
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
cubicSuccess(timestamp) {
|
|
134
|
-
return this.getPrecise(
|
|
135
|
-
this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
enableTokenBucket() {
|
|
139
|
-
this.enabled = true;
|
|
140
|
-
}
|
|
141
|
-
updateTokenBucketRate(newRate) {
|
|
142
|
-
this.refillTokenBucket();
|
|
143
|
-
this.fillRate = Math.max(newRate, this.minFillRate);
|
|
144
|
-
this.maxCapacity = Math.max(newRate, this.minCapacity);
|
|
145
|
-
this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
|
|
146
|
-
}
|
|
147
|
-
updateMeasuredRate() {
|
|
148
|
-
const t = this.getCurrentTimeInSeconds();
|
|
149
|
-
const timeBucket = Math.floor(t * 2) / 2;
|
|
150
|
-
this.requestCount++;
|
|
151
|
-
if (timeBucket > this.lastTxRateBucket) {
|
|
152
|
-
const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
|
|
153
|
-
this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
|
|
154
|
-
this.requestCount = 0;
|
|
155
|
-
this.lastTxRateBucket = timeBucket;
|
|
60
|
+
refillTokenBucket() {
|
|
61
|
+
const timestamp = this.getCurrentTimeInSeconds();
|
|
62
|
+
if (!this.lastTimestamp) {
|
|
63
|
+
this.lastTimestamp = timestamp;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
|
|
67
|
+
this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
|
|
68
|
+
this.lastTimestamp = timestamp;
|
|
156
69
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
70
|
+
updateClientSendingRate(response) {
|
|
71
|
+
let calculatedRate;
|
|
72
|
+
this.updateMeasuredRate();
|
|
73
|
+
if (serviceErrorClassification.isThrottlingError(response)) {
|
|
74
|
+
const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
|
|
75
|
+
this.lastMaxRate = rateToUse;
|
|
76
|
+
this.calculateTimeWindow();
|
|
77
|
+
this.lastThrottleTime = this.getCurrentTimeInSeconds();
|
|
78
|
+
calculatedRate = this.cubicThrottle(rateToUse);
|
|
79
|
+
this.enableTokenBucket();
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.calculateTimeWindow();
|
|
83
|
+
calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
|
|
84
|
+
}
|
|
85
|
+
const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
|
|
86
|
+
this.updateTokenBucketRate(newRate);
|
|
87
|
+
}
|
|
88
|
+
calculateTimeWindow() {
|
|
89
|
+
this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3));
|
|
90
|
+
}
|
|
91
|
+
cubicThrottle(rateToUse) {
|
|
92
|
+
return this.getPrecise(rateToUse * this.beta);
|
|
93
|
+
}
|
|
94
|
+
cubicSuccess(timestamp) {
|
|
95
|
+
return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
|
|
96
|
+
}
|
|
97
|
+
enableTokenBucket() {
|
|
98
|
+
this.enabled = true;
|
|
99
|
+
}
|
|
100
|
+
updateTokenBucketRate(newRate) {
|
|
101
|
+
this.refillTokenBucket();
|
|
102
|
+
this.fillRate = Math.max(newRate, this.minFillRate);
|
|
103
|
+
this.maxCapacity = Math.max(newRate, this.minCapacity);
|
|
104
|
+
this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
|
|
105
|
+
}
|
|
106
|
+
updateMeasuredRate() {
|
|
107
|
+
const t = this.getCurrentTimeInSeconds();
|
|
108
|
+
const timeBucket = Math.floor(t * 2) / 2;
|
|
109
|
+
this.requestCount++;
|
|
110
|
+
if (timeBucket > this.lastTxRateBucket) {
|
|
111
|
+
const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
|
|
112
|
+
this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
|
|
113
|
+
this.requestCount = 0;
|
|
114
|
+
this.lastTxRateBucket = timeBucket;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
getPrecise(num) {
|
|
118
|
+
return parseFloat(num.toFixed(8));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
162
121
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var REQUEST_HEADER = "amz-sdk-request";
|
|
122
|
+
const DEFAULT_RETRY_DELAY_BASE = 100;
|
|
123
|
+
const MAXIMUM_RETRY_DELAY = 20 * 1000;
|
|
124
|
+
const THROTTLING_RETRY_DELAY_BASE = 500;
|
|
125
|
+
const INITIAL_RETRY_TOKENS = 500;
|
|
126
|
+
const RETRY_COST = 5;
|
|
127
|
+
const TIMEOUT_RETRY_COST = 10;
|
|
128
|
+
const NO_RETRY_INCREMENT = 1;
|
|
129
|
+
const INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
|
|
130
|
+
const REQUEST_HEADER = "amz-sdk-request";
|
|
173
131
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, "getDefaultRetryBackoffStrategy");
|
|
132
|
+
const getDefaultRetryBackoffStrategy = () => {
|
|
133
|
+
let delayBase = DEFAULT_RETRY_DELAY_BASE;
|
|
134
|
+
const computeNextBackoffDelay = (attempts) => {
|
|
135
|
+
return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
|
|
136
|
+
};
|
|
137
|
+
const setDelayBase = (delay) => {
|
|
138
|
+
delayBase = delay;
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
computeNextBackoffDelay,
|
|
142
|
+
setDelayBase,
|
|
143
|
+
};
|
|
144
|
+
};
|
|
188
145
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
getRetryCount,
|
|
200
|
-
getRetryDelay,
|
|
201
|
-
getRetryCost
|
|
202
|
-
};
|
|
203
|
-
}, "createDefaultRetryToken");
|
|
146
|
+
const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => {
|
|
147
|
+
const getRetryCount = () => retryCount;
|
|
148
|
+
const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay);
|
|
149
|
+
const getRetryCost = () => retryCost;
|
|
150
|
+
return {
|
|
151
|
+
getRetryCount,
|
|
152
|
+
getRetryDelay,
|
|
153
|
+
getRetryCost,
|
|
154
|
+
};
|
|
155
|
+
};
|
|
204
156
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
static {
|
|
215
|
-
__name(this, "StandardRetryStrategy");
|
|
216
|
-
}
|
|
217
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
218
|
-
async acquireInitialRetryToken(retryTokenScope) {
|
|
219
|
-
return createDefaultRetryToken({
|
|
220
|
-
retryDelay: DEFAULT_RETRY_DELAY_BASE,
|
|
221
|
-
retryCount: 0
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
225
|
-
const maxAttempts = await this.getMaxAttempts();
|
|
226
|
-
if (this.shouldRetry(token, errorInfo, maxAttempts)) {
|
|
227
|
-
const errorType = errorInfo.errorType;
|
|
228
|
-
this.retryBackoffStrategy.setDelayBase(
|
|
229
|
-
errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE
|
|
230
|
-
);
|
|
231
|
-
const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
|
|
232
|
-
const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType;
|
|
233
|
-
const capacityCost = this.getCapacityCost(errorType);
|
|
234
|
-
this.capacity -= capacityCost;
|
|
235
|
-
return createDefaultRetryToken({
|
|
236
|
-
retryDelay,
|
|
237
|
-
retryCount: token.getRetryCount() + 1,
|
|
238
|
-
retryCost: capacityCost
|
|
239
|
-
});
|
|
157
|
+
class StandardRetryStrategy {
|
|
158
|
+
maxAttempts;
|
|
159
|
+
mode = exports.RETRY_MODES.STANDARD;
|
|
160
|
+
capacity = INITIAL_RETRY_TOKENS;
|
|
161
|
+
retryBackoffStrategy = getDefaultRetryBackoffStrategy();
|
|
162
|
+
maxAttemptsProvider;
|
|
163
|
+
constructor(maxAttempts) {
|
|
164
|
+
this.maxAttempts = maxAttempts;
|
|
165
|
+
this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
|
|
240
166
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* @returns the current available retry capacity.
|
|
248
|
-
*
|
|
249
|
-
* This number decreases when retries are executed and refills when requests or retries succeed.
|
|
250
|
-
*/
|
|
251
|
-
getCapacity() {
|
|
252
|
-
return this.capacity;
|
|
253
|
-
}
|
|
254
|
-
async getMaxAttempts() {
|
|
255
|
-
try {
|
|
256
|
-
return await this.maxAttemptsProvider();
|
|
257
|
-
} catch (error) {
|
|
258
|
-
console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
|
|
259
|
-
return DEFAULT_MAX_ATTEMPTS;
|
|
167
|
+
async acquireInitialRetryToken(retryTokenScope) {
|
|
168
|
+
return createDefaultRetryToken({
|
|
169
|
+
retryDelay: DEFAULT_RETRY_DELAY_BASE,
|
|
170
|
+
retryCount: 0,
|
|
171
|
+
});
|
|
260
172
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
173
|
+
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
174
|
+
const maxAttempts = await this.getMaxAttempts();
|
|
175
|
+
if (this.shouldRetry(token, errorInfo, maxAttempts)) {
|
|
176
|
+
const errorType = errorInfo.errorType;
|
|
177
|
+
this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);
|
|
178
|
+
const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
|
|
179
|
+
const retryDelay = errorInfo.retryAfterHint
|
|
180
|
+
? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType)
|
|
181
|
+
: delayFromErrorType;
|
|
182
|
+
const capacityCost = this.getCapacityCost(errorType);
|
|
183
|
+
this.capacity -= capacityCost;
|
|
184
|
+
return createDefaultRetryToken({
|
|
185
|
+
retryDelay,
|
|
186
|
+
retryCount: token.getRetryCount() + 1,
|
|
187
|
+
retryCost: capacityCost,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
throw new Error("No retry token available");
|
|
191
|
+
}
|
|
192
|
+
recordSuccess(token) {
|
|
193
|
+
this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
|
|
194
|
+
}
|
|
195
|
+
getCapacity() {
|
|
196
|
+
return this.capacity;
|
|
197
|
+
}
|
|
198
|
+
async getMaxAttempts() {
|
|
199
|
+
try {
|
|
200
|
+
return await this.maxAttemptsProvider();
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
|
|
204
|
+
return DEFAULT_MAX_ATTEMPTS;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
|
|
208
|
+
const attempts = tokenToRenew.getRetryCount() + 1;
|
|
209
|
+
return (attempts < maxAttempts &&
|
|
210
|
+
this.capacity >= this.getCapacityCost(errorInfo.errorType) &&
|
|
211
|
+
this.isRetryableError(errorInfo.errorType));
|
|
212
|
+
}
|
|
213
|
+
getCapacityCost(errorType) {
|
|
214
|
+
return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
|
|
215
|
+
}
|
|
216
|
+
isRetryableError(errorType) {
|
|
217
|
+
return errorType === "THROTTLING" || errorType === "TRANSIENT";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
299
220
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
*
|
|
311
|
-
* @example exponential backoff.
|
|
312
|
-
* ```js
|
|
313
|
-
* new Client({
|
|
314
|
-
* retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2)
|
|
315
|
-
* });
|
|
316
|
-
* ```
|
|
317
|
-
* @example constant delay.
|
|
318
|
-
* ```js
|
|
319
|
-
* new Client({
|
|
320
|
-
* retryStrategy: new ConfiguredRetryStrategy(3, 2000)
|
|
321
|
-
* });
|
|
322
|
-
* ```
|
|
323
|
-
*/
|
|
324
|
-
constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) {
|
|
325
|
-
super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts);
|
|
326
|
-
if (typeof computeNextBackoffDelay === "number") {
|
|
327
|
-
this.computeNextBackoffDelay = () => computeNextBackoffDelay;
|
|
328
|
-
} else {
|
|
329
|
-
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
221
|
+
class AdaptiveRetryStrategy {
|
|
222
|
+
maxAttemptsProvider;
|
|
223
|
+
rateLimiter;
|
|
224
|
+
standardRetryStrategy;
|
|
225
|
+
mode = exports.RETRY_MODES.ADAPTIVE;
|
|
226
|
+
constructor(maxAttemptsProvider, options) {
|
|
227
|
+
this.maxAttemptsProvider = maxAttemptsProvider;
|
|
228
|
+
const { rateLimiter } = options ?? {};
|
|
229
|
+
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
|
|
230
|
+
this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
|
|
330
231
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
232
|
+
async acquireInitialRetryToken(retryTokenScope) {
|
|
233
|
+
await this.rateLimiter.getSendToken();
|
|
234
|
+
return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
|
|
235
|
+
}
|
|
236
|
+
async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
|
|
237
|
+
this.rateLimiter.updateClientSendingRate(errorInfo);
|
|
238
|
+
return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
|
|
239
|
+
}
|
|
240
|
+
recordSuccess(token) {
|
|
241
|
+
this.rateLimiter.updateClientSendingRate({});
|
|
242
|
+
this.standardRetryStrategy.recordSuccess(token);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
339
245
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
});
|
|
246
|
+
class ConfiguredRetryStrategy extends StandardRetryStrategy {
|
|
247
|
+
computeNextBackoffDelay;
|
|
248
|
+
constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) {
|
|
249
|
+
super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts);
|
|
250
|
+
if (typeof computeNextBackoffDelay === "number") {
|
|
251
|
+
this.computeNextBackoffDelay = () => computeNextBackoffDelay;
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
|
|
258
|
+
const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
|
|
259
|
+
token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount());
|
|
260
|
+
return token;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
358
263
|
|
|
264
|
+
exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy;
|
|
265
|
+
exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy;
|
|
266
|
+
exports.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS;
|
|
267
|
+
exports.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE;
|
|
268
|
+
exports.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE;
|
|
269
|
+
exports.DefaultRateLimiter = DefaultRateLimiter;
|
|
270
|
+
exports.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS;
|
|
271
|
+
exports.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER;
|
|
272
|
+
exports.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY;
|
|
273
|
+
exports.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT;
|
|
274
|
+
exports.REQUEST_HEADER = REQUEST_HEADER;
|
|
275
|
+
exports.RETRY_COST = RETRY_COST;
|
|
276
|
+
exports.StandardRetryStrategy = StandardRetryStrategy;
|
|
277
|
+
exports.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE;
|
|
278
|
+
exports.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST;
|
|
@@ -2,9 +2,12 @@ import { RETRY_MODES } from "./config";
|
|
|
2
2
|
import { DefaultRateLimiter } from "./DefaultRateLimiter";
|
|
3
3
|
import { StandardRetryStrategy } from "./StandardRetryStrategy";
|
|
4
4
|
export class AdaptiveRetryStrategy {
|
|
5
|
+
maxAttemptsProvider;
|
|
6
|
+
rateLimiter;
|
|
7
|
+
standardRetryStrategy;
|
|
8
|
+
mode = RETRY_MODES.ADAPTIVE;
|
|
5
9
|
constructor(maxAttemptsProvider, options) {
|
|
6
10
|
this.maxAttemptsProvider = maxAttemptsProvider;
|
|
7
|
-
this.mode = RETRY_MODES.ADAPTIVE;
|
|
8
11
|
const { rateLimiter } = options ?? {};
|
|
9
12
|
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
|
|
10
13
|
this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_RETRY_DELAY_BASE } from "./constants";
|
|
2
2
|
import { StandardRetryStrategy } from "./StandardRetryStrategy";
|
|
3
3
|
export class ConfiguredRetryStrategy extends StandardRetryStrategy {
|
|
4
|
+
computeNextBackoffDelay;
|
|
4
5
|
constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) {
|
|
5
6
|
super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts);
|
|
6
7
|
if (typeof computeNextBackoffDelay === "number") {
|