@cdklabs/cdk-ecs-codedeploy 0.0.461 → 0.0.462

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 (144) hide show
  1. package/.jsii +3 -3
  2. package/lib/api-canary/index.js +1 -1
  3. package/lib/ecs-appspec/index.js +1 -1
  4. package/lib/ecs-deployment/index.js +1 -1
  5. package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
  6. package/node_modules/@aws-sdk/client-codedeploy/dist-cjs/index.js +49 -11
  7. package/node_modules/@aws-sdk/client-codedeploy/dist-es/models/enums.js +6 -0
  8. package/node_modules/@aws-sdk/client-codedeploy/dist-es/models/errors.js +13 -0
  9. package/node_modules/@aws-sdk/client-codedeploy/dist-es/schemas/schemas_0.js +27 -11
  10. package/node_modules/@aws-sdk/client-codedeploy/dist-types/CodeDeployClient.d.ts +2 -1
  11. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/BatchGetDeploymentGroupsCommand.d.ts +5 -0
  12. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/BatchGetDeploymentsCommand.d.ts +5 -0
  13. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/CreateDeploymentCommand.d.ts +11 -0
  14. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/CreateDeploymentGroupCommand.d.ts +11 -0
  15. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/GetDeploymentCommand.d.ts +5 -0
  16. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/GetDeploymentGroupCommand.d.ts +5 -0
  17. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/UpdateDeploymentGroupCommand.d.ts +11 -0
  18. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/enums.d.ts +14 -0
  19. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/errors.d.ts +16 -0
  20. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/models_0.d.ts +64 -1
  21. package/node_modules/@aws-sdk/client-codedeploy/dist-types/schemas/schemas_0.d.ts +2 -0
  22. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/enums.d.ts +8 -0
  23. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/errors.d.ts +8 -0
  24. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/models_0.d.ts +9 -0
  25. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/schemas/schemas_0.d.ts +2 -0
  26. package/node_modules/@aws-sdk/client-codedeploy/package.json +5 -5
  27. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +94 -1589
  28. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -7
  29. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
  30. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
  31. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -8
  32. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  33. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  34. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  35. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  36. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -10
  37. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  38. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  39. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  40. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  41. package/node_modules/@aws-sdk/core/package.json +3 -3
  42. package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
  43. package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
  44. package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  45. package/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
  46. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  47. package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
  48. package/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
  49. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
  50. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  51. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  52. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  53. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  54. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  55. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +2 -1
  56. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +2 -1
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +2 -1
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +2 -1
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +2 -1
  60. package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
  61. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  62. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
  63. package/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
  64. package/node_modules/@aws-sdk/token-providers/package.json +5 -5
  65. package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +3 -0
  66. package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +3 -0
  67. package/node_modules/@aws-sdk/types/package.json +1 -1
  68. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +13 -37
  69. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +15 -2
  70. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +10 -0
  71. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +10 -0
  72. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +49 -34
  73. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +12 -37
  74. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +16 -2
  75. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +10 -0
  76. package/node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js +35 -0
  77. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +4 -1
  78. package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +1 -0
  79. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +8 -31
  80. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +5 -5
  81. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  82. package/node_modules/@smithy/core/dist-types/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  83. package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +12 -0
  84. package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +1 -0
  85. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
  86. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  87. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  88. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +12 -0
  89. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  90. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
  91. package/node_modules/@smithy/core/package.json +1 -1
  92. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +48 -6
  93. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +9 -1
  94. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +20 -2
  95. package/node_modules/@smithy/node-http-handler/dist-es/resolve-default-socket-timeout.js +4 -0
  96. package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +16 -3
  97. package/node_modules/@smithy/node-http-handler/dist-types/resolve-default-socket-timeout.d.ts +4 -0
  98. package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +6 -1
  99. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/resolve-default-socket-timeout.d.ts +4 -0
  100. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +6 -1
  101. package/node_modules/@smithy/node-http-handler/package.json +3 -3
  102. package/package.json +2 -2
  103. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -1
  104. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -20
  105. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -1
  106. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +0 -160
  107. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +0 -193
  108. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -103
  109. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -20
  110. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +0 -200
  111. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +0 -519
  112. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -18
  113. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -46
  114. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -121
  115. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js +0 -41
  116. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +0 -89
  117. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +0 -7
  118. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -15
  119. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
  120. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -14
  121. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -29
  122. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -51
  123. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -13
  124. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -30
  125. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -60
  126. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -1
  127. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -21
  128. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -15
  129. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -11
  130. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +0 -22
  131. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +0 -4
  132. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -11
  133. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
  134. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
  135. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
  136. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
  137. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -9
  138. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
  139. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
  140. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +0 -1
  141. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
  142. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
  143. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
  144. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
