cdk-preflight 1.12.5 → 1.12.7

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.
Files changed (77) hide show
  1. package/.jsii +3 -3
  2. package/lib/index.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +3 -2
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeConfig.js +2 -1
  5. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.d.ts +1 -0
  6. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
  7. package/node_modules/@aws-sdk/client-cloudformation/package.json +8 -8
  8. package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +7 -2
  9. package/node_modules/@aws-sdk/client-ec2/dist-es/models/enums.js +4 -0
  10. package/node_modules/@aws-sdk/client-ec2/dist-es/runtimeConfig.js +2 -1
  11. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CreateFlowLogsCommand.d.ts +1 -1
  12. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerSupportabilityScoresCommand.d.ts +2 -2
  13. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetFlowLogsIntegrationTemplateCommand.d.ts +2 -1
  14. package/node_modules/@aws-sdk/client-ec2/dist-types/models/enums.d.ts +4 -0
  15. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_1.d.ts +7 -5
  16. package/node_modules/@aws-sdk/client-ec2/dist-types/runtimeConfig.d.ts +1 -0
  17. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/enums.d.ts +4 -0
  18. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
  19. package/node_modules/@aws-sdk/client-ec2/package.json +9 -9
  20. package/node_modules/@aws-sdk/client-lambda/dist-cjs/index.js +1 -1
  21. package/node_modules/@aws-sdk/client-lambda/package.json +8 -8
  22. package/node_modules/@aws-sdk/client-service-quotas/dist-cjs/index.js +3 -2
  23. package/node_modules/@aws-sdk/client-service-quotas/dist-es/runtimeConfig.js +2 -1
  24. package/node_modules/@aws-sdk/client-service-quotas/dist-types/runtimeConfig.d.ts +1 -0
  25. package/node_modules/@aws-sdk/client-service-quotas/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
  26. package/node_modules/@aws-sdk/client-service-quotas/package.json +8 -8
  27. package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +3 -2
  28. package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js +2 -1
  29. package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts +1 -0
  30. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
  31. package/node_modules/@aws-sdk/client-sts/package.json +9 -9
  32. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +7 -2
  33. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +3 -0
  34. package/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js +0 -2
  35. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +6 -0
  36. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +3 -0
  37. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +20 -0
  38. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +1 -0
  39. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +20 -0
  40. package/node_modules/@aws-sdk/core/package.json +7 -8
  41. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  42. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  43. package/node_modules/@aws-sdk/credential-provider-ini/package.json +12 -12
  44. package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +5 -1
  45. package/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js +5 -1
  46. package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/types.d.ts +1 -0
  47. package/node_modules/@aws-sdk/credential-provider-login/dist-types/types.d.ts +4 -1
  48. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  49. package/node_modules/@aws-sdk/credential-provider-node/package.json +10 -10
  50. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  51. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  52. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  53. package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +5 -5
  54. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  55. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  56. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  57. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  58. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  59. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  60. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
  61. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  62. package/node_modules/@aws-sdk/types/package.json +2 -2
  63. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  64. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +8 -8
  65. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +8 -8
  66. package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js +2 -2
  67. package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js +6 -6
  68. package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +16 -6
  69. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +16 -6
  70. package/node_modules/@smithy/core/package.json +1 -1
  71. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +10 -4
  72. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +6 -2
  73. package/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js +4 -2
  74. package/node_modules/@smithy/fetch-http-handler/dist-types/request-timeout.d.ts +12 -1
  75. package/node_modules/@smithy/fetch-http-handler/dist-types/ts3.4/request-timeout.d.ts +12 -1
  76. package/node_modules/@smithy/fetch-http-handler/package.json +3 -3
  77. package/package.json +1 -1
@@ -258,7 +258,7 @@ const commonParams = {
258
258
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
259
259
  };
260
260
 
261
- var version = "3.998.0";
261
+ var version = "3.998.2";
262
262
  var packageInfo = {
263
263
  version: version};
264
264
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/nested-clients",
3
- "version": "3.998.1",
3
+ "version": "3.998.3",
4
4
  "description": "Nested clients for AWS SDK packages.",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
6
6
  "license": "Apache-2.0",
@@ -100,13 +100,13 @@
100
100
  "test:watch": "yarn g:vitest watch"
101
101
  },
