@smithy/util-retry
Advanced tools
Comparing version 3.0.11 to 4.0.0
@@ -53,3 +53,3 @@ var __defProp = Object.defineProperty; | ||
var import_service_error_classification = require("@smithy/service-error-classification"); | ||
var _DefaultRateLimiter = class _DefaultRateLimiter { | ||
var DefaultRateLimiter = class _DefaultRateLimiter { | ||
constructor(options) { | ||
@@ -64,7 +64,7 @@ // Pre-set state variables | ||
this.timeWindow = 0; | ||
this.beta = (options == null ? void 0 : options.beta) ?? 0.7; | ||
this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1; | ||
this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5; | ||
this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4; | ||
this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8; | ||
this.beta = options?.beta ?? 0.7; | ||
this.minCapacity = options?.minCapacity ?? 1; | ||
this.minFillRate = options?.minFillRate ?? 0.5; | ||
this.scaleConstant = options?.scaleConstant ?? 0.4; | ||
this.smooth = options?.smooth ?? 0.8; | ||
const currentTimeInSeconds = this.getCurrentTimeInSeconds(); | ||
@@ -76,2 +76,11 @@ this.lastThrottleTime = currentTimeInSeconds; | ||
} | ||
static { | ||
__name(this, "DefaultRateLimiter"); | ||
} | ||
static { | ||
/** | ||
* Only used in testing. | ||
*/ | ||
this.setTimeoutFn = setTimeout; | ||
} | ||
getCurrentTimeInSeconds() { | ||
@@ -156,8 +165,2 @@ return Date.now() / 1e3; | ||
}; | ||
__name(_DefaultRateLimiter, "DefaultRateLimiter"); | ||
/** | ||
* Only used in testing. | ||
*/ | ||
_DefaultRateLimiter.setTimeoutFn = setTimeout; | ||
var DefaultRateLimiter = _DefaultRateLimiter; | ||
@@ -207,3 +210,3 @@ // src/constants.ts | ||
// src/StandardRetryStrategy.ts | ||
var _StandardRetryStrategy = class _StandardRetryStrategy { | ||
var StandardRetryStrategy = class { | ||
constructor(maxAttempts) { | ||
@@ -216,2 +219,5 @@ this.maxAttempts = maxAttempts; | ||
} | ||
static { | ||
__name(this, "StandardRetryStrategy"); | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
@@ -273,7 +279,5 @@ async acquireInitialRetryToken(retryTokenScope) { | ||
}; | ||
__name(_StandardRetryStrategy, "StandardRetryStrategy"); | ||
var StandardRetryStrategy = _StandardRetryStrategy; | ||
// src/AdaptiveRetryStrategy.ts | ||
var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy { | ||
var AdaptiveRetryStrategy = class { | ||
constructor(maxAttemptsProvider, options) { | ||
@@ -286,2 +290,5 @@ this.maxAttemptsProvider = maxAttemptsProvider; | ||
} | ||
static { | ||
__name(this, "AdaptiveRetryStrategy"); | ||
} | ||
async acquireInitialRetryToken(retryTokenScope) { | ||
@@ -300,7 +307,8 @@ await this.rateLimiter.getSendToken(); | ||
}; | ||
__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); | ||
var AdaptiveRetryStrategy = _AdaptiveRetryStrategy; | ||
// src/ConfiguredRetryStrategy.ts | ||
var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy { | ||
var ConfiguredRetryStrategy = class extends StandardRetryStrategy { | ||
static { | ||
__name(this, "ConfiguredRetryStrategy"); | ||
} | ||
/** | ||
@@ -339,4 +347,2 @@ * @param maxAttempts - the maximum number of retry attempts allowed. | ||
}; | ||
__name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy"); | ||
var ConfiguredRetryStrategy = _ConfiguredRetryStrategy; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -343,0 +349,0 @@ |
{ | ||
"name": "@smithy/util-retry", | ||
"version": "3.0.11", | ||
"version": "4.0.0", | ||
"description": "Shared retry utilities to be used in middleware packages.", | ||
@@ -31,8 +31,8 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@smithy/service-error-classification": "^3.0.11", | ||
"@smithy/types": "^3.7.2", | ||
"@smithy/service-error-classification": "^4.0.0", | ||
"@smithy/types": "^4.0.0", | ||
"tslib": "^2.6.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^16.18.96", | ||
"@types/node": "^18.11.9", | ||
"concurrently": "7.0.0", | ||
@@ -45,3 +45,3 @@ "downlevel-dts": "0.10.1", | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "typesVersions": { |
1121
57177
+ Added@smithy/service-error-classification@4.0.1(transitive)
+ Added@smithy/types@4.1.0(transitive)
- Removed@smithy/service-error-classification@3.0.11(transitive)
- Removed@smithy/types@3.7.2(transitive)
Updated@smithy/types@^4.0.0