@smithy/middleware-retry 4.0.6 → 4.1.0

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## Usage
7
7
 
8
- See [@smithy/util-retry](https://github.com/awslabs/smithy-typescript/tree/main/packages/util-retry)
8
+ See [@smithy/util-retry](https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-retry)
9
9
  for retry behavior and configuration.
10
10
 
11
11
  See also: [AWS Documentation: Retry behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html).
package/dist-cjs/index.js CHANGED
@@ -243,22 +243,21 @@ var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
243
243
  default: import_util_retry.DEFAULT_MAX_ATTEMPTS
244
244
  };
245
245
  var resolveRetryConfig = /* @__PURE__ */ __name((input) => {
246
- const { retryStrategy } = input;
247
- const maxAttempts = (0, import_util_middleware.normalizeProvider)(input.maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS);
248
- return {
249
- ...input,
246
+ const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
247
+ const maxAttempts = (0, import_util_middleware.normalizeProvider)(_maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS);
248
+ return Object.assign(input, {
250
249
  maxAttempts,
251
250
  retryStrategy: async () => {
252
251
  if (retryStrategy) {
253
252
  return retryStrategy;
254
253
  }
255
- const retryMode = await (0, import_util_middleware.normalizeProvider)(input.retryMode)();
254
+ const retryMode = await (0, import_util_middleware.normalizeProvider)(_retryMode)();
256
255
  if (retryMode === import_util_retry.RETRY_MODES.ADAPTIVE) {
257
256
  return new import_util_retry.AdaptiveRetryStrategy(maxAttempts);
258
257
  }
259
258
  return new import_util_retry.StandardRetryStrategy(maxAttempts);
260
259
  }
261
- };
260
+ });
262
261
  }, "resolveRetryConfig");
263
262
  var ENV_RETRY_MODE = "AWS_RETRY_MODE";
264
263
  var CONFIG_RETRY_MODE = "retry_mode";
@@ -26,22 +26,21 @@ export const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
26
26
  default: DEFAULT_MAX_ATTEMPTS,
27
27
  };
28
28
  export const resolveRetryConfig = (input) => {
29
- const { retryStrategy } = input;
30
- const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
31
- return {
32
- ...input,
29
+ const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
30
+ const maxAttempts = normalizeProvider(_maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
31
+ return Object.assign(input, {
33
32
  maxAttempts,
34
33
  retryStrategy: async () => {
35
34
  if (retryStrategy) {
36
35
  return retryStrategy;
37
36
  }
38
- const retryMode = await normalizeProvider(input.retryMode)();
37
+ const retryMode = await normalizeProvider(_retryMode)();
39
38
  if (retryMode === RETRY_MODES.ADAPTIVE) {
40
39
  return new AdaptiveRetryStrategy(maxAttempts);
41
40
  }
42
41
  return new StandardRetryStrategy(maxAttempts);
43
42
  },
44
- };
43
+ });
45
44
  };
46
45
  export const ENV_RETRY_MODE = "AWS_RETRY_MODE";
47
46
  export const CONFIG_RETRY_MODE = "retry_mode";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-retry",
3
- "version": "4.0.6",
3
+ "version": "4.1.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline middleware-retry",
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "license": "Apache-2.0",
35
35
  "dependencies": {
36
- "@smithy/node-config-provider": "^4.0.1",
37
- "@smithy/protocol-http": "^5.0.1",
38
- "@smithy/service-error-classification": "^4.0.1",
39
- "@smithy/smithy-client": "^4.1.5",
40
- "@smithy/types": "^4.1.0",
41
- "@smithy/util-middleware": "^4.0.1",
42
- "@smithy/util-retry": "^4.0.1",
36
+ "@smithy/node-config-provider": "^4.0.2",
37
+ "@smithy/protocol-http": "^5.1.0",
38
+ "@smithy/service-error-classification": "^4.0.2",
39
+ "@smithy/smithy-client": "^4.2.0",
40
+ "@smithy/types": "^4.2.0",
41
+ "@smithy/util-middleware": "^4.0.2",
42
+ "@smithy/util-retry": "^4.0.2",
43
43
  "tslib": "^2.6.2",
44
44
  "uuid": "^9.0.1"
45
45
  },
@@ -64,10 +64,10 @@
64
64
  "files": [
65
65
  "dist-*/**"
66
66
  ],
67
- "homepage": "https://github.com/awslabs/smithy-typescript/tree/main/packages/middleware-retry",
67
+ "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-retry",
68
68
  "repository": {
69
69
  "type": "git",
70
- "url": "https://github.com/awslabs/smithy-typescript.git",
70
+ "url": "https://github.com/smithy-lang/smithy-typescript.git",
71
71
  "directory": "packages/middleware-retry"
72
72
  },
73
73
  "typedoc": {