102
102
  "dependencies": {
103
- "@aws-sdk/core": "^3.980.1",
104
- "@aws-sdk/signature-v4-multi-region": "^3.996.51",
105
- "@aws-sdk/types": "^3.975.0",
106
- "@smithy/core": "^3.38.0",
107
- "@smithy/fetch-http-handler": "^5.8.0",
108
- "@smithy/node-http-handler": "^4.14.0",
109
- "@smithy/types": "^4.19.0",
103
+ "@aws-sdk/core": "^3.981.0",
104
+ "@aws-sdk/signature-v4-multi-region": "^3.996.52",
105
+ "@aws-sdk/types": "^3.975.1",
106
+ "@smithy/core": "^3.40.0",
107
+ "@smithy/fetch-http-handler": "^5.8.1",
108
+ "@smithy/node-http-handler": "^4.14.2",
109
+ "@smithy/types": "^4.20.0",
110
110
  "tslib": "^2.6.2"
111
111
  },
112
112
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/signature-v4-multi-region",
3
- "version": "3.996.51",
3
+ "version": "3.996.52",
4
4
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/signature-v4-multi-region",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -42,9 +42,9 @@
42
42
  "test:browser": "yarn build:browser && yarn g:vitest run -c vitest.config.browser.mts"
43
43
  },
44
44
  "dependencies": {
45
- "@aws-sdk/types": "^3.975.0",
45
+ "@aws-sdk/types": "^3.975.1",
46
46
  "@smithy/signature-v4": "^5.7.5",
47
- "@smithy/types": "^4.19.0",
47
+ "@smithy/types": "^4.20.0",
48
48
  "tslib": "^2.6.2"
49
49
  },
50
50
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/token-providers",
3
- "version": "3.1164.0",
3
+ "version": "3.1166.0",
4
4
  "description": "A collection of token providers",
5
5
  "keywords": [
6
6
  "aws",
@@ -48,11 +48,11 @@
48
48
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
49
49
  },
50
50
  "dependencies": {
51
- "@aws-sdk/core": "^3.980.1",
52
- "@aws-sdk/nested-clients": "^3.998.1",
53
- "@aws-sdk/types": "^3.975.0",
54
- "@smithy/core": "^3.38.0",
55
- "@smithy/types": "^4.19.0",
51
+ "@aws-sdk/core": "^3.981.0",
52
+ "@aws-sdk/nested-clients": "^3.998.3",
53
+ "@aws-sdk/types": "^3.975.1",
54
+ "@smithy/core": "^3.40.0",
55
+ "@smithy/types": "^4.20.0",
56
56
  "tslib": "^2.6.2"
57
57
  },
58
58
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/types",
3
- "version": "3.975.0",
3
+ "version": "3.975.1",
4
4
  "description": "Types for the AWS SDK",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/types",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  "test": "tsc -p tsconfig.test.json"
42
42
  },
43
43
  "dependencies": {
44
- "@smithy/types": "^4.19.0",
44
+ "@smithy/types": "^4.20.0",
45
45
  "tslib": "^2.6.2"
46
46
  },
47
47
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/xml-builder",
3
- "version": "3.972.42",
3
+ "version": "3.972.43",
4
4
  "description": "XML utilities for the AWS SDK",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/xml-builder",
6
6
  "license": "Apache-2.0",
@@ -47,7 +47,7 @@
47
47
  "test:fuzz": "jazzer tests/xml-parser.fuzz.js corpus --sync -i xml-parser -- -max_total_time=300"
48
48
  },
49
49
  "dependencies": {
50
- "@smithy/types": "^4.19.0",
50
+ "@smithy/types": "^4.20.0",
51
51
  "tslib": "^2.6.2"
52
52
  },
53
53
  "devDependencies": {
@@ -399,21 +399,21 @@ class DefaultRateLimiter {
399
399
  }
400
400
 
401
401
  class Retry {
402
- static v2026 = typeof process !== "undefined" && process.env?.SMITHY_NEW_RETRIES_2026 === "true";
402
+ static v2026 = true;
403
403
  static delay() {
404
- return Retry.v2026 ? 50 : 100;
404
+ return 50;
405
405
  }
406
406
  static throttlingDelay() {
407
- return Retry.v2026 ? 1_000 : 500;
407
+ return 1_000;
408
408
  }
409
409
  static cost() {
410
- return Retry.v2026 ? 14 : 5;
410
+ return 14;
411
411
  }
412
412
  static throttlingCost() {
413
- return Retry.v2026 ? 5 : 10;
413
+ return 5;
414
414
  }
415
415
  static modifiedCostType() {
416
- return Retry.v2026 ? "THROTTLING" : "TRANSIENT";
416
+ return "THROTTLING";
417
417
  }
418
418
  }
419
419
 
@@ -494,7 +494,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
494
494
  this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
495
495
  }