@@ -3,6 +3,7 @@ import { buildAbortError } from "./build-abort-error";
3
3
  import { getTransformedHeaders } from "./get-transformed-headers";
4
4
  import { node_http2 } from "./node-http2";
5
5
  import { NodeHttp2ConnectionManager } from "./node-http2-connection-manager";
6
+ import { resolveDefaultSocketTimeout } from "./resolve-default-socket-timeout";
6
7
  import { writeRequestBody } from "./write-request-body";
7
8
  const { constants } = node_http2;
8
9
  export class NodeHttp2Handler {
@@ -35,7 +36,8 @@ export class NodeHttp2Handler {
35
36
  }
36
37
  async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) {
37
38
  if (!this.config) {
38
- this.config = await this.configProvider;
39
+ const config = await this.configProvider;
40
+ this.config = { ...config, defaultSocketTimeout: resolveDefaultSocketTimeout(config) };
39
41
  const { disableConcurrentStreams, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config;
40
42
  this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);
41
43
  if (maxConcurrentStreams) {
@@ -45,9 +47,12 @@ export class NodeHttp2Handler {
45
47
  this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions);
46
48
  }
47
49
  }
48
- const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
50
+ const { requestTimeout: configRequestTimeout, disableConcurrentStreams, sessionTimeout } = this.config;
49
51
  const useIsolatedSession = disableConcurrentStreams || isEventStream;
50
52
  const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
53
+ const defaultSocketTimeout = effectiveRequestTimeout === undefined && sessionTimeout === undefined
54
+ ? this.config.defaultSocketTimeout
55
+ : undefined;
51
56
  return new Promise((_resolve, _reject) => {
52
57
  let fulfilled = false;
53
58
  let writeRequestBodyPromise = undefined;
@@ -110,6 +115,19 @@ export class NodeHttp2Handler {
110
115
  rejectWithDestroy(timeoutError);
111
116
  });
112
117
  }
118
+ else if (defaultSocketTimeout) {
119
+ clientHttp2Stream.setTimeout(defaultSocketTimeout, () => {
120
+ const timeoutError = new Error(`Stream timed out because of no activity for ${defaultSocketTimeout} ms`);
121
+ timeoutError.name = "TimeoutError";
122
+ fulfilled = true;
123
+ reject(timeoutError);
124
+ clientHttp2Stream.destroy(timeoutError);
125
+ if (useIsolatedSession) {
126
+ ref.destroy();
127
+ }
128
+ });
129
+ clientHttp2Stream.once("response", () => clientHttp2Stream.setTimeout(defaultSocketTimeout));
130
+ }
113
131
  if (abortSignal) {
114
132
  const onAbort = () => {
115
133
  clientHttp2Stream.close();
@@ -0,0 +1,4 @@
1
+ export const resolveDefaultSocketTimeout = (config) => {
2
+ const value = config?.defaultSocketTimeout;
3
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;
4
+ };
@@ -1,11 +1,19 @@
1
1
  import { timing } from "./timing";
2
2
  const DEFER_EVENT_LISTENER_TIME = 3000;
3
- export const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
3
+ export const setSocketTimeout = (request, reject, timeoutInMs = 0, destroyResponseBodyOnTimeout = false) => {
4
+ let response;
5
+ if (destroyResponseBodyOnTimeout) {
6
+ request.once("response", (res) => (response = res));
7
+ }
4
8
  const registerTimeout = (offset) => {
5
9
  const timeout = timeoutInMs - offset;
6
10
  const onTimeout = () => {
11
+ const error = Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (${destroyResponseBodyOnTimeout ? "service default socket timeout" : "configured by client requestHandler"}).`), { name: "TimeoutError" });
12
+ if (destroyResponseBodyOnTimeout) {
13
+ response?.destroy(error);
14
+ }
7
15
  request.destroy();
8
- reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" }));
16
+ reject(error);
9
17
  };
10
18
  if (request.socket) {
11
19
  request.socket.setTimeout(timeout, onTimeout);
@@ -19,5 +27,10 @@ export const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
19
27
  registerTimeout(0);
20
28
  return 0;
21
29
  }
22
- return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
30
+ const deferralId = timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
31
+ if (destroyResponseBodyOnTimeout) {
32
+ request.once("close", () => timing.clearTimeout(deferralId));
33
+ return 0;
34
+ }
35
+ return deferralId;
23
36
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveDefaultSocketTimeout: (config: unknown) => number | undefined;
@@ -1,2 +1,7 @@
1
1
  import type { ClientRequest } from "node:http";
2
- export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => NodeJS.Timeout | number;
2
+ /**
3
+ * @internal
4
+ * @param destroyResponseBodyOnTimeout - set by the service default. On timeout the response
5
+ * body is destroyed with the TimeoutError, and the timeout stays armed through the body.
6
+ */
7
+ export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, destroyResponseBodyOnTimeout?: boolean) => NodeJS.Timeout | number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveDefaultSocketTimeout: (config: unknown) => number | undefined;
@@ -1,2 +1,7 @@
1
1
  import { ClientRequest } from "node:http";
2
- export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => NodeJS.Timeout | number;
2
+ /**
3
+ * @internal
4
+ * @param destroyResponseBodyOnTimeout - set by the service default. On timeout the response
5
+ * body is destroyed with the TimeoutError, and the timeout stays armed through the body.
6
+ */
7
+ export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, destroyResponseBodyOnTimeout?: boolean) => NodeJS.Timeout | number;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.12.1",
3
+ "version": "4.13.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/node-http-handler",
6
6
  "license": "Apache-2.0",
@@ -39,8 +39,8 @@
39
39
  "test:watch": "yarn g:vitest watch"
40
40
  },
41
41
  "dependencies": {
42
- "@smithy/core": "^3.33.3",
43
- "@smithy/types": "^4.18.0",
42
+ "@smithy/core": "^3.37.0",
43
+ "@smithy/types": "^4.19.0",
44
44
  "tslib": "^2.6.2"
45
45
  },
46
46
  "devDependencies": {
package/package.json CHANGED
@@ -110,7 +110,7 @@
110
110
  "constructs": "^10.0.5"
111
111
  },
112
112
  "dependencies": {
113
- "@aws-sdk/client-codedeploy": "^3.1152.0",
113
+ "@aws-sdk/client-codedeploy": "^3.1156.0",
114
114
  "jmespath": "^0.16.0"
115
115
  },
116
116
  "bundledDependencies": [
@@ -128,7 +128,7 @@
128
128
  "publishConfig": {
129
129
  "access": "public"
130
130
  },
131
- "version": "0.0.461",
131
+ "version": "0.0.462",
132
132
  "jest": {
133
133
  "coverageProvider": "v8",
134
134
  "testMatch": [
@@ -1,20 +0,0 @@
1
- import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
2
- import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
3
- import { JsonShapeSerializer } from "./JsonShapeSerializer";
4
- export class JsonCodec extends SerdeContextConfig {
5
- settings;
6
- constructor(settings) {
7
- super();
8
- this.settings = settings;
9
- }
10
- createSerializer() {
11
- const serializer = new JsonShapeSerializer(this.settings);
12
- serializer.setSerdeContext(this.serdeContext);
13
- return serializer;
14
- }
15
- createDeserializer() {
16
- const deserializer = new JsonShapeDeserializer(this.settings);
17
- deserializer.setSerdeContext(this.serdeContext);
18
- return deserializer;
19
- }
20
- }
@@ -1,160 +0,0 @@
1
- import { determineTimestampFormat } from "@smithy/core/protocols";
2
- import { NormalizedSchema } from "@smithy/core/schema";
3
- import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
4
- import { fromBase64 } from "@smithy/core/serde";
5
- import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
6
- import { UnionSerde } from "../../UnionSerde";
7
- import { jsonReviver } from "../jsonReviver";
8
- import { needsReviver } from "../needsReviver";
9
- import { parseJsonBody } from "../parseJsonBody";
10
- import { writeKey } from "../../writeKey";
11
- export class JsonShapeDeserializer extends SerdeContextConfig {
12
- settings;
13
- constructor(settings) {
14
- super();
15
- this.settings = settings;
16
- }
17
- async read(schema, data) {
18
- const reviver = needsReviver(schema) ? jsonReviver : undefined;
19
- return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
20
- }
21
- readObject(schema, data) {
22
- return this._read(schema, data);
23
- }
24
- _read(schema, value) {
25
- const isObject = value !== null && typeof value === "object";
26
- const ns = NormalizedSchema.of(schema);
27
- if (isObject) {
28
- if (ns.isStructSchema()) {
29
- const record = value;
30
- const union = ns.isUnionSchema();
31
- const out = {};
32
- let nameMap = void 0;
33
- const { jsonName } = this.settings;
34
- if (jsonName) {
35
- nameMap = {};
36
- }
37
- let unionSerde;
38
- if (union) {
39
- unionSerde = new UnionSerde(record, out);
40
- }
41
- for (const [memberName, memberSchema] of ns.structIterator()) {
42
- let fromKey = memberName;
43
- if (jsonName) {
44
- fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
45
- nameMap[fromKey] = memberName;
46
- }
47
- if (union) {
48
- unionSerde.mark(fromKey);
49
- }
50
- if (record[fromKey] != null) {
51
- out[memberName] = this._read(memberSchema, record[fromKey]);
52
- }
53
- }
54
- if (union) {
55
- unionSerde.writeUnknown();
56
- }
57
- else if (typeof record.__type === "string") {
58
- for (const k in record) {
59
- const v = record[k];
60
- const t = jsonName ? (nameMap[k] ?? k) : k;
61
- if (!(t in out)) {
62
- out[t] = v;
63
- }
64
- }
65
- }
66
- return out;
67
- }
68
- if (Array.isArray(value) && ns.isListSchema()) {
69
- const listMember = ns.getValueSchema();
70
- const out = [];
71
- for (const item of value) {
72
- out.push(this._read(listMember, item));
73
- }
74
- return out;
75
- }
76
- if (ns.isMapSchema()) {
77
- const mapMember = ns.getValueSchema();
78
- const out = {};
79
- for (const _k in value) {
80
- if (_k === "__proto__") {
81
- writeKey(out);
82
- }
83
- out[_k] = this._read(mapMember, value[_k]);
84
- }
85
- return out;
86
- }
87
- }
88
- if (ns.isBlobSchema() && typeof value === "string") {
89
- return fromBase64(value);
90
- }
91
- const mediaType = ns.getMergedTraits().mediaType;
92
- if (ns.isStringSchema() && typeof value === "string" && mediaType) {
93
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
94
- if (isJson) {
95
- return LazyJsonString.from(value);
96
- }
97
- return value;
98
- }
99
- if (ns.isTimestampSchema() && value != null) {
100
- const format = determineTimestampFormat(ns, this.settings);
101
- switch (format) {
102
- case 5:
103
- return parseRfc3339DateTimeWithOffset(value);
104
- case 6:
105
- return parseRfc7231DateTime(value);
106
- case 7:
107
- return parseEpochTimestamp(value);
108
- default:
109
- console.warn("Missing timestamp format, parsing value with Date constructor:", value);
110
- return new Date(value);
111
- }
112
- }
113
- if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
114
- return BigInt(value);
115
- }
116
- if (ns.isBigDecimalSchema() && value != undefined) {
117
- if (value instanceof NumericValue) {
118
- return value;
119
- }
120
- const untyped = value;
121
- if (untyped.type === "bigDecimal" && "string" in untyped) {
122
- return new NumericValue(untyped.string, untyped.type);
123
- }
124
- return new NumericValue(String(value), "bigDecimal");
125
- }
126
- if (ns.isNumericSchema() && typeof value === "string") {
127
- switch (value) {
128
- case "Infinity":
129
- return Infinity;
130
- case "-Infinity":
131
- return -Infinity;
132
- case "NaN":
133
- return NaN;
134
- }
135
- return value;
136
- }
137
- if (ns.isDocumentSchema()) {
138
- if (isObject) {
139
- const out = Array.isArray(value) ? [] : {};
140
- for (const k in value) {
141
- if (k === "__proto__") {
142
- writeKey(out);
143
- }
144
- const v = value[k];
145
- if (v instanceof NumericValue) {
146
- out[k] = v;
147
- }
148
- else {
149
- out[k] = this._read(ns, v);
150
- }
151
- }
152
- return out;
153
- }
154
- else {
155
- return structuredClone(value);
156
- }
157
- }
158
- return value;
159
- }
160
- }
@@ -1,193 +0,0 @@
1
- import { determineTimestampFormat } from "@smithy/core/protocols";
2
- import { NormalizedSchema } from "@smithy/core/schema";
3
- import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue, toBase64 } from "@smithy/core/serde";
4
- import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
5
- import { JsonReplacer } from "../jsonReplacer";
6
- import { writeKey } from "../../writeKey";
7
- export class JsonShapeSerializer extends SerdeContextConfig {
8
- settings;
9
- buffer;
10
- useReplacer = false;
11
- rootSchema;
12
- constructor(settings) {
13
- super();
14
- this.settings = settings;
15
- }
16
- write(schema, value) {
17
- this.rootSchema = NormalizedSchema.of(schema);
18
- this.buffer = this._write(this.rootSchema, value);
19
- }
20
- flush() {
21
- const { rootSchema, useReplacer } = this;
22
- this.rootSchema = undefined;
23
- this.useReplacer = false;
24
- if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
25
- if (!useReplacer) {
26
- return JSON.stringify(this.buffer);
27
- }
28
- const replacer = new JsonReplacer();
29
- return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
30
- }
31
- return this.buffer;
32
- }
33
- writeDiscriminatedDocument(schema, value) {
34
- this.write(schema, value);
35
- if (typeof this.buffer === "object") {
36
- this.buffer.__type = NormalizedSchema.of(schema).getName(true);
37
- }
38
- }
39
- _write(schema, value, container) {
40
- const isObject = value !== null && typeof value === "object";
41
- const ns = NormalizedSchema.of(schema);
42
- if (isObject) {
43
- if (ns.isStructSchema()) {
44
- const record = value;
45
- const out = {};
46
- const { jsonName } = this.settings;
47
- let nameMap = void 0;
48
- if (jsonName) {
49
- nameMap = {};
50
- }
51
- let outCount = 0;
52
- for (const [memberName, memberSchema] of ns.structIterator()) {
53
- const serializableValue = this._write(memberSchema, record[memberName], ns);
54
- if (serializableValue !== undefined) {
55
- let targetKey = memberName;
56
- if (jsonName) {
57
- targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
58
- nameMap[memberName] = targetKey;
59
- }
60
- out[targetKey] = serializableValue;
61
- outCount++;
62
- }
63
- }
64
- if (ns.isUnionSchema() && outCount === 0) {
65
- const { $unknown } = record;
66
- if (Array.isArray($unknown)) {
67
- const [k, v] = $unknown;
68
- if (k === "__proto__") {
69
- writeKey(out);
70
- }
71
- out[k] = this._write(15, v);
72
- }
73
- }
74
- else if (typeof record.__type === "string") {
75
- for (const k in record) {
76
- const v = record[k];
77
- const targetKey = jsonName ? (nameMap[k] ?? k) : k;
78
- if (!(targetKey in out)) {
79
- out[targetKey] = this._write(15, v);
80
- }
81
- }
82
- }
83
- return out;
84
- }
85
- if (Array.isArray(value) && ns.isListSchema()) {
86
- const listMember = ns.getValueSchema();
87
- const out = [];
88
- const sparse = !!ns.getMergedTraits().sparse;
89
- for (const item of value) {
90
- if (sparse || item != null) {
91
- out.push(this._write(listMember, item));
92
- }
93
- }
94
- return out;
95
- }
96
- if (ns.isMapSchema()) {
97
- const mapMember = ns.getValueSchema();
98
- const out = {};
99
- const sparse = !!ns.getMergedTraits().sparse;
100
- for (const _k in value) {
101
- const _v = value[_k];
102
- if (sparse || _v != null) {
103
- if (_k === "__proto__") {
104
- writeKey(out);
105
- }
106
- out[_k] = this._write(mapMember, _v);
107
- }
108
- }
109
- return out;
110
- }
111
- if (value instanceof Uint8Array && ns.isBlobSchema()) {
112
- if (ns === this.rootSchema) {
113
- return value;
114
- }
115
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
116
- }
117
- if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
118
- const format = determineTimestampFormat(ns, this.settings);
119
- switch (format) {
120
- case 5:
121
- return value.toISOString().replace(".000Z", "Z");
122
- case 6:
123
- return dateToUtcString(value);
124
- case 7:
125
- return value.getTime() / 1000;
126
- default:
127
- console.warn("Missing timestamp format, using epoch seconds", value);
128
- return value.getTime() / 1000;
129
- }
130
- }
131
- if (value instanceof NumericValue) {
132
- this.useReplacer = true;
133
- }
134
- }
135
- if (value === null && container?.isStructSchema()) {
136
- return void 0;
137
- }
138
- if (ns.isStringSchema()) {
139
- if (typeof value === "undefined" && ns.isIdempotencyToken()) {
140
- return generateIdempotencyToken();
141
- }
142
- const mediaType = ns.getMergedTraits().mediaType;
143
- if (value != null && mediaType) {
144
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
145
- if (isJson) {
146
- return LazyJsonString.from(value);
147
- }
148
- }
149
- return value;
150
- }
151
- if (typeof value === "number") {
152
- if (Math.abs(value) === Infinity || isNaN(value)) {
153
- return String(value);
154
- }
155
- return value;
156
- }
157
- if (typeof value === "string" && ns.isBlobSchema()) {
158
- if (ns === this.rootSchema) {
159
- return value;
160
- }
161
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
162
- }
163
- if (typeof value === "bigint") {
164
- this.useReplacer = true;
165
- }
166
- if (ns.isDocumentSchema()) {
167
- if (isObject) {
168
- if (value instanceof Uint8Array) {
169
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
170
- }
171
- const out = Array.isArray(value) ? [] : {};
172
- for (const k in value) {
173
- const v = value[k];
174
- if (k === "__proto__") {
175
- writeKey(out);
176
- }
177
- if (v instanceof NumericValue) {
178
- this.useReplacer = true;
179
- out[k] = v;
180
- }
181
- else {
182
- out[k] = this._write(ns, v);
183
- }
184
- }
185
- return out;
186
- }
187
- else {
188
- return structuredClone(value);
189
- }
190
- }
191
- return value;
192
- }
193
- }
@@ -1,103 +0,0 @@
1
- import { toUtf8 } from "@smithy/core/serde";
2
- export class JsonBytesStringAdapter extends Uint8Array {
3
- string = null;
4
- static allocUnsafe(bytes) {
5
- if (typeof Buffer === "function") {
6
- const buffer = Buffer.allocUnsafe(bytes);
7
- return new JsonBytesStringAdapter(buffer.buffer, buffer.byteOffset, buffer.byteLength);
8
- }
9
- return new JsonBytesStringAdapter(bytes);
10
- }
11
- toString() {
12
- return this.s();
13
- }
14
- valueOf() {
15
- return this.s();
16
- }
17
- includes(searchString, position) {
18
- if (typeof searchString === "string") {
19
- return this.s().includes(searchString, position);
20
- }
21
- return Uint8Array.prototype.includes.call(this, searchString, position);
22
- }
23
- indexOf(searchString, position) {
24
- if (typeof searchString === "string") {
25
- return this.s().indexOf(searchString, position);
26
- }
27
- return Uint8Array.prototype.indexOf.call(this, searchString, position);
28
- }
29
- lastIndexOf(searchString, position) {
30
- if (typeof searchString === "string") {
31
- return this.s().lastIndexOf(searchString, position);
32
- }
33
- const fn = Uint8Array.prototype.lastIndexOf;
34
- if (position !== undefined) {
35
- return fn.call(this, searchString, position);
36
- }
37
- return fn.call(this, searchString);
38
- }
39
- startsWith(searchString, position) {
40
- return this.s().startsWith(searchString, position);
41
- }
42
- endsWith(searchString, endPosition) {
43
- return this.s().endsWith(searchString, endPosition);
44
- }
45
- match(regexp) {
46
- return this.s().match(regexp);
47
- }
48
- replace(searchValue, replaceValue) {
49
- return this.s().replace(searchValue, replaceValue);
50
- }
51
- search(regexp) {
52
- return this.s().search(regexp);
53
- }
54
- split(separator, limit) {
55
- return this.s().split(separator, limit);
56
- }
57
- substring(start, end) {
58
- return this.s().substring(start, end);
59
- }
60
- trim() {
61
- return this.s().trim();
62
- }
63
- trimStart() {
64
- return this.s().trimStart();
65
- }
66
- trimEnd() {
67
- return this.s().trimEnd();
68
- }
69
- charAt(pos) {
70
- return this.s().charAt(pos);
71
- }
72
- charCodeAt(index) {
73
- return this.s().charCodeAt(index);
74
- }
75
- padStart(maxLength, fillString) {
76
- return this.s().padStart(maxLength, fillString);
77
- }
78
- padEnd(maxLength, fillString) {
79
- return this.s().padEnd(maxLength, fillString);
80
- }
81
- repeat(count) {
82
- return this.s().repeat(count);
83
- }
84
- toUpperCase() {
85
- return this.s().toUpperCase();
86
- }
87
- toLowerCase() {
88
- return this.s().toLowerCase();
89
- }
90
- s() {
91
- if (this.string == null) {
92
- const n = Date.now();
93
- if (n > warned + 60_000) {
94
- console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. " +
95
- "It has been automatically converted to string. In a future version this will throw an error.");
96
- warned = n;
97
- }
98
- this.string = toUtf8(this);
99
- }
100
- return this.string;
101
- }
102
- }
103
- var warned = 0;
@@ -1,20 +0,0 @@
1
- import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
2
- import { JsonShapeDeserializer2 } from "./JsonShapeDeserializer2";
3
- import { JsonShapeSerializer2 } from "./JsonShapeSerializer2";
4
- export class JsonCodec2 extends SerdeContextConfig {
5
- settings;
6
- constructor(settings) {
7
- super();
8
- this.settings = settings;
9
- }
10
- createSerializer() {
11
- const serializer = new JsonShapeSerializer2(this.settings);
12
- serializer.setSerdeContext(this.serdeContext);
13
- return serializer;
14
- }
15
- createDeserializer() {
16
- const deserializer = new JsonShapeDeserializer2(this.settings);
17
- deserializer.setSerdeContext(this.serdeContext);
18
- return deserializer;
19
- }
20
- }