@cdklabs/cdk-ecs-codedeploy 0.0.453 → 0.0.455

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 (107) 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 +45 -39
  7. package/node_modules/@aws-sdk/client-codedeploy/dist-es/models/enums.js +4 -0
  8. package/node_modules/@aws-sdk/client-codedeploy/dist-es/models/errors.js +36 -36
  9. package/node_modules/@aws-sdk/client-codedeploy/dist-es/schemas/schemas_0.js +3 -2
  10. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/CreateApplicationCommand.d.ts +3 -0
  11. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/CreateDeploymentCommand.d.ts +10 -0
  12. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/ListDeploymentInstancesCommand.d.ts +7 -0
  13. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/ListDeploymentTargetsCommand.d.ts +7 -0
  14. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/enums.d.ts +12 -0
  15. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/errors.d.ts +36 -36
  16. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/models_0.d.ts +6 -1
  17. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/enums.d.ts +5 -0
  18. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/errors.d.ts +15 -15
  19. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/models_0.d.ts +2 -0
  20. package/node_modules/@aws-sdk/client-codedeploy/package.json +8 -8
  21. package/node_modules/@aws-sdk/core/package.json +5 -5
  22. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  23. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  24. package/node_modules/@aws-sdk/credential-provider-ini/package.json +12 -12
  25. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  26. package/node_modules/@aws-sdk/credential-provider-node/package.json +10 -10
  27. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  28. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  29. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  33. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  34. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  35. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  36. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
  37. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +8 -4
  38. package/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +8 -4
  39. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  40. package/node_modules/@aws-sdk/types/package.json +2 -2
  41. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  42. package/node_modules/@smithy/core/dist-cjs/index.js +3 -1
  43. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +126 -39
  44. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +14 -3
  45. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +3 -1
  46. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +3 -1
  47. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +10 -1
  48. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +10 -1
  49. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +16 -2
  50. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +4 -1
  51. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +4 -1
  52. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -1
  53. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +4 -1
  54. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -1
  55. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +7 -0
  56. package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +3 -0
  57. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +29 -13
  58. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +12 -4
  59. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +9 -0
  60. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +7 -0
  61. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +44 -15
  62. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +22 -4
  63. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +5 -0
  64. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +3 -0
  65. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +4 -1
  66. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +6 -1
  67. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +4 -1
  68. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +3 -0
  69. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +7 -0
  70. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +4 -1
  71. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -0
  72. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +5 -0
  73. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +3 -0
  74. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +4 -1
  75. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
  76. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  77. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
  78. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +3 -0
  79. package/node_modules/@smithy/core/dist-es/submodules/transport/hasOwn.js +3 -0
  80. package/node_modules/@smithy/core/dist-es/submodules/transport/index.js +1 -0
  81. package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +3 -0
  82. package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +1 -0
  83. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
  84. package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +1 -0
  85. package/node_modules/@smithy/core/dist-types/submodules/transport/hasOwn.d.ts +4 -0
  86. package/node_modules/@smithy/core/dist-types/submodules/transport/index.d.ts +1 -0
  87. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
  88. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  89. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
  90. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/transport/hasOwn.d.ts +4 -0
  91. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/transport/index.d.ts +1 -0
  92. package/node_modules/@smithy/core/package.json +1 -1
  93. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +17 -6
  94. package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +3 -0
  95. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +3 -0
  96. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  97. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  98. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  99. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +19 -7
  100. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -1
  101. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +4 -1
  102. package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +4 -1
  103. package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +10 -3
  104. package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +4 -1
  105. package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +4 -1
  106. package/node_modules/@smithy/signature-v4/package.json +2 -2
  107. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { TypeRegistry } from "@smithy/core/schema";
2
3
  import { fromUtf8, toUtf8 } from "@smithy/core/serde";
