Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/middleware-retry

Package Overview
Dependencies
Maintainers
5
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-retry - npm Package Compare versions

Comparing version 3.169.0 to 3.170.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13)
**Note:** Version bump only for package @aws-sdk/middleware-retry
# [3.169.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.168.0...v3.169.0) (2022-09-12)

@@ -8,0 +16,0 @@

35

dist-types/ts3.4/AdaptiveRetryStrategy.d.ts

@@ -1,15 +0,30 @@

import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider } from "@aws-sdk/types";
import { StandardRetryStrategy, StandardRetryStrategyOptions } from "./StandardRetryStrategy";
import {
FinalizeHandler,
FinalizeHandlerArguments,
MetadataBearer,
Provider,
} from "@aws-sdk/types";
import {
StandardRetryStrategy,
StandardRetryStrategyOptions,
} from "./StandardRetryStrategy";
import { RateLimiter } from "./types";
export interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptions {
rateLimiter?: RateLimiter;
export interface AdaptiveRetryStrategyOptions
extends StandardRetryStrategyOptions {
rateLimiter?: RateLimiter;
}
export declare class AdaptiveRetryStrategy extends StandardRetryStrategy {
private rateLimiter;
constructor(maxAttemptsProvider: Provider<number>, options?: AdaptiveRetryStrategyOptions);
retry<Input extends object, Ouput extends MetadataBearer>(next: FinalizeHandler<Input, Ouput>, args: FinalizeHandlerArguments<Input>): Promise<{
response: unknown;
output: Ouput;
}>;
private rateLimiter;
constructor(
maxAttemptsProvider: Provider<number>,
options?: AdaptiveRetryStrategyOptions
);
retry<Input extends object, Ouput extends MetadataBearer>(
next: FinalizeHandler<Input, Ouput>,
args: FinalizeHandlerArguments<Input>
): Promise<{
response: unknown;
output: Ouput;
}>;
}
export declare enum RETRY_MODES {
STANDARD = "standard",
ADAPTIVE = "adaptive"
STANDARD = "standard",
ADAPTIVE = "adaptive",
}

@@ -5,0 +5,0 @@

@@ -7,18 +7,17 @@ import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";

export interface RetryInputConfig {
maxAttempts?: number | Provider<number>;
retryStrategy?: RetryStrategy;
maxAttempts?: number | Provider<number>;
retryStrategy?: RetryStrategy;
}
interface PreviouslyResolved {
retryMode: string | Provider<string>;
retryMode: string | Provider<string>;
}
export interface RetryResolvedConfig {
maxAttempts: Provider<number>;
retryStrategy: Provider<RetryStrategy>;
maxAttempts: Provider<number>;
retryStrategy: Provider<RetryStrategy>;
}
export declare const resolveRetryConfig: <T>(input: T & PreviouslyResolved & RetryInputConfig) => T & RetryResolvedConfig;
export declare const resolveRetryConfig: <T>(
input: T & PreviouslyResolved & RetryInputConfig
) => T & RetryResolvedConfig;
export declare const ENV_RETRY_MODE = "AWS_RETRY_MODE";

@@ -25,0 +24,0 @@ export declare const CONFIG_RETRY_MODE = "retry_mode";

@@ -1,2 +0,1 @@

export declare const DEFAULT_RETRY_DELAY_BASE = 100;

@@ -3,0 +2,0 @@

import { RateLimiter } from "./types";
export interface DefaultRateLimiterOptions {
beta?: number;
minCapacity?: number;
minFillRate?: number;
scaleConstant?: number;
smooth?: number;
beta?: number;
minCapacity?: number;
minFillRate?: number;
scaleConstant?: number;
smooth?: number;
}
export declare class DefaultRateLimiter implements RateLimiter {
private beta;
private minCapacity;
private minFillRate;
private scaleConstant;
private smooth;
private currentCapacity;
private enabled;
private lastMaxRate;
private measuredTxRate;
private requestCount;
private fillRate;
private lastThrottleTime;
private lastTimestamp;
private lastTxRateBucket;
private maxCapacity;
private timeWindow;
constructor(options?: DefaultRateLimiterOptions);
private getCurrentTimeInSeconds;
getSendToken(): Promise<void>;
private acquireTokenBucket;
private refillTokenBucket;
updateClientSendingRate(response: any): void;
private calculateTimeWindow;
private cubicThrottle;
private cubicSuccess;
private enableTokenBucket;
private updateTokenBucketRate;
private updateMeasuredRate;
private getPrecise;
private beta;
private minCapacity;
private minFillRate;
private scaleConstant;
private smooth;
private currentCapacity;
private enabled;
private lastMaxRate;
private measuredTxRate;
private requestCount;
private fillRate;
private lastThrottleTime;
private lastTimestamp;
private lastTxRateBucket;
private maxCapacity;
private timeWindow;
constructor(options?: DefaultRateLimiterOptions);
private getCurrentTimeInSeconds;
getSendToken(): Promise<void>;
private acquireTokenBucket;
private refillTokenBucket;
updateClientSendingRate(response: any): void;
private calculateTimeWindow;
private cubicThrottle;
private cubicSuccess;
private enableTokenBucket;
private updateTokenBucketRate;
private updateMeasuredRate;
private getPrecise;
}
import { RetryQuota } from "./types";
export interface DefaultRetryQuotaOptions {
noRetryIncrement?: number;
retryCost?: number;
timeoutRetryCost?: number;
noRetryIncrement?: number;
retryCost?: number;
timeoutRetryCost?: number;
}
export declare const getDefaultRetryQuota: (initialRetryTokens: number, options?: DefaultRetryQuotaOptions | undefined) => RetryQuota;
export declare const getDefaultRetryQuota: (
initialRetryTokens: number,
options?: DefaultRetryQuotaOptions | undefined
) => RetryQuota;

@@ -1,2 +0,4 @@

export declare const defaultDelayDecider: (delayBase: number, attempts: number) => number;
export declare const defaultDelayDecider: (
delayBase: number,
attempts: number
) => number;

@@ -0,0 +0,0 @@ export * from "./AdaptiveRetryStrategy";

@@ -1,4 +0,15 @@

import { FinalizeHandler, MetadataBearer, Pluggable, RelativeMiddlewareOptions } from "@aws-sdk/types";
export declare const omitRetryHeadersMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(next: FinalizeHandler<any, Output>) => FinalizeHandler<any, Output>;
import {
FinalizeHandler,
MetadataBearer,
Pluggable,
RelativeMiddlewareOptions,
} from "@aws-sdk/types";
export declare const omitRetryHeadersMiddleware: () => <
Output extends MetadataBearer = MetadataBearer
>(
next: FinalizeHandler<any, Output>
) => FinalizeHandler<any, Output>;
export declare const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions;
export declare const getOmitRetryHeadersPlugin: (options: unknown) => Pluggable<any, any>;
export declare const getOmitRetryHeadersPlugin: (
options: unknown
) => Pluggable<any, any>;
import { SdkError } from "@aws-sdk/types";
export declare const defaultRetryDecider: (error: SdkError) => boolean;

@@ -1,5 +0,20 @@

import { AbsoluteLocation, FinalizeHandler, FinalizeRequestHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@aws-sdk/types";
import {
AbsoluteLocation,
FinalizeHandler,
FinalizeRequestHandlerOptions,
HandlerExecutionContext,
MetadataBearer,
Pluggable,
} from "@aws-sdk/types";
import { RetryResolvedConfig } from "./configurations";
export declare const retryMiddleware: (options: RetryResolvedConfig) => <Output extends MetadataBearer = MetadataBearer>(next: FinalizeHandler<any, Output>, context: HandlerExecutionContext) => FinalizeHandler<any, Output>;
export declare const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation;
export declare const getRetryPlugin: (options: RetryResolvedConfig) => Pluggable<any, any>;
export declare const retryMiddleware: (
options: RetryResolvedConfig
) => <Output extends MetadataBearer = MetadataBearer>(
next: FinalizeHandler<any, Output>,
context: HandlerExecutionContext
) => FinalizeHandler<any, Output>;
export declare const retryMiddlewareOptions: FinalizeRequestHandlerOptions &
AbsoluteLocation;
export declare const getRetryPlugin: (
options: RetryResolvedConfig
) => Pluggable<any, any>;

@@ -1,25 +0,38 @@

import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider, RetryStrategy } from "@aws-sdk/types";
import {
FinalizeHandler,
FinalizeHandlerArguments,
MetadataBearer,
Provider,
RetryStrategy,
} from "@aws-sdk/types";
import { DelayDecider, RetryDecider, RetryQuota } from "./types";
export interface StandardRetryStrategyOptions {
retryDecider?: RetryDecider;
delayDecider?: DelayDecider;
retryQuota?: RetryQuota;
retryDecider?: RetryDecider;
delayDecider?: DelayDecider;
retryQuota?: RetryQuota;
}
export declare class StandardRetryStrategy implements RetryStrategy {
private readonly maxAttemptsProvider;
private retryDecider;
private delayDecider;
private retryQuota;
mode: string;
constructor(maxAttemptsProvider: Provider<number>, options?: StandardRetryStrategyOptions);
private shouldRetry;
private getMaxAttempts;
retry<Input extends object, Ouput extends MetadataBearer>(next: FinalizeHandler<Input, Ouput>, args: FinalizeHandlerArguments<Input>, options?: {
beforeRequest: Function;
afterRequest: Function;
}): Promise<{
response: unknown;
output: Ouput;
}>;
private readonly maxAttemptsProvider;
private retryDecider;
private delayDecider;
private retryQuota;
mode: string;
constructor(
maxAttemptsProvider: Provider<number>,
options?: StandardRetryStrategyOptions
);
private shouldRetry;
private getMaxAttempts;
retry<Input extends object, Ouput extends MetadataBearer>(
next: FinalizeHandler<Input, Ouput>,
args: FinalizeHandlerArguments<Input>,
options?: {
beforeRequest: Function;
afterRequest: Function;
}
): Promise<{
response: unknown;
output: Ouput;
}>;
}
import { SdkError } from "@aws-sdk/types";
export interface RetryDecider {
(error: SdkError): boolean;
(error: SdkError): boolean;
}
export interface DelayDecider {
(delayBase: number, attempts: number): number;
(delayBase: number, attempts: number): number;
}
export interface RetryQuota {
hasRetryTokens: (error: SdkError) => boolean;
retrieveRetryTokens: (error: SdkError) => number;
releaseRetryTokens: (releaseCapacityAmount?: number) => void;
hasRetryTokens: (error: SdkError) => boolean;
retrieveRetryTokens: (error: SdkError) => number;
releaseRetryTokens: (releaseCapacityAmount?: number) => void;
}
export interface RateLimiter {
getSendToken: () => Promise<void>;
updateClientSendingRate: (response: any) => void;
getSendToken: () => Promise<void>;
updateClientSendingRate: (response: any) => void;
}
{
"name": "@aws-sdk/middleware-retry",
"version": "3.169.0",
"version": "3.170.0",
"scripts": {

@@ -23,6 +23,6 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",

"dependencies": {
"@aws-sdk/protocol-http": "3.168.0",
"@aws-sdk/service-error-classification": "3.168.0",
"@aws-sdk/types": "3.168.0",
"@aws-sdk/util-middleware": "3.168.0",
"@aws-sdk/protocol-http": "3.170.0",
"@aws-sdk/service-error-classification": "3.170.0",
"@aws-sdk/types": "3.170.0",
"@aws-sdk/util-middleware": "3.170.0",
"tslib": "^2.3.1",

@@ -32,7 +32,7 @@ "uuid": "^8.3.2"

"devDependencies": {
"@aws-sdk/node-config-provider": "3.168.0",
"@aws-sdk/node-config-provider": "3.170.0",
"@tsconfig/recommended": "1.0.1",
"@types/uuid": "^8.3.0",
"concurrently": "7.0.0",
"downlevel-dts": "0.7.0",
"downlevel-dts": "0.10.1",
"rimraf": "3.0.2",

@@ -39,0 +39,0 @@ "typedoc": "0.19.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc