@cdklabs/cdk-ecs-codedeploy 0.0.217 → 0.0.218

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 (74) hide show
  1. package/.jsii +2 -2
  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/@smithy/abort-controller/package.json +3 -3
  8. package/node_modules/@smithy/config-resolver/package.json +5 -5
  9. package/node_modules/@smithy/credential-provider-imds/package.json +6 -6
  10. package/node_modules/@smithy/eventstream-codec/package.json +3 -3
  11. package/node_modules/@smithy/fetch-http-handler/dist-cjs/fetch-http-handler.js +6 -0
  12. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +6 -0
  13. package/node_modules/@smithy/fetch-http-handler/dist-types/fetch-http-handler.d.ts +8 -22
  14. package/node_modules/@smithy/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts +8 -22
  15. package/node_modules/@smithy/fetch-http-handler/package.json +6 -6
  16. package/node_modules/@smithy/hash-node/package.json +3 -3
  17. package/node_modules/@smithy/invalid-dependency/package.json +3 -3
  18. package/node_modules/@smithy/middleware-content-length/package.json +5 -5
  19. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  20. package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.browser.js +5 -0
  21. package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +7 -0
  22. package/node_modules/@smithy/middleware-retry/dist-cjs/retryMiddleware.js +10 -2
  23. package/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.browser.js +1 -0
  24. package/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js +3 -0
  25. package/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js +9 -2
  26. package/node_modules/@smithy/middleware-retry/dist-types/isStreamingPayload/isStreamingPayload.browser.d.ts +5 -0
  27. package/node_modules/@smithy/middleware-retry/dist-types/isStreamingPayload/isStreamingPayload.d.ts +5 -0
  28. package/node_modules/@smithy/middleware-retry/dist-types/ts3.4/isStreamingPayload/isStreamingPayload.browser.d.ts +5 -0
  29. package/node_modules/@smithy/middleware-retry/dist-types/ts3.4/isStreamingPayload/isStreamingPayload.d.ts +5 -0
  30. package/node_modules/@smithy/middleware-retry/package.json +17 -9
  31. package/node_modules/@smithy/middleware-serde/package.json +4 -4
  32. package/node_modules/@smithy/middleware-stack/package.json +3 -3
  33. package/node_modules/@smithy/node-config-provider/package.json +5 -5
  34. package/node_modules/@smithy/node-http-handler/dist-cjs/node-http-handler.js +6 -0
  35. package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js +6 -0
  36. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +6 -0
  37. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +6 -0
  38. package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +7 -30
  39. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +5 -0
  40. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +7 -29
  41. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +5 -0
  42. package/node_modules/@smithy/node-http-handler/package.json +6 -6
  43. package/node_modules/@smithy/property-provider/package.json +3 -3
  44. package/node_modules/@smithy/protocol-http/package.json +3 -3
  45. package/node_modules/@smithy/querystring-builder/package.json +3 -3
  46. package/node_modules/@smithy/querystring-parser/package.json +3 -3
  47. package/node_modules/@smithy/service-error-classification/package.json +3 -3
  48. package/node_modules/@smithy/shared-ini-file-loader/package.json +3 -3
  49. package/node_modules/@smithy/signature-v4/README.md +7 -0
  50. package/node_modules/@smithy/signature-v4/package.json +6 -6
  51. package/node_modules/@smithy/smithy-client/dist-cjs/serde-json.js +1 -1
  52. package/node_modules/@smithy/smithy-client/dist-es/serde-json.js +1 -1
  53. package/node_modules/@smithy/smithy-client/package.json +5 -5
  54. package/node_modules/@smithy/types/dist-cjs/http/httpHandlerInitialization.js +2 -0
  55. package/node_modules/@smithy/types/dist-cjs/index.js +1 -0
  56. package/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
  57. package/node_modules/@smithy/types/dist-es/index.js +1 -0
  58. package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +65 -0
  59. package/node_modules/@smithy/types/dist-types/index.d.ts +1 -0
  60. package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +64 -0
  61. package/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +1 -0
  62. package/node_modules/@smithy/types/package.json +2 -2
  63. package/node_modules/@smithy/url-parser/package.json +4 -4
  64. package/node_modules/@smithy/util-body-length-browser/dist-cjs/calculateBodyLength.js +4 -0
  65. package/node_modules/@smithy/util-body-length-browser/dist-es/calculateBodyLength.js +4 -0
  66. package/node_modules/@smithy/util-body-length-browser/package.json +7 -9
  67. package/node_modules/@smithy/util-defaults-mode-browser/package.json +5 -5
  68. package/node_modules/@smithy/util-defaults-mode-node/package.json +8 -8
  69. package/node_modules/@smithy/util-endpoints/package.json +4 -4
  70. package/node_modules/@smithy/util-middleware/package.json +3 -3
  71. package/node_modules/@smithy/util-retry/package.json +4 -4
  72. package/node_modules/@smithy/util-stream/package.json +6 -6
  73. package/node_modules/@smithy/util-waiter/package.json +4 -4
  74. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-content-length",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "yarn g:tsc -p tsconfig.cjs.json",
