@cdklabs/cdk-ecs-codedeploy 0.0.349 → 0.0.351

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 (80) hide show
  1. package/.jsii +3 -3
  2. package/.jsii.tabl.json +1 -1
  3. package/lib/api-canary/index.js +1 -1
  4. package/lib/ecs-appspec/index.js +1 -1
  5. package/lib/ecs-deployment/index.js +1 -1
  6. package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
  7. package/node_modules/@aws-sdk/client-codedeploy/package.json +4 -4
  8. package/node_modules/@aws-sdk/client-sso-oidc/package.json +3 -3
  9. package/node_modules/@aws-sdk/client-sts/package.json +3 -3
  10. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +3 -1
  11. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js +2 -0
  12. package/node_modules/@aws-sdk/credential-provider-ini/dist-types/fromIni.d.ts +2 -1
  13. package/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveSsoCredentials.d.ts +2 -2
  14. package/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveSsoCredentials.d.ts +2 -2
  15. package/node_modules/@aws-sdk/credential-provider-ini/package.json +3 -3
  16. package/node_modules/@aws-sdk/credential-provider-node/package.json +3 -3
  17. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +4 -0
  18. package/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js +2 -0
  19. package/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js +2 -1
  20. package/node_modules/@aws-sdk/credential-provider-sso/dist-types/resolveSSOCredentials.d.ts +1 -1
  21. package/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/resolveSSOCredentials.d.ts +1 -0
  22. package/node_modules/@aws-sdk/credential-provider-sso/package.json +2 -2
  23. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +11 -10
  24. package/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +1 -1
  25. package/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +2 -2
  26. package/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +5 -7
  27. package/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +4 -0
  28. package/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +2 -1
  29. package/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +3 -3
  30. package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +3 -1
  31. package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +3 -1
  32. package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +5 -1
  33. package/node_modules/@aws-sdk/token-providers/package.json +2 -2
  34. package/node_modules/@smithy/abort-controller/package.json +2 -2
  35. package/node_modules/@smithy/config-resolver/package.json +4 -4
  36. package/node_modules/@smithy/core/package.json +6 -6
  37. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  38. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  39. package/node_modules/@smithy/hash-node/package.json +2 -2
  40. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  41. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  42. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  43. package/node_modules/@smithy/middleware-retry/package.json +8 -8
  44. package/node_modules/@smithy/middleware-serde/package.json +2 -2
  45. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  46. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  47. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -8
  48. package/node_modules/@smithy/node-http-handler/dist-es/timing.js +2 -2
  49. package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +9 -6
  50. package/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +2 -2
  51. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +2 -2
  52. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  53. package/node_modules/@smithy/property-provider/package.json +2 -2
  54. package/node_modules/@smithy/protocol-http/package.json +2 -2
  55. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  56. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  57. package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +2 -2
  58. package/node_modules/@smithy/service-error-classification/dist-es/index.js +3 -2
  59. package/node_modules/@smithy/service-error-classification/dist-types/index.d.ts +1 -1
  60. package/node_modules/@smithy/service-error-classification/dist-types/ts3.4/index.d.ts +1 -1
  61. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  62. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  63. package/node_modules/@smithy/signature-v4/package.json +4 -4
  64. package/node_modules/@smithy/smithy-client/package.json +7 -7
  65. package/node_modules/@smithy/types/dist-types/shapes.d.ts +1 -0
  66. package/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +1 -0
  67. package/node_modules/@smithy/types/package.json +1 -1
  68. package/node_modules/@smithy/url-parser/package.json +3 -3
  69. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  70. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  71. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  72. package/node_modules/@smithy/util-middleware/package.json +2 -2
  73. package/node_modules/@smithy/util-retry/package.json +3 -3
  74. package/node_modules/@smithy/util-stream/package.json +4 -4
  75. package/node_modules/@smithy/util-waiter/dist-cjs/index.js +31 -4
  76. package/node_modules/@smithy/util-waiter/dist-es/poller.js +30 -4
  77. package/node_modules/@smithy/util-waiter/dist-types/ts3.4/waiter.d.ts +5 -0
  78. package/node_modules/@smithy/util-waiter/dist-types/waiter.d.ts +5 -0
  79. package/node_modules/@smithy/util-waiter/package.json +3 -3
  80. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/querystring-builder",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
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 querystring-builder",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@smithy/types": "^3.7.1",
25
+ "@smithy/types": "^3.7.2",
26
26
  "@smithy/util-uri-escape": "^3.0.0",
27
27
  "tslib": "^2.6.2"