3
4
  export class EventStreamSerde {
@@ -52,6 +53,8 @@ export class EventStreamSerde {
52
53
  }
53
54
  let unionMember = "";
54
55
  for (const key in event) {
56
+ if (!hasOwn(event, key))
57
+ continue;
55
58
  if (key !== "__type") {
56
59
  unionMember = key;
57
60
  break;
@@ -79,6 +82,8 @@ export class EventStreamSerde {
79
82
  const asyncIterable = marshaller.deserialize(response.body, async (event) => {
80
83
  let unionMember = "";
81
84
  for (const key in event) {
85
+ if (!hasOwn(event, key))
86
+ continue;
82
87
  if (key !== "__type") {
83
88
  unionMember = key;
84
89
  break;
@@ -153,6 +158,8 @@ export class EventStreamSerde {
153
158
  throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
154
159
  }
155
160
  for (const key in firstEvent.value) {
161
+ if (!hasOwn(firstEvent.value, key))
162
+ continue;
156
163
  initialResponseContainer[key] = firstEvent.value[key];
157
164
  }
158
165
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { fromHex, toHex } from "@smithy/core/serde";
2
3
  import { Int64 } from "./Int64";
3
4
  export class HeaderMarshaller {
@@ -9,7 +10,9 @@ export class HeaderMarshaller {
9
10
  }
10
11
  format(headers) {
11
12
  const chunks = [];
12
- for (const headerName of Object.keys(headers)) {
13
+ for (const headerName in headers) {
14
+ if (!hasOwn(headers, headerName))
15
+ continue;
13
16
  const bytes = this.fromUtf8(headerName);
14
17
  chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
15
18
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { NormalizedSchema, translateTraits } from "@smithy/core/schema";
2
3
  import { sdkStreamMixin, splitEvery, splitHeader } from "@smithy/core/serde";
3
4
  import { HttpRequest } from "@smithy/core/transport";
@@ -93,6 +94,8 @@ export class HttpBindingProtocol extends HttpProtocol {
93
94
  }
94
95
  else if (typeof memberTraits.httpPrefixHeaders === "string") {
95
96
  for (const key in inputMemberValue) {
97
+ if (!hasOwn(inputMemberValue, key))
98
+ continue;
96
99
  const val = inputMemberValue[key];
97
100
  const amalgam = memberTraits.httpPrefixHeaders + key;
98
101
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
@@ -139,6 +142,8 @@ export class HttpBindingProtocol extends HttpProtocol {
139
142
  const traits = ns.getMergedTraits();
140
143
  if (traits.httpQueryParams) {
141
144
  for (const key in data) {
145
+ if (!hasOwn(data, key))
146
+ continue;
142
147
  if (!(key in query)) {
143
148
  const val = data[key];
144
149
  const valueSchema = ns.getValueSchema();
@@ -182,6 +187,8 @@ export class HttpBindingProtocol extends HttpProtocol {
182
187
  throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
183
188
  }
184
189
  for (const header in response.headers) {
190
+ if (!hasOwn(response.headers, header))
191
+ continue;
185
192
  const value = response.headers[header];
186
193
  delete response.headers[header];
187
194
  response.headers[header.toLowerCase()] = value;
@@ -269,6 +276,8 @@ export class HttpBindingProtocol extends HttpProtocol {
269
276
  else if (memberTraits.httpPrefixHeaders !== undefined) {
270
277
  dataObject[memberName] = {};
271
278
  for (const header in response.headers) {
279
+ if (!hasOwn(response.headers, header))
280
+ continue;
272
281
  if (header.startsWith(memberTraits.httpPrefixHeaders)) {
273
282
  const value = response.headers[header];
274
283
  const valueSchema = memberSchema.getValueSchema();
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { NormalizedSchema, TypeRegistry, translateTraits } from "@smithy/core/schema";
2
3
  import { HttpRequest, HttpResponse, isValidHostname } from "@smithy/core/transport";
3
4
  import { SerdeContext } from "./SerdeContext";
@@ -43,6 +44,8 @@ export class HttpProtocol extends SerdeContext {
43
44
  }
44
45
  if (endpoint.headers) {
45
46
  for (const name in endpoint.headers) {
47
+ if (!hasOwn(endpoint.headers, name))
48
+ continue;
46
49
  request.headers[name] = endpoint.headers[name].join(", ");
47
50
  }
48
51
  }
@@ -58,6 +61,8 @@ export class HttpProtocol extends SerdeContext {
58
61
  };
59
62
  if (endpoint.headers) {
60
63
  for (const name in endpoint.headers) {
64
+ if (!hasOwn(endpoint.headers, name))
65
+ continue;
61
66
  request.headers[name] = endpoint.headers[name];
62
67
  }
63
68
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { NormalizedSchema } from "@smithy/core/schema";
2
3
  import { HttpRequest } from "@smithy/core/transport";
3
4
  import { HttpProtocol } from "./HttpProtocol";
@@ -67,6 +68,8 @@ export class RpcProtocol extends HttpProtocol {
67
68
  throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
68
69
  }
69
70
  for (const header in response.headers) {
71
+ if (!hasOwn(response.headers, header))
72
+ continue;
70
73
  const value = response.headers[header];
71
74
  delete response.headers[header];
72
75
  response.headers[header.toLowerCase()] = value;
@@ -1,10 +1,13 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { HttpResponse } from "@smithy/core/protocols";
2
3
  import { parseRfc7231DateTime } from "@smithy/core/serde";
3
4
  export function parseRetryAfterHeader(response, logger) {
4
5
  if (!HttpResponse.isInstance(response)) {
5
6
  return;
6
7
  }
7
- for (const header of Object.keys(response.headers)) {
8
+ for (const header in response.headers) {
9
+ if (!hasOwn(response.headers, header))
10
+ continue;
8
11
  const h = header.toLowerCase();
9
12
  if (h === "retry-after") {
10
13
  const retryAfter = response.headers[header];
@@ -41,3 +41,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
41
41
  const _getRandomValues = (array) => crypto.getRandomValues(array);
42
42
  export const v4 = bindV4(_getRandomValues);
43
43
  export const generateIdempotencyToken = v4;
44
+ export { hasOwn } from "@smithy/core/transport";
@@ -40,3 +40,4 @@ export { streamCollector } from "./util-stream/stream-collector";
40
40
  const _getRandomValues = getRandomValues;
41
41
  export const v4 = bindV4(_getRandomValues);
42
42
  export const generateIdempotencyToken = v4;
43
+ export { hasOwn } from "@smithy/core/transport";
@@ -43,3 +43,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
43
43
  const _getRandomValues = (array) => crypto.getRandomValues(array);
44
44
  export const v4 = bindV4(_getRandomValues);
45
45
  export const generateIdempotencyToken = v4;
46
+ export { hasOwn } from "@smithy/core/transport";
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  export const parseBoolean = (value) => {
2
3
  switch (value) {
3
4
  case "true":
@@ -137,6 +138,8 @@ export const expectUnion = (value) => {
137
138
  const asObject = expectObject(value);
138
139
  const setKeys = [];
139
140
  for (const k in asObject) {
141
+ if (!hasOwn(asObject, k))
142
+ continue;
140
143
  if (asObject[k] != null) {
141
144
  setKeys.push(k);
142
145
  }
@@ -0,0 +1,3 @@
1
+ export function hasOwn(o, k) {
2
+ return Object.prototype.hasOwnProperty.call(o, k);
3
+ }
@@ -1,4 +1,5 @@
1
1
  export { getSmithyContext } from "./getSmithyContext";
2
+ export { hasOwn } from "./hasOwn";
2
3
  export { HttpRequest } from "./httpRequest";
3
4
  export { HttpResponse } from "./httpResponse";
4
5
  export { isValidHostLabel } from "./isValidHostLabel";
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "./hasOwn";
1
2
  import { parseUrl } from "./parseUrl";
2
3
  export const toEndpointV1 = (endpoint) => {
3
4
  if (typeof endpoint === "object") {
@@ -6,6 +7,8 @@ export const toEndpointV1 = (endpoint) => {
6
7
  if (endpoint.headers) {
7
8
  v1Endpoint.headers = {};
8
9
  for (const name in endpoint.headers) {
10
+ if (!hasOwn(endpoint.headers, name))
11
+ continue;
9
12
  v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
10
13
  }
11
14
  }
@@ -39,3 +39,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
39
39
  export { streamCollector } from "./util-stream/stream-collector.browser";
40
40
  export declare const v4: () => string;
41
41
  export declare const generateIdempotencyToken: () => string;
42
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector.browser";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare function hasOwn(o: object, k: string): boolean;
@@ -1,4 +1,5 @@
1
1
  export { getSmithyContext } from "./getSmithyContext";
2
+ export { hasOwn } from "./hasOwn";
2
3
  export { HttpRequest } from "./httpRequest";
3
4
  export type { IHttpRequest } from "./httpRequest";
4
5
  export { HttpResponse } from "./httpResponse";
@@ -39,3 +39,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
39
39
  export { streamCollector } from "./util-stream/stream-collector.browser";
40
40
  export declare const v4: () => string;
41
41
  export declare const generateIdempotencyToken: () => string;
42
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector.browser";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare function hasOwn(o: object, k: string): boolean;
@@ -1,4 +1,5 @@
1
1
  export { getSmithyContext } from "./getSmithyContext";
2
+ export { hasOwn } from "./hasOwn";
2
3
  export { HttpRequest } from "./httpRequest";
3
4
  export { IHttpRequest } from "./httpRequest";
4
5
  export { HttpResponse } from "./httpResponse";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.33.2",
3
+ "version": "3.33.3",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -1,9 +1,10 @@
1
+ const { hasOwn } = require("@smithy/core/serde");
2
+ const { streamCollector } = require("@smithy/core/serde");
3
+ exports.streamCollector = streamCollector;
1
4
  const { buildQueryString, HttpResponse } = require("@smithy/core/protocols");
2
5
  const node_https = require("node:https");
3
6
  const { Readable } = require("node:stream");
4
7
  const http2 = require("node:http2");
5
- const { streamCollector } = require("@smithy/core/serde");
6
- exports.streamCollector = streamCollector;
7
8
 
8
9
  function buildAbortError(abortSignal) {
9
10
  const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal
@@ -30,6 +31,8 @@ const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
30
31
  const getTransformedHeaders = (headers) => {
31
32
  const transformedHeaders = {};
32
33
  for (const name in headers) {
34
+ if (!hasOwn(headers, name))
35
+ continue;
33
36
  const headerValues = headers[name];
34
37
  transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
35
38
  }
@@ -231,6 +234,8 @@ class NodeHttpHandler {
231
234
  }
232
235
  if (sockets && requests) {
233
236
  for (const origin in sockets) {
237
+ if (!hasOwn(sockets, origin))
238
+ continue;
234
239
  const socketsInUse = sockets[origin]?.length ?? 0;
235
240
  const requestsEnqueued = requests[origin]?.length ?? 0;
236
241
  if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
@@ -603,9 +608,8 @@ class NodeHttp2ConnectionManager {
603
608
  session.on("error", ensureDestroyed);
604
609
  session.on("frameError", ensureDestroyed);
605
610
  session.on("close", ensureDestroyed);
606
- if (connectionConfiguration.requestTimeout) {
607
- session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);
608
- }
611
+ const timeout = connectionConfiguration.requestTimeout ?? 300_000;
612
+ session.setTimeout(timeout, ensureDestroyed);
609
613
  ref.retain();
610
614
  return ref;
611
615
  }
@@ -812,6 +816,9 @@ class NodeHttp2Handler {
812
816
  resolve({ response: httpResponse });
813
817
  if (useIsolatedSession) {
814
818
  session.close();
819
+ clientHttp2Stream.on("end", () => {
820
+ ref.destroy();
821
+ });
815
822
  }
816
823
  });
817
824
  clientHttp2Stream.on("close", () => {
@@ -822,7 +829,11 @@ class NodeHttp2Handler {
822
829
  this.connectionManager.release(requestContext, ref);
823
830
  }
824
831
  if (!fulfilled) {
825
- rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
832
+ const error = new Error("Unexpected error: http2 request did not get a response");
833
+ if (session.destroyed) {
834
+ error.name = "TimeoutError";
835
+ }
836
+ rejectWithDestroy(error);
826
837
  }
827
838
  });
828
839
  writeRequestBodyPromise = writeRequestBody(clientHttp2Stream, request, effectiveRequestTimeout);
@@ -1,6 +1,9 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  const getTransformedHeaders = (headers) => {
2
3
  const transformedHeaders = {};
3
4
  for (const name in headers) {
5
+ if (!hasOwn(headers, name))
6
+ continue;
4
7
  const headerValues = headers[name];
5
8
  transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
6
9
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  import { HttpResponse, buildQueryString } from "@smithy/core/protocols";
2
3
  import { buildAbortError } from "./build-abort-error";
3
4
  import { NODEJS_TIMEOUT_ERROR_CODES } from "./constants";
@@ -35,6 +36,8 @@ export class NodeHttpHandler {
35
36
  }
36
37
  if (sockets && requests) {
37
38
  for (const origin in sockets) {
39
+ if (!hasOwn(sockets, origin))
40
+ continue;
38
41
  const socketsInUse = sockets[origin]?.length ?? 0;
39
42
  const requestsEnqueued = requests[origin]?.length ?? 0;
40
43
  if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
@@ -64,9 +64,8 @@ export class NodeHttp2ConnectionManager {
64
64
  session.on("error", ensureDestroyed);
65
65
  session.on("frameError", ensureDestroyed);
66
66
  session.on("close", ensureDestroyed);
67
- if (connectionConfiguration.requestTimeout) {
68
- session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);
69
- }
67
+ const timeout = connectionConfiguration.requestTimeout ?? 300_000;
68
+ session.setTimeout(timeout, ensureDestroyed);
70
69
  ref.retain();
71
70
  return ref;
72
71
  }
@@ -142,6 +142,9 @@ export class NodeHttp2Handler {
142
142
  resolve({ response: httpResponse });
143
143
  if (useIsolatedSession) {
144
144
  session.close();
145
+ clientHttp2Stream.on("end", () => {
146
+ ref.destroy();
147
+ });
145
148
  }
146
149
  });
147
150
  clientHttp2Stream.on("close", () => {
@@ -152,7 +155,11 @@ export class NodeHttp2Handler {
152
155
  this.connectionManager.release(requestContext, ref);
153
156
  }
154
157
  if (!fulfilled) {
155
- rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
158
+ const error = new Error("Unexpected error: http2 request did not get a response");
159
+ if (session.destroyed) {
160
+ error.name = "TimeoutError";
161
+ }
162
+ rejectWithDestroy(error);
156
163
  }
157
164
  });
158
165
  writeRequestBodyPromise = writeRequestBody(clientHttp2Stream, request, effectiveRequestTimeout);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.11.2",
3
+ "version": "4.12.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,7 +39,7 @@
39
39
  "test:watch": "yarn g:vitest watch"
40
40
  },
41
41
  "dependencies": {
42
- "@smithy/core": "^3.33.2",
42
+ "@smithy/core": "^3.33.3",
43
43
  "@smithy/types": "^4.17.2",
44
44
  "tslib": "^2.6.2"
45
45
  },
@@ -1,11 +1,13 @@
1
- const { fromUtf8, fromHex, toHex, toUint8Array, isArrayBuffer } = require("@smithy/core/serde");
1
+ const { hasOwn, fromUtf8, fromHex, toHex, toUint8Array, isArrayBuffer } = require("@smithy/core/serde");
2
2
  const { normalizeProvider } = require("@smithy/core/client");
3
3
  const { escapeUri, HttpRequest } = require("@smithy/core/protocols");
4
4
 
5
5
  class HeaderFormatter {
6
6
  format(headers) {
7
7
  const chunks = [];
8
- for (const headerName of Object.keys(headers)) {
8
+ for (const headerName in headers) {
9
+ if (!hasOwn(headers, headerName))
10
+ continue;
9
11
  const bytes = fromUtf8(headerName);
10
12
  chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
11
13
  }
@@ -174,7 +176,9 @@ const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
174
176
  const getCanonicalQuery = ({ query = {} }) => {
175
177
  const keys = [];
176
178
  const serialized = {};
177
- for (const key of Object.keys(query)) {
179
+ for (const key in query) {
180
+ if (!hasOwn(query, key))
181
+ continue;
178
182
  if (key.toLowerCase() === SIGNATURE_HEADER) {
179
183
  continue;
180
184
  }
@@ -341,7 +345,9 @@ const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) =>
341
345
  };
342
346
 
343
347
  const getPayloadHash = async ({ headers, body }, hashConstructor) => {
344
- for (const headerName of Object.keys(headers)) {
348
+ for (const headerName in headers) {
349
+ if (!hasOwn(headers, headerName))
350
+ continue;
345
351
  if (headerName.toLowerCase() === SHA256_HEADER) {
346
352
  return headers[headerName];
347
353
  }
@@ -359,7 +365,9 @@ const getPayloadHash = async ({ headers, body }, hashConstructor) => {
359
365
 
360
366
  const hasHeader = (soughtHeader, headers) => {
361
367
  soughtHeader = soughtHeader.toLowerCase();
362
- for (const headerName of Object.keys(headers)) {
368
+ for (const headerName in headers) {
369
+ if (!hasOwn(headers, headerName))
370
+ continue;
363
371
  if (soughtHeader === headerName.toLowerCase()) {
364
372
  return true;
365
373
  }
@@ -369,7 +377,9 @@ const hasHeader = (soughtHeader, headers) => {
369
377
 
370
378
  const moveHeadersToQuery = (request, options = {}) => {
371
379
  const { headers, query = {} } = HttpRequest.clone(request);
372
- for (const name of Object.keys(headers)) {
380
+ for (const name in headers) {
381
+ if (!hasOwn(headers, name))
382
+ continue;
373
383
  const lname = name.toLowerCase();
374
384
  if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) ||
375
385
  options.hoistableHeaders?.has(lname)) {
@@ -386,7 +396,9 @@ const moveHeadersToQuery = (request, options = {}) => {
386
396
 
387
397
  const prepareRequest = (request) => {
388
398
  request = HttpRequest.clone(request);
389
- for (const headerName of Object.keys(request.headers)) {
399
+ for (const headerName in request.headers) {
400
+ if (!hasOwn(request.headers, headerName))
401
+ continue;
390
402
  if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
391
403
  delete request.headers[headerName];
392
404
  }
@@ -1,8 +1,11 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  import { fromHex, fromUtf8, toHex } from "@smithy/core/serde";
2
3
  export class HeaderFormatter {
3
4
  format(headers) {
4
5
  const chunks = [];
5
- for (const headerName of Object.keys(headers)) {
6
+ for (const headerName in headers) {
7
+ if (!hasOwn(headers, headerName))
8
+ continue;
6
9
  const bytes = fromUtf8(headerName);
7
10
  chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
8
11
  }
@@ -1,9 +1,12 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  import { escapeUri } from "@smithy/core/protocols";
2
3
  import { SIGNATURE_HEADER } from "./constants";
3
4
  export const getCanonicalQuery = ({ query = {} }) => {
4
5
  const keys = [];
5
6
  const serialized = {};
6
- for (const key of Object.keys(query)) {
7
+ for (const key in query) {
8
+ if (!hasOwn(query, key))
9
+ continue;
7
10
  if (key.toLowerCase() === SIGNATURE_HEADER) {
8
11
  continue;
9
12
  }
@@ -1,7 +1,10 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  import { isArrayBuffer, toHex, toUint8Array } from "@smithy/core/serde";
2
3
  import { SHA256_HEADER, UNSIGNED_PAYLOAD } from "./constants";
3
4
  export const getPayloadHash = async ({ headers, body }, hashConstructor) => {
4
- for (const headerName of Object.keys(headers)) {
5
+ for (const headerName in headers) {
6
+ if (!hasOwn(headers, headerName))
7
+ continue;
5
8
  if (headerName.toLowerCase() === SHA256_HEADER) {
6
9
  return headers[headerName];
7
10
  }
@@ -1,6 +1,9 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  export const hasHeader = (soughtHeader, headers) => {
2
3
  soughtHeader = soughtHeader.toLowerCase();
3
- for (const headerName of Object.keys(headers)) {
4
+ for (const headerName in headers) {
5
+ if (!hasOwn(headers, headerName))
6
+ continue;
4
7
  if (soughtHeader === headerName.toLowerCase()) {
5
8
  return true;
6
9
  }
@@ -9,7 +12,9 @@ export const hasHeader = (soughtHeader, headers) => {
9
12
  };
10
13
  export const getHeaderValue = (soughtHeader, headers) => {
11
14
  soughtHeader = soughtHeader.toLowerCase();
12
- for (const headerName of Object.keys(headers)) {
15
+ for (const headerName in headers) {
16
+ if (!hasOwn(headers, headerName))
17
+ continue;
13
18
  if (soughtHeader === headerName.toLowerCase()) {
14
19
  return headers[headerName];
15
20
  }
@@ -18,7 +23,9 @@ export const getHeaderValue = (soughtHeader, headers) => {
18
23
  };
19
24
  export const deleteHeader = (soughtHeader, headers) => {
20
25
  soughtHeader = soughtHeader.toLowerCase();
21
- for (const headerName of Object.keys(headers)) {
26
+ for (const headerName in headers) {
27
+ if (!hasOwn(headers, headerName))
28
+ continue;
22
29
  if (soughtHeader === headerName.toLowerCase()) {
23
30
  delete headers[headerName];
24
31
  }
@@ -1,7 +1,10 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  import { HttpRequest } from "@smithy/core/protocols";
2
3
  export const moveHeadersToQuery = (request, options = {}) => {
3
4
  const { headers, query = {} } = HttpRequest.clone(request);
4
- for (const name of Object.keys(headers)) {
5
+ for (const name in headers) {
6
+ if (!hasOwn(headers, name))
7
+ continue;
5
8
  const lname = name.toLowerCase();
6
9
  if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) ||
7
10
  options.hoistableHeaders?.has(lname)) {
@@ -1,8 +1,11 @@
1
+ import { hasOwn } from "@smithy/core/serde";
1
2
  import { HttpRequest } from "@smithy/core/protocols";
2
3
  import { GENERATED_HEADERS } from "./constants";
3
4
  export const prepareRequest = (request) => {
4
5
  request = HttpRequest.clone(request);
5
- for (const headerName of Object.keys(request.headers)) {
6
+ for (const headerName in request.headers) {
7
+ if (!hasOwn(request.headers, headerName))
8
+ continue;
6
9
  if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
7
10
  delete request.headers[headerName];
8
11
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/signature-v4",
3
- "version": "5.7.2",
3
+ "version": "5.7.3",
4
4
  "description": "A standalone implementation of the AWS Signature V4 request signing algorithm",
5
5
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/signature-v4",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "test:watch": "yarn g:vitest watch"
39
39
  },
40
40
  "dependencies": {
41
- "@smithy/core": "^3.33.2",
41
+ "@smithy/core": "^3.33.3",
42
42
  "@smithy/types": "^4.17.2",
43
43
  "tslib": "^2.6.2"
44
44
  },
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.1111.0",
113
+ "@aws-sdk/client-codedeploy": "^3.1121.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.453",
131
+ "version": "0.0.455",
132
132
  "jest": {
133
133
  "coverageProvider": "v8",
134
134
  "testMatch": [