496
496
  async acquireInitialRetryToken(retryTokenScope) {
497
- return new DefaultRetryToken(Retry.delay(), 0, undefined, Retry.v2026 && retryTokenScope.includes(":longpoll"));
497
+ return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
498
498
  }
499
499
  async refreshRetryTokenForRetry(token, errorInfo) {
500
500
  const maxAttempts = await this.getMaxAttempts();
@@ -510,7 +510,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
510
510
  retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
511
511
  }
512
512
  if (!shouldRetry) {
513
- const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
513
+ const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
514
514
  if (longPollBackoff > 0) {
515
515
  await new Promise((r) => setTimeout(r, longPollBackoff));
516
516
  }
@@ -401,21 +401,21 @@ class DefaultRateLimiter {
401
401
  }
402
402
 
403
403
  class Retry {
404
- static v2026 = typeof process !== "undefined" && process.env?.SMITHY_NEW_RETRIES_2026 === "true";
404
+ static v2026 = true;
405
405
  static delay() {
406
- return Retry.v2026 ? 50 : 100;
406
+ return 50;
407
407
  }
408
408
  static throttlingDelay() {
409
- return Retry.v2026 ? 1_000 : 500;
409
+ return 1_000;
410
410
  }
411
411
  static cost() {
412
- return Retry.v2026 ? 14 : 5;
412
+ return 14;
413
413
  }
414
414
  static throttlingCost() {
415
- return Retry.v2026 ? 5 : 10;
415
+ return 5;
416
416
  }
417
417
  static modifiedCostType() {
418
- return Retry.v2026 ? "THROTTLING" : "TRANSIENT";
418
+ return "THROTTLING";
419
419
  }
420
420
  }
421
421
 
@@ -496,7 +496,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
496
496
  this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
497
497
  }
498
498
  async acquireInitialRetryToken(retryTokenScope) {
499
- return new DefaultRetryToken(Retry.delay(), 0, undefined, Retry.v2026 && retryTokenScope.includes(":longpoll"));
499
+ return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
500
500
  }
501
501
  async refreshRetryTokenForRetry(token, errorInfo) {
502
502
  const maxAttempts = await this.getMaxAttempts();
@@ -512,7 +512,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
512
512
  retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
513
513
  }