@@ -8,7 +8,7 @@
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
10
10
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "test": "exit 0",
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/protocol-http": "^3.0.10",
27
- "@smithy/types": "^2.6.0",
26
+ "@smithy/protocol-http": "^3.0.11",
27
+ "@smithy/types": "^2.7.0",
28
28
  "tslib": "^2.5.0"
29
29
  },
30
30
  "engines": {
@@ -47,7 +47,7 @@
47
47
  "directory": "packages/middleware-content-length"
48
48
  },
49
49
  "devDependencies": {
50
- "@smithy/util-test": "^0.1.10",
50
+ "@smithy/util-test": "^0.1.11",
51
51
  "@tsconfig/recommended": "1.0.1",
52
52
  "concurrently": "7.0.0",
53
53
  "downlevel-dts": "0.10.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-endpoint",
3
- "version": "2.2.1",
3
+ "version": "2.2.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": "yarn g:tsc -p tsconfig.cjs.json",
@@ -8,7 +8,7 @@
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
10
10
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "test": "yarn g:jest --passWithNoTests",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/middleware-serde": "^2.0.14",
27
- "@smithy/node-config-provider": "^2.1.6",
28
- "@smithy/shared-ini-file-loader": "^2.2.5",
29
- "@smithy/types": "^2.6.0",
30
- "@smithy/url-parser": "^2.0.14",
31
- "@smithy/util-middleware": "^2.0.7",
26
+ "@smithy/middleware-serde": "^2.0.15",
27
+ "@smithy/node-config-provider": "^2.1.7",
28
+ "@smithy/shared-ini-file-loader": "^2.2.6",
29
+ "@smithy/types": "^2.7.0",
30
+ "@smithy/url-parser": "^2.0.15",
31
+ "@smithy/util-middleware": "^2.0.8",
32
32
  "tslib": "^2.5.0"
33
33
  },