28
28
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/querystring-parser",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
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 querystring-parser",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/types": "^3.7.1",
26
+ "@smithy/types": "^3.7.2",
27
27
  "tslib": "^2.6.2"
28
28
  },
29
29
  "engines": {
@@ -70,9 +70,9 @@ var isThrottlingError = /* @__PURE__ */ __name((error) => {
70
70
  var _a, _b;
71
71
  return ((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 || THROTTLING_ERROR_CODES.includes(error.name) || ((_b = error.$retryable) == null ? void 0 : _b.throttling) == true;
72
72
  }, "isThrottlingError");
73
- var isTransientError = /* @__PURE__ */ __name((error) => {
73
+ var isTransientError = /* @__PURE__ */ __name((error, depth = 0) => {
74
74
  var _a;
75
- return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0);
75
+ return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1);
76
76
  }, "isTransientError");
77
77
  var isServerError = /* @__PURE__ */ __name((error) => {
78
78
  var _a;
@@ -5,10 +5,11 @@ export const isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCo
5
5
  export const isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 ||
6
6
  THROTTLING_ERROR_CODES.includes(error.name) ||
7
7
  error.$retryable?.throttling == true;
8
- export const isTransientError = (error) => isClockSkewCorrectedError(error) ||
8
+ export const isTransientError = (error, depth = 0) => isClockSkewCorrectedError(error) ||
9
9
  TRANSIENT_ERROR_CODES.includes(error.name) ||
10
10
  NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") ||
11
- TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0);
11
+ TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) ||
12
+ (error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1));
12
13
  export const isServerError = (error) => {
13
14
  if (error.$metadata?.httpStatusCode !== undefined) {
14
15
  const statusCode = error.$metadata.httpStatusCode;
@@ -15,5 +15,5 @@ export declare const isThrottlingError: (error: SdkError) => boolean;
15
15
  * cause where the NodeHttpHandler does not decorate the Error with
16
16
  * the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition.
17
17
  */
18
- export declare const isTransientError: (error: SdkError) => boolean;
18
+ export declare const isTransientError: (error: SdkError, depth?: number) => boolean;
19
19
  export declare const isServerError: (error: SdkError) => boolean;
@@ -15,5 +15,5 @@ export declare const isThrottlingError: (error: SdkError) => boolean;
15
15
  * cause where the NodeHttpHandler does not decorate the Error with
16
16
  * the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition.
17
17
  */
18
- export declare const isTransientError: (error: SdkError) => boolean;
18
+ export declare const isTransientError: (error: SdkError, depth?: number) => boolean;
19
19
  export declare const isServerError: (error: SdkError) => boolean;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/service-error-classification",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
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 service-error-classification",
@@ -54,6 +54,6 @@
54
54
  "directory": ".release/package"
55
55
  },
56
56
  "dependencies": {
57
- "@smithy/types": "^3.7.1"
57
+ "@smithy/types": "^3.7.2"
58
58
  }
59
59
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@smithy/shared-ini-file-loader",
3
- "version": "3.1.11",
3
+ "version": "3.1.12",
4
4
  "dependencies": {
5
- "@smithy/types": "^3.7.1",
5
+ "@smithy/types": "^3.7.2",
6
6
  "tslib": "^2.6.2"
7
7
  },
8
8
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/signature-v4",
3
- "version": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "description": "A standalone implementation of the AWS Signature V4 request signing algorithm",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,10 +26,10 @@
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
28
  "@smithy/is-array-buffer": "^3.0.0",
29
- "@smithy/protocol-http": "^4.1.7",
30
- "@smithy/types": "^3.7.1",
29
+ "@smithy/protocol-http": "^4.1.8",
30
+ "@smithy/types": "^3.7.2",
31
31
  "@smithy/util-hex-encoding": "^3.0.0",
32
- "@smithy/util-middleware": "^3.0.10",
32
+ "@smithy/util-middleware": "^3.0.11",
33
33
  "@smithy/util-uri-escape": "^3.0.0",
34
34
  "@smithy/util-utf8": "^3.0.0",
35
35
  "tslib": "^2.6.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/smithy-client",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
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 smithy-client",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@smithy/core": "^2.5.4",
28
- "@smithy/middleware-endpoint": "^3.2.4",
29
- "@smithy/middleware-stack": "^3.0.10",
30
- "@smithy/protocol-http": "^4.1.7",
31
- "@smithy/types": "^3.7.1",
32
- "@smithy/util-stream": "^3.3.1",
27
+ "@smithy/core": "^2.5.5",
28
+ "@smithy/middleware-endpoint": "^3.2.5",
29
+ "@smithy/middleware-stack": "^3.0.11",
30
+ "@smithy/protocol-http": "^4.1.8",
31
+ "@smithy/types": "^3.7.2",
32
+ "@smithy/util-stream": "^3.3.2",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "engines": {
@@ -78,4 +78,5 @@ export type SdkError = Error & Partial<SmithyException> & Partial<MetadataBearer
78
78
  */
79
79
  readonly clockSkewCorrected?: true;
80
80
  };
81
+ cause?: Error;
81
82
  };
@@ -78,4 +78,5 @@ export type SdkError = Error & Partial<SmithyException> & Partial<MetadataBearer
78
78
  */
79
79
  readonly clockSkewCorrected?: true;
80
80
  };
81
+ cause?: Error;
81
82
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/types",
3
- "version": "3.7.1",
3
+ "version": "3.7.2",
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 types",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/url-parser",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
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 url-parser",
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/querystring-parser": "^3.0.10",
27
- "@smithy/types": "^3.7.1",
26
+ "@smithy/querystring-parser": "^3.0.11",
27
+ "@smithy/types": "^3.7.2",
28
28
  "tslib": "^2.6.2"
29
29
  },