514
514
  if (!shouldRetry) {
515
- const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
515
+ const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
516
516
  if (longPollBackoff > 0) {
517
517
  await new Promise((r) => setTimeout(r, longPollBackoff));
518
518
  }
@@ -31,7 +31,7 @@ export class StandardRetryStrategy {
31
31
  this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
32
32
  }
33
33
  async acquireInitialRetryToken(retryTokenScope) {
34
- return new DefaultRetryToken(Retry.delay(), 0, undefined, Retry.v2026 && retryTokenScope.includes(":longpoll"));
34
+ return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
35
35
  }
36
36
  async refreshRetryTokenForRetry(token, errorInfo) {
37
37
  const maxAttempts = await this.getMaxAttempts();
@@ -47,7 +47,7 @@ export class StandardRetryStrategy {
47
47
  retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
48
48
  }
49
49
  if (!shouldRetry) {
50
- const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
50
+ const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
51
51
  if (longPollBackoff > 0) {
52
52
  await new Promise((r) => setTimeout(r, longPollBackoff));
53
53
  }
@@ -1,18 +1,18 @@
1
1
  export class Retry {
2
- static v2026 = typeof process !== "undefined" && process.env?.SMITHY_NEW_RETRIES_2026 === "true";
2
+ static v2026 = true;
3
3
  static delay() {
4
- return Retry.v2026 ? 50 : 100;
4
+ return 50;
5
5
  }
6
6
  static throttlingDelay() {
7
- return Retry.v2026 ? 1_000 : 500;
7
+ return 1_000;
8
8
  }
9
9
  static cost() {
10
- return Retry.v2026 ? 14 : 5;
10
+ return 14;
11
11
  }
12
12
  static throttlingCost() {
13
- return Retry.v2026 ? 5 : 10;
13
+ return 5;
14
14
  }
15
15
  static modifiedCostType() {
16
- return Retry.v2026 ? "THROTTLING" : "TRANSIENT";
16
+ return "THROTTLING";
17
17
  }
18
18
  }
@@ -1,11 +1,21 @@
1
1
  /**
2
+ * Retry parameters used by the standard retry strategy.
3
+ *
4
+ * The public constants in `./constants` keep their earlier values, which the
5
+ * deprecated pre-SRA retry strategy still uses.
6
+ *
2
7
  * @internal
3
8
  */
4
9
  export declare abstract class Retry {
5
- static v2026: boolean;
6
- static delay(): 50 | 100;
7
- static throttlingDelay(): 500 | 1000;
8
- static cost(): 5 | 14;
9
- static throttlingCost(): 5 | 10;
10
- static modifiedCostType(): "THROTTLING" | "TRANSIENT";
10
+ /**
11
+ * Always true. Kept because previously published packages read this flag.
12
+ *
13
+ * @deprecated the 2026 retry behavior is always enabled. May be removed in a future major version.
14
+ */
15
+ static readonly v2026 = true;
16
+ static delay(): number;
17
+ static throttlingDelay(): number;
18
+ static cost(): number;
19
+ static throttlingCost(): number;
20
+ static modifiedCostType(): "THROTTLING";
11
21
  }
@@ -1,11 +1,21 @@
1
1
  /**
2
+ * Retry parameters used by the standard retry strategy.
3
+ *
4
+ * The public constants in `./constants` keep their earlier values, which the
5
+ * deprecated pre-SRA retry strategy still uses.
6
+ *
2
7
  * @internal
3
8
  */
4
9
  export declare abstract class Retry {
5
- static v2026: boolean;
6
- static delay(): 50 | 100;
7
- static throttlingDelay(): 500 | 1000;
8
- static cost(): 5 | 14;
9
- static throttlingCost(): 5 | 10;
10
- static modifiedCostType(): "THROTTLING" | "TRANSIENT";
10
+ /**
11
+ * Always true. Kept because previously published packages read this flag.
12
+ *
13
+ * @deprecated the 2026 retry behavior is always enabled. May be removed in a future major version.
14
+ */
15
+ static readonly v2026 = true;
16
+ static delay(): number;
17
+ static throttlingDelay(): number;
18
+ static cost(): number;
19
+ static throttlingCost(): number;
20
+ static modifiedCostType(): "THROTTLING";
11
21
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.39.0",
3
+ "version": "3.40.0",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -7,15 +7,17 @@ function createRequest(url, requestOptions) {
7
7
  }
8
8
 
9
9
  function requestTimeout(timeoutInMs = 0) {
10
- return new Promise((resolve, reject) => {
10
+ let timeoutId;
11
+ const promise = new Promise((resolve, reject) => {
11
12
  if (timeoutInMs) {
12
- setTimeout(() => {
13
+ timeoutId = setTimeout(() => {
13
14
  const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
14
15
  timeoutError.name = "TimeoutError";
15
16
  reject(timeoutError);
16
17
  }, timeoutInMs);
17
18
  }
18
19
  });
20
+ return { promise, cancel: () => clearTimeout(timeoutId) };
19
21
  }
20
22
 
21
23
  const keepAliveSupport = {
@@ -95,6 +97,7 @@ class FetchHttpHandler {
95
97
  Object.assign(requestOptions, this.config.requestInit(request));
96
98
  }
97
99
  let removeSignalEventListener = () => { };
100
+ const timeout = requestTimeout(requestTimeoutInMs);
98
101
  const fetchRequest = createRequest(url, requestOptions);
99
102
  const raceOfPromises = [
100
103
  fetchFn(fetchRequest).then((response) => {
@@ -123,7 +126,7 @@ class FetchHttpHandler {
123
126
  }),
124
127
  };
125
128
  }),
126
- requestTimeout(requestTimeoutInMs),
129
+ timeout.promise,
127
130
  ];
128
131
  if (abortSignal) {
129
132
  raceOfPromises.push(new Promise((resolve, reject) => {
@@ -141,7 +144,10 @@ class FetchHttpHandler {
141
144
  }
142
145
  }));
143
146
  }
144
- return Promise.race(raceOfPromises).finally(removeSignalEventListener);
147
+ return Promise.race(raceOfPromises).finally(() => {
148
+ timeout.cancel();
149
+ removeSignalEventListener();
150
+ });
145
151
  }
146
152
  updateHttpClientConfig(key, value) {
147
153
  this.config = undefined;
@@ -78,6 +78,7 @@ export class FetchHttpHandler {
78
78
  Object.assign(requestOptions, this.config.requestInit(request));
79
79
  }
80
80
  let removeSignalEventListener = () => { };
81
+ const timeout = requestTimeoutFn(requestTimeoutInMs);
81
82
  const fetchRequest = createRequest(url, requestOptions);
82
83
  const raceOfPromises = [
83
84
  fetchFn(fetchRequest).then((response) => {
@@ -106,7 +107,7 @@ export class FetchHttpHandler {
106
107
  }),
107
108
  };
108
109
  }),
109
- requestTimeoutFn(requestTimeoutInMs),
110
+ timeout.promise,
110
111
  ];
111
112
  if (abortSignal) {
112
113
  raceOfPromises.push(new Promise((resolve, reject) => {
@@ -124,7 +125,10 @@ export class FetchHttpHandler {
124
125
  }
125
126
  }));
126
127
  }
127
- return Promise.race(raceOfPromises).finally(removeSignalEventListener);
128
+ return Promise.race(raceOfPromises).finally(() => {
129
+ timeout.cancel();
130
+ removeSignalEventListener();
131
+ });
128
132
  }
129
133
  updateHttpClientConfig(key, value) {
130
134
  this.config = undefined;
@@ -1,11 +1,13 @@
1
1
  export function requestTimeout(timeoutInMs = 0) {
2
- return new Promise((resolve, reject) => {
2
+ let timeoutId;
3
+ const promise = new Promise((resolve, reject) => {
3
4
  if (timeoutInMs) {
4
- setTimeout(() => {
5
+ timeoutId = setTimeout(() => {
5
6
  const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
6
7
  timeoutError.name = "TimeoutError";
7
8
  reject(timeoutError);
8
9
  }, timeoutInMs);
9
10
  }
10
11
  });
12
+ return { promise, cancel: () => clearTimeout(timeoutId) };
11
13
  }
@@ -1 +1,12 @@
1
- export declare function requestTimeout(timeoutInMs?: number): Promise<never>;
1
+ /**
2
+ * Rejects with a TimeoutError after `timeoutInMs` (never, for 0).
3
+ *
4
+ * Call `cancel` once the request settles: a pending timer keeps the request
5
+ * race, and the response it settled with, reachable until the timer fires.
6
+ *
7
+ * @internal
8
+ */
9
+ export declare function requestTimeout(timeoutInMs?: number): {
10
+ promise: Promise<never>;
11
+ cancel: () => void;
12
+ };
@@ -1 +1,12 @@
1
- export declare function requestTimeout(timeoutInMs?: number): Promise<never>;
1
+ /**
2
+ * Rejects with a TimeoutError after `timeoutInMs` (never, for 0).
3
+ *
4
+ * Call `cancel` once the request settles: a pending timer keeps the request
5
+ * race, and the response it settled with, reachable until the timer fires.
6
+ *
7
+ * @internal
8
+ */
9
+ export declare function requestTimeout(timeoutInMs?: number): {
10
+ promise: Promise<never>;
11
+ cancel: () => void;
12
+ };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.8.0",
3
+ "version": "5.8.1",
4
4
  "description": "Provides a way to make requests",
5
5
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/fetch-http-handler",
6
6
  "license": "Apache-2.0",
@@ -40,8 +40,8 @@
40
40
  "test:browser:watch": "yarn g:vitest watch -c vitest.config.browser.mts"
41
41
  },
42
42
  "dependencies": {
43
- "@smithy/core": "^3.33.3",
44
- "@smithy/types": "^4.18.0",
43
+ "@smithy/core": "^3.39.0",
44
+ "@smithy/types": "^4.20.0",
45
45
  "tslib": "^2.6.2"
46
46
  },
47
47
  "devDependencies": {
package/package.json CHANGED
@@ -103,7 +103,7 @@
103
103
  "publishConfig": {
104
104
  "access": "public"
105
105
  },
106
- "version": "1.12.5",
106
+ "version": "1.12.7",
107
107
  "jest": {
108
108
  "coverageProvider": "v8",
109
109
  "collectCoverage": false,