34
34
  "devDependencies": {
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStreamingPayload = void 0;
4
+ const isStreamingPayload = (request) => (request === null || request === void 0 ? void 0 : request.body) instanceof ReadableStream;
5
+ exports.isStreamingPayload = isStreamingPayload;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStreamingPayload = void 0;
4
+ const stream_1 = require("stream");
5
+ const isStreamingPayload = (request) => (request === null || request === void 0 ? void 0 : request.body) instanceof stream_1.Readable ||
6
+ (typeof ReadableStream !== "undefined" && (request === null || request === void 0 ? void 0 : request.body) instanceof ReadableStream);
7
+ exports.isStreamingPayload = isStreamingPayload;
@@ -3,10 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRetryAfterHint = exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0;
4
4
  const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const service_error_classification_1 = require("@smithy/service-error-classification");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
6
7
  const util_retry_1 = require("@smithy/util-retry");
7
8
  const uuid_1 = require("uuid");
9
+ const isStreamingPayload_1 = require("./isStreamingPayload/isStreamingPayload");
8
10
  const util_1 = require("./util");
9
11
  const retryMiddleware = (options) => (next, context) => async (args) => {
12
+ var _a;
10
13
  let retryStrategy = await options.retryStrategy();
11
14
  const maxAttempts = await options.maxAttempts();
12
15
  if (isRetryStrategyV2(retryStrategy)) {
@@ -16,12 +19,13 @@ const retryMiddleware = (options) => (next, context) => async (args) => {
16
19
  let attempts = 0;
17
20
  let totalRetryDelay = 0;
18
21
  const { request } = args;
19
- if (protocol_http_1.HttpRequest.isInstance(request)) {
22
+ const isRequest = protocol_http_1.HttpRequest.isInstance(request);
23
+ if (isRequest) {
20
24
  request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)();
21
25
  }
22
26
  while (true) {
23
27
  try {
24
- if (protocol_http_1.HttpRequest.isInstance(request)) {
28
+ if (isRequest) {
25
29
  request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
26
30
  }
27
31
  const { response, output } = await next(args);
@@ -33,6 +37,10 @@ const retryMiddleware = (options) => (next, context) => async (args) => {
33
37
  catch (e) {
34
38
  const retryErrorInfo = getRetryErrorInfo(e);
35
39
  lastError = (0, util_1.asSdkError)(e);
40
+ if (isRequest && (0, isStreamingPayload_1.isStreamingPayload)(request)) {
41
+ (_a = (context.logger instanceof smithy_client_1.NoOpLogger ? console : context.logger)) === null || _a === void 0 ? void 0 : _a.warn("An error was encountered in a non-retryable streaming request.");
42
+ throw lastError;
43
+ }
36
44
  try {
37
45
  retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
38
46
  }
@@ -0,0 +1 @@
1
+ export const isStreamingPayload = (request) => request?.body instanceof ReadableStream;
@@ -0,0 +1,3 @@
1
+ import { Readable } from "stream";
2
+ export const isStreamingPayload = (request) => request?.body instanceof Readable ||
3
+ (typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream);
@@ -1,7 +1,9 @@
1
1
  import { HttpRequest, HttpResponse } from "@smithy/protocol-http";
2
2
  import { isServerError, isThrottlingError, isTransientError } from "@smithy/service-error-classification";
3
+ import { NoOpLogger } from "@smithy/smithy-client";
3
4
  import { INVOCATION_ID_HEADER, REQUEST_HEADER } from "@smithy/util-retry";
4
5
  import { v4 } from "uuid";
6
+ import { isStreamingPayload } from "./isStreamingPayload/isStreamingPayload";
5
7
  import { asSdkError } from "./util";
6
8
  export const retryMiddleware = (options) => (next, context) => async (args) => {
7
9
  let retryStrategy = await options.retryStrategy();
@@ -13,12 +15,13 @@ export const retryMiddleware = (options) => (next, context) => async (args) => {
13
15
  let attempts = 0;
14
16
  let totalRetryDelay = 0;
15
17
  const { request } = args;
16
- if (HttpRequest.isInstance(request)) {
18
+ const isRequest = HttpRequest.isInstance(request);
19
+ if (isRequest) {
17
20
  request.headers[INVOCATION_ID_HEADER] = v4();
18
21
  }
19
22
  while (true) {
20
23
  try {
21
- if (HttpRequest.isInstance(request)) {
24
+ if (isRequest) {
22
25
  request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
23
26
  }
24
27
  const { response, output } = await next(args);
@@ -30,6 +33,10 @@ export const retryMiddleware = (options) => (next, context) => async (args) => {
30
33
  catch (e) {
31
34
  const retryErrorInfo = getRetryErrorInfo(e);
32
35
  lastError = asSdkError(e);
36
+ if (isRequest && isStreamingPayload(request)) {
37
+ (context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
38
+ throw lastError;
39
+ }
33
40
  try {
34
41
  retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
35
42
  }
@@ -0,0 +1,5 @@
1
+ import type { HttpRequest } from "@smithy/protocol-http";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const isStreamingPayload: (request: HttpRequest) => boolean;
@@ -0,0 +1,5 @@
1
+ import type { HttpRequest } from "@smithy/protocol-http";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const isStreamingPayload: (request: HttpRequest) => boolean;
@@ -0,0 +1,5 @@
1
+ import { HttpRequest } from "@smithy/protocol-http";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const isStreamingPayload: (request: HttpRequest) => boolean;
@@ -0,0 +1,5 @@
1
+ import { HttpRequest } from "@smithy/protocol-http";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const isStreamingPayload: (request: HttpRequest) => boolean;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-retry",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "yarn g:tsc -p tsconfig.cjs.json",
@@ -8,7 +8,7 @@
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
10
10
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "extract:docs": "api-extractor run --local",
@@ -18,23 +18,31 @@
18
18
  "main": "./dist-cjs/index.js",
19
19
  "module": "./dist-es/index.js",
20
20
  "types": "./dist-types/index.d.ts",
21
+ "browser": {
22
+ "./dist-es/isStreamingPayload/isStreamingPayload": "./dist-es/isStreamingPayload/isStreamingPayload.browser"
23
+ },
24
+ "react-native": {
25
+ "./dist-cjs/isStreamingPayload/isStreamingPayload": "./dist-cjs/isStreamingPayload/isStreamingPayload.browser",
26
+ "./dist-es/isStreamingPayload/isStreamingPayload": "./dist-es/isStreamingPayload/isStreamingPayload.browser"
27
+ },
21
28
  "author": {
22
29
  "name": "AWS SDK for JavaScript Team",
23
30
  "url": "https://aws.amazon.com/javascript/"
24
31
  },
25
32
  "license": "Apache-2.0",
26
33
  "dependencies": {
27
- "@smithy/node-config-provider": "^2.1.6",
28
- "@smithy/protocol-http": "^3.0.10",
29
- "@smithy/service-error-classification": "^2.0.7",
30
- "@smithy/types": "^2.6.0",
31
- "@smithy/util-middleware": "^2.0.7",
32
- "@smithy/util-retry": "^2.0.7",
34
+ "@smithy/node-config-provider": "^2.1.7",
35
+ "@smithy/protocol-http": "^3.0.11",
36
+ "@smithy/service-error-classification": "^2.0.8",
37
+ "@smithy/smithy-client": "^2.1.18",
38
+ "@smithy/types": "^2.7.0",
39
+ "@smithy/util-middleware": "^2.0.8",
40
+ "@smithy/util-retry": "^2.0.8",
33
41
  "tslib": "^2.5.0",
34
42
  "uuid": "^8.3.2"
35
43
  },
36
44
  "devDependencies": {
37
- "@smithy/util-test": "^0.1.10",
45
+ "@smithy/util-test": "^0.1.11",
38
46
  "@tsconfig/recommended": "1.0.1",
39
47
  "@types/uuid": "^8.3.0",
40
48
  "concurrently": "7.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-serde",
3
- "version": "2.0.14",
3
+ "version": "2.0.15",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "yarn g:tsc -p tsconfig.cjs.json",
@@ -8,7 +8,7 @@
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
10
10
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "test": "yarn g:jest",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/types": "^2.6.0",
26
+ "@smithy/types": "^2.7.0",
27
27
  "tslib": "^2.5.0"
28
28
  },
29
29
  "engines": {
@@ -46,7 +46,7 @@
46
46
  "directory": "packages/middleware-serde"
47
47
  },
48
48
  "devDependencies": {
49
- "@smithy/util-test": "^0.1.10",
49
+ "@smithy/util-test": "^0.1.11",
50
50
  "@tsconfig/recommended": "1.0.1",
51
51
  "concurrently": "7.0.0",
52
52
  "downlevel-dts": "0.10.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-stack",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Provides a means for composing multiple middleware functions into a single handler",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
@@ -9,7 +9,7 @@
9
9
  "build:types": "yarn g:tsc -p tsconfig.types.json",
10
10
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11
11
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
12
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
12
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
13
13
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
14
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
15
15
  "extract:docs": "api-extractor run --local",
@@ -25,7 +25,7 @@
25
25
  "module": "./dist-es/index.js",
26
26
  "types": "./dist-types/index.d.ts",
27
27
  "dependencies": {
28
- "@smithy/types": "^2.6.0",
28
+ "@smithy/types": "^2.7.0",
29
29
  "tslib": "^2.5.0"
30
30
  },
31
31
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-config-provider",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Load config default values from ini config files and environmental variable",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
@@ -9,7 +9,7 @@
9
9
  "build:types": "yarn g:tsc -p tsconfig.types.json",
10
10
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11
11
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
12
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
12
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
13
13
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
14
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
15
15
  "test": "yarn g:jest --passWithNoTests"
@@ -24,9 +24,9 @@
24
24
  "module": "./dist-es/index.js",
25
25
  "types": "./dist-types/index.d.ts",
26
26
  "dependencies": {
27
- "@smithy/property-provider": "^2.0.15",
28
- "@smithy/shared-ini-file-loader": "^2.2.5",
29
- "@smithy/types": "^2.6.0",
27
+ "@smithy/property-provider": "^2.0.16",
28
+ "@smithy/shared-ini-file-loader": "^2.2.6",
29
+ "@smithy/types": "^2.7.0",
30
30
  "tslib": "^2.5.0"
31
31
  },
32
32
  "devDependencies": {
@@ -13,6 +13,12 @@ const set_socket_timeout_1 = require("./set-socket-timeout");
13
13
  const write_request_body_1 = require("./write-request-body");
14
14
  exports.DEFAULT_REQUEST_TIMEOUT = 0;
15
15
  class NodeHttpHandler {
16
+ static create(instanceOrOptions) {
17
+ if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") {
18
+ return instanceOrOptions;
19
+ }
20
+ return new NodeHttpHandler(instanceOrOptions);
21
+ }
16
22
  constructor(options) {
17
23
  this.metadata = { handlerProtocol: "http/1.1" };
18
24
  this.configProvider = new Promise((resolve, reject) => {
@@ -8,6 +8,12 @@ const get_transformed_headers_1 = require("./get-transformed-headers");
8
8
  const node_http2_connection_manager_1 = require("./node-http2-connection-manager");
9
9
  const write_request_body_1 = require("./write-request-body");
10
10
  class NodeHttp2Handler {
11
+ static create(instanceOrOptions) {
12
+ if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") {
13
+ return instanceOrOptions;
14
+ }
15
+ return new NodeHttp2Handler(instanceOrOptions);
16
+ }
11
17
  constructor(options) {
12
18
  this.metadata = { handlerProtocol: "h2" };
13
19
  this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({});
@@ -10,6 +10,12 @@ import { setSocketTimeout } from "./set-socket-timeout";
10
10
  import { writeRequestBody } from "./write-request-body";
11
11
  export const DEFAULT_REQUEST_TIMEOUT = 0;
12
12
  export class NodeHttpHandler {
13
+ static create(instanceOrOptions) {
14
+ if (typeof instanceOrOptions?.handle === "function") {
15
+ return instanceOrOptions;
16
+ }
17
+ return new NodeHttpHandler(instanceOrOptions);
18
+ }
13
19
  constructor(options) {
14
20
  this.metadata = { handlerProtocol: "http/1.1" };
15
21
  this.configProvider = new Promise((resolve, reject) => {
@@ -5,6 +5,12 @@ import { getTransformedHeaders } from "./get-transformed-headers";
5
5
  import { NodeHttp2ConnectionManager } from "./node-http2-connection-manager";
6
6
  import { writeRequestBody } from "./write-request-body";
7
7
  export class NodeHttp2Handler {
8
+ static create(instanceOrOptions) {
9
+ if (typeof instanceOrOptions?.handle === "function") {
10
+ return instanceOrOptions;
11
+ }
12
+ return new NodeHttp2Handler(instanceOrOptions);
13
+ }
8
14
  constructor(options) {
9
15
  this.metadata = { handlerProtocol: "h2" };
10
16
  this.connectionManager = new NodeHttp2ConnectionManager({});
@@ -1,35 +1,7 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
2
+ import type { NodeHttpHandlerOptions } from "@smithy/types";
4
3
  import { HttpHandlerOptions, Provider } from "@smithy/types";
5
- import { Agent as hAgent } from "http";
6
- import { Agent as hsAgent } from "https";
7
- /**
8
- * Represents the http options that can be passed to a node http client.
9
- */
10
- export interface NodeHttpHandlerOptions {
11
- /**
12
- * The maximum time in milliseconds that the connection phase of a request
13
- * may take before the connection attempt is abandoned.
14
- *
15
- * Defaults to 0, which disables the timeout.
16
- */
17
- connectionTimeout?: number;
18
- /**
19
- * The number of milliseconds a request can take before automatically being terminated.
20
- * Defaults to 0, which disables the timeout.
21
- */
22
- requestTimeout?: number;
23
- /**
24
- * @deprecated Use {@link requestTimeout}
25
- *
26
- * The maximum time in milliseconds that a socket may remain idle before it
27
- * is closed.
28
- */
29
- socketTimeout?: number;
30
- httpAgent?: hAgent;
31
- httpsAgent?: hsAgent;
32
- }
4
+ export { NodeHttpHandlerOptions };
33
5
  export declare const DEFAULT_REQUEST_TIMEOUT = 0;
34
6
  export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
35
7
  private config?;
@@ -37,6 +9,11 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
37
9
  readonly metadata: {
38
10
  handlerProtocol: string;
39
11
  };
12
+ /**
13
+ * @returns the input if it is an HttpHandler of any class,
14
+ * or instantiates a new instance of this handler.
15
+ */
16
+ static create(instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>): NodeHttpHandler | HttpHandler<any>;
40
17
  constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
41
18
  private resolveDefaultConfig;
42
19
  destroy(): void;
@@ -37,6 +37,11 @@ export declare class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOpt
37
37
  handlerProtocol: string;
38
38
  };
39
39
  private readonly connectionManager;
40
+ /**
41
+ * @returns the input if it is an HttpHandler of any class,
42
+ * or instantiates a new instance of this handler.
43
+ */
44
+ static create(instanceOrOptions?: HttpHandler<any> | NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>): HttpHandler<any> | NodeHttp2Handler;
40
45
  constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>);
41
46
  destroy(): void;
42
47
  handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
@@ -1,34 +1,7 @@
1
- /// <reference types="node" />
2
1
  import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
2
+ import { NodeHttpHandlerOptions } from "@smithy/types";
3
3
  import { HttpHandlerOptions, Provider } from "@smithy/types";
4
- import { Agent as hAgent } from "http";
5
- import { Agent as hsAgent } from "https";
6
- /**
7
- * Represents the http options that can be passed to a node http client.
8
- */
9
- export interface NodeHttpHandlerOptions {
10
- /**
11
- * The maximum time in milliseconds that the connection phase of a request
12
- * may take before the connection attempt is abandoned.
13
- *
14
- * Defaults to 0, which disables the timeout.
15
- */
16
- connectionTimeout?: number;
17
- /**
18
- * The number of milliseconds a request can take before automatically being terminated.
19
- * Defaults to 0, which disables the timeout.
20
- */
21
- requestTimeout?: number;
22
- /**
23
- * @deprecated Use {@link requestTimeout}
24
- *
25
- * The maximum time in milliseconds that a socket may remain idle before it
26
- * is closed.
27
- */
28
- socketTimeout?: number;
29
- httpAgent?: hAgent;
30
- httpsAgent?: hsAgent;
31
- }
4
+ export { NodeHttpHandlerOptions };
32
5
  export declare const DEFAULT_REQUEST_TIMEOUT = 0;
33
6
  export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
34
7
  private config?;
@@ -36,6 +9,11 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
36
9
  readonly metadata: {
37
10
  handlerProtocol: string;
38
11
  };
12
+ /**
13
+ * @returns the input if it is an HttpHandler of any class,
14
+ * or instantiates a new instance of this handler.
15
+ */
16
+ static create(instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>): NodeHttpHandler | HttpHandler<any>;
39
17
  constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
40
18
  private resolveDefaultConfig;
41
19
  destroy(): void;
@@ -37,6 +37,11 @@ export declare class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOpt
37
37
  handlerProtocol: string;
38
38
  };
39
39
  private readonly connectionManager;
40
+ /**
41
+ * @returns the input if it is an HttpHandler of any class,
42
+ * or instantiates a new instance of this handler.
43
+ */
44
+ static create(instanceOrOptions?: HttpHandler<any> | NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>): HttpHandler<any> | NodeHttp2Handler;
40
45
  constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>);
41
46
  destroy(): void;
42
47
  handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "2.1.10",
3
+ "version": "2.2.1",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
@@ -9,7 +9,7 @@
9
9
  "build:types": "yarn g:tsc -p tsconfig.types.json",
10
10
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11
11
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
12
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
12
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
13
13
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
14
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
15
15
  "extract:docs": "api-extractor run --local",
@@ -25,10 +25,10 @@
25
25
  "module": "./dist-es/index.js",
26
26
  "types": "./dist-types/index.d.ts",
27
27
  "dependencies": {
28
- "@smithy/abort-controller": "^2.0.14",
29
- "@smithy/protocol-http": "^3.0.10",
30
- "@smithy/querystring-builder": "^2.0.14",
31
- "@smithy/types": "^2.6.0",
28
+ "@smithy/abort-controller": "^2.0.15",
29
+ "@smithy/protocol-http": "^3.0.11",
30
+ "@smithy/querystring-builder": "^2.0.15",
31
+ "@smithy/types": "^2.7.0",
32
32
  "tslib": "^2.5.0"
33
33
  },
34
34
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/property-provider",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "yarn g:tsc -p tsconfig.cjs.json",
@@ -8,7 +8,7 @@
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
10
10
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "test": "yarn g:jest"
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@smithy/types": "^2.6.0",
25
+ "@smithy/types": "^2.7.0",
26
26
  "tslib": "^2.5.0"
27
27
  },
28
28
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/protocol-http",
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": "yarn g:tsc -p tsconfig.cjs.json",
@@ -8,7 +8,7 @@
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
10
10
  "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "test": "yarn g:jest"
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/types": "^2.6.0",
26
+ "@smithy/types": "^2.7.0",
27
27
  "tslib": "^2.5.0"
28
28
  },
29
29
  "engines": {