30
30
  "typesVersions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-browser",
3
- "version": "3.0.28",
3
+ "version": "3.0.29",
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 util-defaults-mode-browser",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/property-provider": "^3.1.10",
27
- "@smithy/smithy-client": "^3.4.5",
28
- "@smithy/types": "^3.7.1",
26
+ "@smithy/property-provider": "^3.1.11",
27
+ "@smithy/smithy-client": "^3.4.6",
28
+ "@smithy/types": "^3.7.2",
29
29
  "bowser": "^2.11.0",
30
30
  "tslib": "^2.6.2"
31
31
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-node",
3
- "version": "3.0.28",
3
+ "version": "3.0.29",
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 util-defaults-mode-node",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/config-resolver": "^3.0.12",
27
- "@smithy/credential-provider-imds": "^3.2.7",
28
- "@smithy/node-config-provider": "^3.1.11",
29
- "@smithy/property-provider": "^3.1.10",
30
- "@smithy/smithy-client": "^3.4.5",
31
- "@smithy/types": "^3.7.1",
26
+ "@smithy/config-resolver": "^3.0.13",
27
+ "@smithy/credential-provider-imds": "^3.2.8",
28
+ "@smithy/node-config-provider": "^3.1.12",
29
+ "@smithy/property-provider": "^3.1.11",
30
+ "@smithy/smithy-client": "^3.4.6",
31
+ "@smithy/types": "^3.7.2",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-endpoints",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Utilities to help with endpoint resolution.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@smithy/node-config-provider": "^3.1.11",
32
- "@smithy/types": "^3.7.1",
31
+ "@smithy/node-config-provider": "^3.1.12",
32
+ "@smithy/types": "^3.7.2",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-middleware",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
4
4
  "description": "Shared utilities for to be used in middleware packages.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@smithy/types": "^3.7.1",
30
+ "@smithy/types": "^3.7.2",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-retry",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
4
4
  "description": "Shared retry utilities to be used in middleware packages.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@smithy/service-error-classification": "^3.0.10",
32
- "@smithy/types": "^3.7.1",
31
+ "@smithy/service-error-classification": "^3.0.11",
32
+ "@smithy/types": "^3.7.2",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-stream",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
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 util-stream",
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@smithy/fetch-http-handler": "^4.1.1",
32
- "@smithy/node-http-handler": "^3.3.1",
33
- "@smithy/types": "^3.7.1",
31
+ "@smithy/fetch-http-handler": "^4.1.2",
32
+ "@smithy/node-http-handler": "^3.3.2",
33
+ "@smithy/types": "^3.7.2",
34
34
  "@smithy/util-base64": "^3.0.0",
35
35
  "@smithy/util-buffer-from": "^3.0.0",
36
36
  "@smithy/util-hex-encoding": "^3.0.0",
@@ -80,29 +80,56 @@ var exponentialBackoffWithJitter = /* @__PURE__ */ __name((minDelay, maxDelay, a
80
80
  var randomInRange = /* @__PURE__ */ __name((min, max) => min + Math.random() * (max - min), "randomInRange");
81
81
  var runPolling = /* @__PURE__ */ __name(async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => {
82
82
  var _a;
83
+ const observedResponses = {};
83
84
  const { state, reason } = await acceptorChecks(client, input);
85
+ if (reason) {
86
+ const message = createMessageFromResponse(reason);
87
+ observedResponses[message] |= 0;
88
+ observedResponses[message] += 1;
89
+ }
84
90
  if (state !== "RETRY" /* RETRY */) {
85
- return { state, reason };
91
+ return { state, reason, observedResponses };
86
92
  }
87
93
  let currentAttempt = 1;
88
94
  const waitUntil = Date.now() + maxWaitTime * 1e3;
89
95
  const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1;
90
96
  while (true) {
91
97
  if (((_a = abortController == null ? void 0 : abortController.signal) == null ? void 0 : _a.aborted) || (abortSignal == null ? void 0 : abortSignal.aborted)) {
92
- return { state: "ABORTED" /* ABORTED */ };
98
+ const message = "AbortController signal aborted.";
99
+ observedResponses[message] |= 0;
100
+ observedResponses[message] += 1;
101
+ return { state: "ABORTED" /* ABORTED */, observedResponses };
93
102
  }
94
103
  const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt);
95
104
  if (Date.now() + delay * 1e3 > waitUntil) {
96
- return { state: "TIMEOUT" /* TIMEOUT */ };
105
+ return { state: "TIMEOUT" /* TIMEOUT */, observedResponses };
97
106
  }
98
107
  await sleep(delay);
99
108
  const { state: state2, reason: reason2 } = await acceptorChecks(client, input);
109
+ if (reason2) {
110
+ const message = createMessageFromResponse(reason2);
111
+ observedResponses[message] |= 0;
112
+ observedResponses[message] += 1;
113
+ }
100
114
  if (state2 !== "RETRY" /* RETRY */) {
101
- return { state: state2, reason: reason2 };
115
+ return { state: state2, reason: reason2, observedResponses };
102
116
  }
103
117
  currentAttempt += 1;
104
118
  }
105
119
  }, "runPolling");
120
+ var createMessageFromResponse = /* @__PURE__ */ __name((reason) => {
121
+ var _a;
122
+ if (reason == null ? void 0 : reason.$responseBodyText) {
123
+ return `Deserialization error for body: ${reason.$responseBodyText}`;
124
+ }
125
+ if ((_a = reason == null ? void 0 : reason.$metadata) == null ? void 0 : _a.httpStatusCode) {
126
+ if (reason.$response || reason.message) {
127
+ return `${reason.$response.statusCode ?? reason.$metadata.httpStatusCode ?? "Unknown"}: ${reason.message}`;
128
+ }
129
+ return `${reason.$metadata.httpStatusCode}: OK`;
130
+ }
131
+ return String((reason == null ? void 0 : reason.message) ?? JSON.stringify(reason) ?? "Unknown");
132
+ }, "createMessageFromResponse");
106
133
 
107
134
  // src/utils/validate.ts
108
135
  var validateWaiterOptions = /* @__PURE__ */ __name((options) => {
@@ -8,26 +8,52 @@ const exponentialBackoffWithJitter = (minDelay, maxDelay, attemptCeiling, attemp
8
8
  };
9
9
  const randomInRange = (min, max) => min + Math.random() * (max - min);
10
10
  export const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => {
11
+ const observedResponses = {};
11
12
  const { state, reason } = await acceptorChecks(client, input);
13
+ if (reason) {
14
+ const message = createMessageFromResponse(reason);
15
+ observedResponses[message] |= 0;
16
+ observedResponses[message] += 1;
17
+ }
12
18
  if (state !== WaiterState.RETRY) {
13
- return { state, reason };
19
+ return { state, reason, observedResponses };
14
20
  }
15
21
  let currentAttempt = 1;
16
22
  const waitUntil = Date.now() + maxWaitTime * 1000;
17
23
  const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1;
18
24
  while (true) {
19
25
  if (abortController?.signal?.aborted || abortSignal?.aborted) {
20
- return { state: WaiterState.ABORTED };
26
+ const message = "AbortController signal aborted.";
27
+ observedResponses[message] |= 0;
28
+ observedResponses[message] += 1;
29
+ return { state: WaiterState.ABORTED, observedResponses };
21
30
  }
22
31
  const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt);
23
32
  if (Date.now() + delay * 1000 > waitUntil) {
24
- return { state: WaiterState.TIMEOUT };
33
+ return { state: WaiterState.TIMEOUT, observedResponses };
25
34
  }
26
35
  await sleep(delay);
27
36
  const { state, reason } = await acceptorChecks(client, input);
37
+ if (reason) {
38
+ const message = createMessageFromResponse(reason);
39
+ observedResponses[message] |= 0;
40
+ observedResponses[message] += 1;
41
+ }
28
42
  if (state !== WaiterState.RETRY) {
29
- return { state, reason };
43
+ return { state, reason, observedResponses };
30
44
  }
31
45
  currentAttempt += 1;
32
46
  }
33
47
  };
48
+ const createMessageFromResponse = (reason) => {
49
+ if (reason?.$responseBodyText) {
50
+ return `Deserialization error for body: ${reason.$responseBodyText}`;
51
+ }
52
+ if (reason?.$metadata?.httpStatusCode) {
53
+ if (reason.$response || reason.message) {
54
+ return `${reason.$response.statusCode ?? reason.$metadata.httpStatusCode ?? "Unknown"}: ${reason.message}`;
55
+ }
56
+ return `${reason.$metadata.httpStatusCode}: OK`;
57
+ }
58
+ return String(reason?.message ?? JSON.stringify(reason) ?? "Unknown");
59
+ };
@@ -34,6 +34,11 @@ export type WaiterResult = {
34
34
  * (optional) Indicates a reason for why a waiter has reached its state.
35
35
  */
36
36
  reason?: any;
37
+ /**
38
+ * Responses observed by the waiter during its polling, where the value
39
+ * is the count.
40
+ */
41
+ observedResponses?: Record<string, number>;
37
42
  };
38
43
  /**
39
44
  * @internal
@@ -34,6 +34,11 @@ export type WaiterResult = {
34
34
  * (optional) Indicates a reason for why a waiter has reached its state.
35
35
  */
36
36
  reason?: any;
37
+ /**
38
+ * Responses observed by the waiter during its polling, where the value
39
+ * is the count.
40
+ */
41
+ observedResponses?: Record<string, number>;
37
42
  };
38
43
  /**
39
44
  * @internal
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@smithy/util-waiter",
3
- "version": "3.1.9",
3
+ "version": "3.2.0",
4
4
  "description": "Shared utilities for client waiters for the AWS SDK",
5
5
  "dependencies": {
6
- "@smithy/abort-controller": "^3.1.8",
7
- "@smithy/types": "^3.7.1",
6
+ "@smithy/abort-controller": "^3.1.9",
7
+ "@smithy/types": "^3.7.2",
8
8
  "tslib": "^2.6.2"
9
9
  },
10
10
  "scripts": {
package/package.json CHANGED
@@ -73,7 +73,7 @@
73
73
  "devDependencies": {
74
74
  "@aws-cdk/integ-runner": "latest",
75
75
  "@aws-cdk/integ-tests-alpha": "latest",
76
- "@types/aws-lambda": "^8.10.145",
76
+ "@types/aws-lambda": "^8.10.146",
77
77
  "@types/jest": "^27",
78
78
  "@types/lambda-tester": "^3.6.2",
79
79
  "@types/node": "^18",
@@ -83,13 +83,13 @@
83
83
  "aws-cdk-lib": "2.139.0",
84
84
  "aws-sdk-client-mock": "^4.1.0",
85
85
  "aws-sdk-client-mock-jest": "^4.1.0",
86
- "cdk-nag": "^2.34.2",
86
+ "cdk-nag": "^2.34.19",
87
87
  "cdklabs-projen-project-types": "^0.1.204",
88
88
  "commit-and-tag-version": "^12",
89
89
  "constructs": "10.0.5",
90
90
  "esbuild": "^0.24.0",
91
91
  "eslint": "^8",
92
- "eslint-import-resolver-typescript": "^3.6.3",
92
+ "eslint-import-resolver-typescript": "^3.7.0",
93
93
  "eslint-plugin-import": "^2.31.0",
94
94
  "jest": "^27",
95
95
  "jest-junit": "^15",
@@ -97,7 +97,7 @@
97
97
  "jsii-diff": "^1.105.0",
98
98
  "jsii-docgen": "^10.5.0",
99
99
  "jsii-pacmak": "^1.105.0",
100
- "jsii-rosetta": "^5.6.0",
100
+ "jsii-rosetta": "^5.6.2",
101
101
  "lambda-tester": "^4.0.1",
102
102
  "projen": "0.87.4",
103
103
  "ts-jest": "^27",
@@ -109,7 +109,7 @@
109
109
  "constructs": "^10.0.5"
110
110
  },
111
111
  "dependencies": {
112
- "@aws-sdk/client-codedeploy": "^3.696.0",
112
+ "@aws-sdk/client-codedeploy": "^3.699.0",
113
113
  "jmespath": "^0.16.0"
114
114
  },
115
115
  "bundledDependencies": [
@@ -127,7 +127,7 @@
127
127
  "publishConfig": {
128
128
  "access": "public"
129
129
  },
130
- "version": "0.0.349",
130
+ "version": "0.0.351",
131
131
  "jest": {
132
132
  "coverageProvider": "v8",
133
133
  "testMatch": [