@cdklabs/cdk-ecs-codedeploy 0.0.437 → 0.0.438

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 (135) 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/package.json +34 -34
  7. package/node_modules/@aws-sdk/core/dist-cjs/index.js +52 -50
  8. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +52 -50
  9. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +11 -10
  10. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js +4 -1
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +4 -5
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -1
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +9 -7
  14. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +17 -17
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -8
  16. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -1
  17. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
  18. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +1 -1
  19. package/node_modules/@aws-sdk/core/package.json +11 -11
  20. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  21. package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
  22. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  23. package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
  24. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  25. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  26. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  27. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  28. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  29. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  30. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  31. package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
  32. package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
  33. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  34. package/node_modules/@aws-sdk/token-providers/package.json +7 -7
  35. package/node_modules/@aws-sdk/types/package.json +2 -2
  36. package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
  37. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  38. package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
  39. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  40. package/node_modules/@smithy/config-resolver/package.json +5 -5
  41. package/node_modules/@smithy/core/dist-cjs/index.js +2 -1
  42. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -14
  43. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -2
  44. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +16 -8
  45. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +17 -10
  46. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +6 -1
  47. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +6 -3
  48. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  49. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +23 -11
  50. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +9 -3
  51. package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +2 -2
  52. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +16 -8
  53. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -4
  54. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +8 -6
  55. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +6 -1
  56. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +6 -3
  57. package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  58. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  59. package/node_modules/@smithy/core/package.json +7 -7
  60. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  61. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  62. package/node_modules/@smithy/hash-node/package.json +2 -2
  63. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  64. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  65. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  66. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  67. package/node_modules/@smithy/middleware-serde/package.json +4 -4
  68. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  69. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  70. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +191 -96
  71. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +45 -0
  72. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +71 -35
  73. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -18
  74. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +44 -43
  75. package/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +42 -0
  76. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +34 -14
  77. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +32 -8
  78. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +14 -6
  79. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  80. package/node_modules/@smithy/property-provider/package.json +2 -2
  81. package/node_modules/@smithy/protocol-http/package.json +2 -2
  82. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  83. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  84. package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +5 -0
  85. package/node_modules/@smithy/service-error-classification/dist-es/index.js +4 -0
  86. package/node_modules/@smithy/service-error-classification/dist-types/index.d.ts +6 -0
  87. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  88. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  89. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +11 -5
  90. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +11 -5
  91. package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +3 -3
  92. package/node_modules/@smithy/signature-v4/package.json +4 -4
  93. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +8 -1
  94. package/node_modules/@smithy/smithy-client/dist-es/command.js +8 -1
  95. package/node_modules/@smithy/smithy-client/package.json +7 -7
  96. package/node_modules/@smithy/types/dist-types/connection/config.d.ts +5 -0
  97. package/node_modules/@smithy/types/dist-types/signature.d.ts +20 -3
  98. package/node_modules/@smithy/types/package.json +1 -1
  99. package/node_modules/@smithy/url-parser/package.json +3 -3
  100. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  101. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  102. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +79 -71
  103. package/node_modules/@smithy/util-endpoints/dist-es/decideEndpoint.js +4 -3
  104. package/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js +2 -1
  105. package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +8 -13
  106. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js +9 -7
  107. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js +12 -8
  108. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js +14 -13
  109. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js +7 -4
  110. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js +10 -8
  111. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js +4 -4
  112. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js +5 -5
  113. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js +4 -4
  114. package/node_modules/@smithy/util-endpoints/dist-types/bdd/BinaryDecisionDiagram.d.ts +2 -2
  115. package/node_modules/@smithy/util-endpoints/dist-types/types/shared.d.ts +3 -3
  116. package/node_modules/@smithy/util-endpoints/dist-types/utils/endpointFunctions.d.ts +2 -15
  117. package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateCondition.d.ts +6 -3
  118. package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateConditions.d.ts +3 -3
  119. package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts +1 -1
  120. package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointProperties.d.ts +2 -2
  121. package/node_modules/@smithy/util-endpoints/dist-types/utils/getReferenceValue.d.ts +2 -2
  122. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  123. package/node_modules/@smithy/util-middleware/package.json +2 -2
  124. package/node_modules/@smithy/util-retry/package.json +3 -3
  125. package/node_modules/@smithy/util-stream/package.json +4 -4
  126. package/node_modules/@smithy/util-waiter/package.json +3 -3
  127. package/node_modules/fast-xml-builder/package.json +1 -1
  128. package/node_modules/fast-xml-builder/src/fxb.js +6 -2
  129. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +16 -2
  130. package/package.json +4 -4
  131. /package/node_modules/{@aws-sdk/xml-builder/node_modules/strnum → strnum}/CHANGELOG.md +0 -0
  132. /package/node_modules/{@aws-sdk/xml-builder/node_modules/strnum → strnum}/LICENSE +0 -0
  133. /package/node_modules/{@aws-sdk/xml-builder/node_modules/strnum → strnum}/README.md +0 -0
  134. /package/node_modules/{@aws-sdk/xml-builder/node_modules/strnum → strnum}/package.json +0 -0
  135. /package/node_modules/{@aws-sdk/xml-builder/node_modules/strnum → strnum}/strnum.js +0 -0
@@ -50,9 +50,13 @@ class EventStreamSerde {
50
50
  body: event.body,
51
51
  };
52
52
  }
53
- const unionMember = Object.keys(event).find((key) => {
54
- return key !== "__type";
55
- }) ?? "";
53
+ let unionMember = "";
54
+ for (const key in event) {
55
+ if (key !== "__type") {
56
+ unionMember = key;
57
+ break;
58
+ }
59
+ }
56
60
  const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);
57
61
  const headers = {
58
62
  ":event-type": { type: "string", value: eventType },
@@ -73,9 +77,13 @@ class EventStreamSerde {
73
77
  const memberSchemas = unionSchema.getMemberSchemas();
74
78
  const initialResponseMarker = Symbol("initialResponseMarker");
75
79
  const asyncIterable = marshaller.deserialize(response.body, async (event) => {
76
- const unionMember = Object.keys(event).find((key) => {
77
- return key !== "__type";
78
- }) ?? "";
80
+ let unionMember = "";
81
+ for (const key in event) {
82
+ if (key !== "__type") {
83
+ unionMember = key;
84
+ break;
85
+ }
86
+ }
79
87
  const body = event[unionMember].body;
80
88
  if (unionMember === "initial-response") {
81
89
  const dataObject = await this.deserializer.read(responseSchema, body);
@@ -151,8 +159,8 @@ class EventStreamSerde {
151
159
  if (!responseSchema) {
152
160
  throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
153
161
  }
154
- for (const [key, value] of Object.entries(firstEvent.value)) {
155
- initialResponseContainer[key] = value;
162
+ for (const key in firstEvent.value) {
163
+ initialResponseContainer[key] = firstEvent.value[key];
156
164
  }
157
165
  }
158
166
  return {
@@ -72,8 +72,8 @@ class HttpProtocol extends SerdeContext {
72
72
  request.query[k] = v;
73
73
  }
74
74
  if (endpoint.headers) {
75
- for (const [name, values] of Object.entries(endpoint.headers)) {
76
- request.headers[name] = values.join(", ");
75
+ for (const name in endpoint.headers) {
76
+ request.headers[name] = endpoint.headers[name].join(", ");
77
77
  }
78
78
  }
79
79
  return request;
@@ -87,8 +87,8 @@ class HttpProtocol extends SerdeContext {
87
87
  ...endpoint.query,
88
88
  };
89
89
  if (endpoint.headers) {
90
- for (const [name, value] of Object.entries(endpoint.headers)) {
91
- request.headers[name] = value;
90
+ for (const name in endpoint.headers) {
91
+ request.headers[name] = endpoint.headers[name];
92
92
  }
93
93
  }
94
94
  return request;
@@ -103,8 +103,10 @@ class HttpProtocol extends SerdeContext {
103
103
  if (opTraits.endpoint) {
104
104
  let hostPrefix = opTraits.endpoint?.[0];
105
105
  if (typeof hostPrefix === "string") {
106
- const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel);
107
- for (const [name] of hostLabelInputs) {
106
+ for (const [name, member] of inputNs.structIterator()) {
107
+ if (!member.getMergedTraits().hostLabel) {
108
+ continue;
109
+ }
108
110
  const replacement = input[name];
109
111
  if (typeof replacement !== "string") {
110
112
  throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
@@ -200,7 +202,9 @@ class HttpBindingProtocol extends HttpProtocol {
200
202
  request.path += path;
201
203
  }
202
204
  const traitSearchParams = new URLSearchParams(search ?? "");
203
- Object.assign(query, Object.fromEntries(traitSearchParams));
205
+ for (const [key, value] of traitSearchParams) {
206
+ query[key] = value;
207
+ }
204
208
  }
205
209
  }
206
210
  for (const [memberName, memberNs] of ns.structIterator()) {
@@ -250,7 +254,8 @@ class HttpBindingProtocol extends HttpProtocol {
250
254
  headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
251
255
  }
252
256
  else if (typeof memberTraits.httpPrefixHeaders === "string") {
253
- for (const [key, val] of Object.entries(inputMemberValue)) {
257
+ for (const key in inputMemberValue) {
258
+ const val = inputMemberValue[key];
254
259
  const amalgam = memberTraits.httpPrefixHeaders + key;
255
260
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
256
261
  headers[amalgam.toLowerCase()] = serializer.flush();
@@ -295,8 +300,9 @@ class HttpBindingProtocol extends HttpProtocol {
295
300
  const serializer = this.serializer;
296
301
  const traits = ns.getMergedTraits();
297
302
  if (traits.httpQueryParams) {
298
- for (const [key, val] of Object.entries(data)) {
303
+ for (const key in data) {
299
304
  if (!(key in query)) {
305
+ const val = data[key];
300
306
  const valueSchema = ns.getValueSchema();
301
307
  Object.assign(valueSchema.getMergedTraits(), {
302
308
  ...traits,
@@ -424,8 +430,9 @@ class HttpBindingProtocol extends HttpProtocol {
424
430
  }
425
431
  else if (memberTraits.httpPrefixHeaders !== undefined) {
426
432
  dataObject[memberName] = {};
427
- for (const [header, value] of Object.entries(response.headers)) {
433
+ for (const header in response.headers) {
428
434
  if (header.startsWith(memberTraits.httpPrefixHeaders)) {
435
+ const value = response.headers[header];
429
436
  const valueSchema = memberSchema.getValueSchema();
430
437
  valueSchema.getMergedTraits().httpHeader = header;
431
438
  dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
@@ -655,7 +655,12 @@ class TypeRegistry {
655
655
  return undefined;
656
656
  }
657
657
  find(predicate) {
658
- return [...this.schemas.values()].find(predicate);
658
+ for (const schema of this.schemas.values()) {
659
+ if (predicate(schema)) {
660
+ return schema;
661
+ }
662
+ }
663
+ return undefined;
659
664
  }
660
665
  clear() {
661
666
  this.schemas.clear();
@@ -141,9 +141,12 @@ const expectUnion = (value) => {
141
141
  return undefined;
142
142
  }
143
143
  const asObject = expectObject(value);
144
- const setKeys = Object.entries(asObject)
145
- .filter(([, v]) => v != null)
146
- .map(([k]) => k);
144
+ const setKeys = [];
145
+ for (const k in asObject) {
146
+ if (asObject[k] != null) {
147
+ setKeys.push(k);
148
+ }
149
+ }
147
150
  if (setKeys.length === 0) {
148
151
  throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
149
152
  }
@@ -4,7 +4,8 @@ exports.DefaultIdentityProviderConfig = void 0;
4
4
  class DefaultIdentityProviderConfig {
5
5
  authSchemes = new Map();
6
6
  constructor(config) {
7
- for (const [key, value] of Object.entries(config)) {
7
+ for (const key in config) {
8
+ const value = config[key];
8
9
  if (value !== undefined) {
9
10
  this.authSchemes.set(key, value);
10
11
  }
@@ -62,7 +62,7 @@ export class CborShapeSerializer extends SerdeContext {
62
62
  const newObject = {};
63
63
  if (ns.isMapSchema()) {
64
64
  const sparse = !!ns.getMergedTraits().sparse;
65
- for (const key of Object.keys(sourceObject)) {
65
+ for (const key in sourceObject) {
66
66
  const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
67
67
  if (value != null || sparse) {
68
68
  newObject[key] = value;
@@ -82,15 +82,15 @@ export class CborShapeSerializer extends SerdeContext {
82
82
  newObject[k] = v;
83
83
  }
84
84
  else if (typeof sourceObject.__type === "string") {
85
- for (const [k, v] of Object.entries(sourceObject)) {
85
+ for (const k in sourceObject) {
86
86
  if (!(k in newObject)) {
87
- newObject[k] = this.serialize(15, v);
87
+ newObject[k] = this.serialize(15, sourceObject[k]);
88
88
  }
89
89
  }
90
90
  }
91
91
  }
92
92
  else if (ns.isDocumentSchema()) {
93
- for (const key of Object.keys(sourceObject)) {
93
+ for (const key in sourceObject) {
94
94
  newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
95
95
  }
96
96
  }
@@ -163,7 +163,7 @@ export class CborShapeDeserializer extends SerdeContext {
163
163
  const newObject = {};
164
164
  if (ns.isMapSchema()) {
165
165
  const targetSchema = ns.getValueSchema();
166
- for (const key of Object.keys(value)) {
166
+ for (const key in value) {
167
167
  const itemValue = this.readValue(targetSchema, value[key]);
168
168
  newObject[key] = itemValue;
169
169
  }
@@ -172,7 +172,12 @@ export class CborShapeDeserializer extends SerdeContext {
172
172
  const isUnion = ns.isUnionSchema();
173
173
  let keys;
174
174
  if (isUnion) {
175
- keys = new Set(Object.keys(value).filter((k) => k !== "__type"));
175
+ keys = new Set();
176
+ for (const k in value) {
177
+ if (k !== "__type") {
178
+ keys.add(k);
179
+ }
180
+ }
176
181
  }
177
182
  for (const [key, memberSchema] of ns.structIterator()) {
178
183
  if (isUnion) {
@@ -182,14 +187,21 @@ export class CborShapeDeserializer extends SerdeContext {
182
187
  newObject[key] = this.readValue(memberSchema, value[key]);
183
188
  }
184
189
  }
185
- if (isUnion && keys?.size === 1 && Object.keys(newObject).length === 0) {
186
- const k = keys.values().next().value;
187
- newObject.$unknown = [k, value[k]];
190
+ if (isUnion && keys?.size === 1) {
191
+ let newObjectEmpty = true;
192
+ for (const _ in newObject) {
193
+ newObjectEmpty = false;
194
+ break;
195
+ }
196
+ if (newObjectEmpty) {
197
+ const k = keys.values().next().value;
198
+ newObject.$unknown = [k, value[k]];
199
+ }
188
200
  }
189
201
  else if (typeof value.__type === "string") {
190
- for (const [k, v] of Object.entries(value)) {
202
+ for (const k in value) {
191
203
  if (!(k in newObject)) {
192
- newObject[k] = v;
204
+ newObject[k] = value[k];
193
205
  }
194
206
  }
195
207
  }
@@ -50,7 +50,13 @@ export const loadSmithyRpcV2CborErrorCode = (output, data) => {
50
50
  if (data["__type"] !== undefined) {
51
51
  return sanitizeErrorCode(data["__type"]);
52
52
  }
53
- const codeKey = Object.keys(data).find((key) => key.toLowerCase() === "code");
53
+ let codeKey;
54
+ for (const key in data) {
55
+ if (key.toLowerCase() === "code") {
56
+ codeKey = key;
57
+ break;
58
+ }
59
+ }
54
60
  if (codeKey && data[codeKey] !== undefined) {
55
61
  return sanitizeErrorCode(data[codeKey]);
56
62
  }
@@ -77,8 +83,8 @@ export const buildHttpRpcRequest = async (context, headers, path, resolvedHostna
77
83
  contents.hostname = resolvedHostname;
78
84
  }
79
85
  if (endpoint.headers) {
80
- for (const [name, value] of Object.entries(endpoint.headers)) {
81
- contents.headers[name] = value;
86
+ for (const name in endpoint.headers) {
87
+ contents.headers[name] = endpoint.headers[name];
82
88
  }
83
89
  }
84
90
  if (body !== undefined) {
@@ -5,8 +5,8 @@ export const toEndpointV1 = (endpoint) => {
5
5
  const v1Endpoint = parseUrl(endpoint.url);
6
6
  if (endpoint.headers) {
7
7
  v1Endpoint.headers = {};
8
- for (const [name, values] of Object.entries(endpoint.headers)) {
9
- v1Endpoint.headers[name.toLowerCase()] = values.join(", ");
8
+ for (const name in endpoint.headers) {
9
+ v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
10
10
  }
11
11
  }
12
12
  return v1Endpoint;
@@ -47,9 +47,13 @@ export class EventStreamSerde {
47
47
  body: event.body,
48
48
  };
49
49
  }
50
- const unionMember = Object.keys(event).find((key) => {
51
- return key !== "__type";
52
- }) ?? "";
50
+ let unionMember = "";
51
+ for (const key in event) {
52
+ if (key !== "__type") {
53
+ unionMember = key;
54
+ break;
55
+ }
56
+ }
53
57
  const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);
54
58
  const headers = {
55
59
  ":event-type": { type: "string", value: eventType },
@@ -70,9 +74,13 @@ export class EventStreamSerde {
70
74
  const memberSchemas = unionSchema.getMemberSchemas();
71
75
  const initialResponseMarker = Symbol("initialResponseMarker");
72
76
  const asyncIterable = marshaller.deserialize(response.body, async (event) => {
73
- const unionMember = Object.keys(event).find((key) => {
74
- return key !== "__type";
75
- }) ?? "";
77
+ let unionMember = "";
78
+ for (const key in event) {
79
+ if (key !== "__type") {
80
+ unionMember = key;
81
+ break;
82
+ }
83
+ }
76
84
  const body = event[unionMember].body;
77
85
  if (unionMember === "initial-response") {
78
86
  const dataObject = await this.deserializer.read(responseSchema, body);
@@ -148,8 +156,8 @@ export class EventStreamSerde {
148
156
  if (!responseSchema) {
149
157
  throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
150
158
  }
151
- for (const [key, value] of Object.entries(firstEvent.value)) {
152
- initialResponseContainer[key] = value;
159
+ for (const key in firstEvent.value) {
160
+ initialResponseContainer[key] = firstEvent.value[key];
153
161
  }
154
162
  }
155
163
  return {
@@ -41,7 +41,9 @@ export class HttpBindingProtocol extends HttpProtocol {
41
41
  request.path += path;
42
42
  }
43
43
  const traitSearchParams = new URLSearchParams(search ?? "");
44
- Object.assign(query, Object.fromEntries(traitSearchParams));
44
+ for (const [key, value] of traitSearchParams) {
45
+ query[key] = value;
46
+ }
45
47
  }
46
48
  }
47
49
  for (const [memberName, memberNs] of ns.structIterator()) {
@@ -91,7 +93,8 @@ export class HttpBindingProtocol extends HttpProtocol {
91
93
  headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
92
94
  }
93
95
  else if (typeof memberTraits.httpPrefixHeaders === "string") {
94
- for (const [key, val] of Object.entries(inputMemberValue)) {
96
+ for (const key in inputMemberValue) {
97
+ const val = inputMemberValue[key];
95
98
  const amalgam = memberTraits.httpPrefixHeaders + key;
96
99
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
97
100
  headers[amalgam.toLowerCase()] = serializer.flush();
@@ -136,8 +139,9 @@ export class HttpBindingProtocol extends HttpProtocol {
136
139
  const serializer = this.serializer;
137
140
  const traits = ns.getMergedTraits();
138
141
  if (traits.httpQueryParams) {
139
- for (const [key, val] of Object.entries(data)) {
142
+ for (const key in data) {
140
143
  if (!(key in query)) {
144
+ const val = data[key];
141
145
  const valueSchema = ns.getValueSchema();
142
146
  Object.assign(valueSchema.getMergedTraits(), {
143
147
  ...traits,
@@ -265,8 +269,9 @@ export class HttpBindingProtocol extends HttpProtocol {
265
269
  }
266
270
  else if (memberTraits.httpPrefixHeaders !== undefined) {
267
271
  dataObject[memberName] = {};
268
- for (const [header, value] of Object.entries(response.headers)) {
272
+ for (const header in response.headers) {
269
273
  if (header.startsWith(memberTraits.httpPrefixHeaders)) {
274
+ const value = response.headers[header];
270
275
  const valueSchema = memberSchema.getValueSchema();
271
276
  valueSchema.getMergedTraits().httpHeader = header;
272
277
  dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
@@ -42,8 +42,8 @@ export class HttpProtocol extends SerdeContext {
42
42
  request.query[k] = v;
43
43
  }
44
44
  if (endpoint.headers) {
45
- for (const [name, values] of Object.entries(endpoint.headers)) {
46
- request.headers[name] = values.join(", ");
45
+ for (const name in endpoint.headers) {
46
+ request.headers[name] = endpoint.headers[name].join(", ");
47
47
  }
48
48
  }
49
49
  return request;
@@ -57,8 +57,8 @@ export class HttpProtocol extends SerdeContext {
57
57
  ...endpoint.query,
58
58
  };
59
59
  if (endpoint.headers) {
60
- for (const [name, value] of Object.entries(endpoint.headers)) {
61
- request.headers[name] = value;
60
+ for (const name in endpoint.headers) {
61
+ request.headers[name] = endpoint.headers[name];
62
62
  }
63
63
  }
64
64
  return request;
@@ -73,8 +73,10 @@ export class HttpProtocol extends SerdeContext {
73
73
  if (opTraits.endpoint) {
74
74
  let hostPrefix = opTraits.endpoint?.[0];
75
75
  if (typeof hostPrefix === "string") {
76
- const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel);
77
- for (const [name] of hostLabelInputs) {
76
+ for (const [name, member] of inputNs.structIterator()) {
77
+ if (!member.getMergedTraits().hostLabel) {
78
+ continue;
79
+ }
78
80
  const replacement = input[name];
79
81
  if (typeof replacement !== "string") {
80
82
  throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
@@ -69,7 +69,12 @@ export class TypeRegistry {
69
69
  return undefined;
70
70
  }
71
71
  find(predicate) {
72
- return [...this.schemas.values()].find(predicate);
72
+ for (const schema of this.schemas.values()) {
73
+ if (predicate(schema)) {
74
+ return schema;
75
+ }
76
+ }
77
+ return undefined;
73
78
  }
74
79
  clear() {
75
80
  this.schemas.clear();
@@ -135,9 +135,12 @@ export const expectUnion = (value) => {
135
135
  return undefined;
136
136
  }
137
137
  const asObject = expectObject(value);
138
- const setKeys = Object.entries(asObject)
139
- .filter(([, v]) => v != null)
140
- .map(([k]) => k);
138
+ const setKeys = [];
139
+ for (const k in asObject) {
140
+ if (asObject[k] != null) {
141
+ setKeys.push(k);
142
+ }
143
+ }
141
144
  if (setKeys.length === 0) {
142
145
  throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
143
146
  }
@@ -1,7 +1,8 @@
1
1
  export class DefaultIdentityProviderConfig {
2
2
  authSchemes = new Map();
3
3
  constructor(config) {
4
- for (const [key, value] of Object.entries(config)) {
4
+ for (const key in config) {
5
+ const value = config[key];
5
6
  if (value !== undefined) {
6
7
  this.authSchemes.set(key, value);
7
8
  }
@@ -62,7 +62,7 @@ export declare class TypeRegistry {
62
62
  * @param predicate - criterion.
63
63
  * @returns a schema in this registry matching the predicate.
64
64
  */
65
- find(predicate: (schema: ISchema) => boolean): ISchema | undefined;
65
+ find(predicate: (schema: ISchema) => boolean): number | import("@smithy/types").StaticSimpleSchema | import("@smithy/types").StaticListSchema | import("@smithy/types").StaticMapSchema | import("@smithy/types").StaticStructureSchema | import("@smithy/types").StaticUnionSchema | StaticErrorSchema | import("@smithy/types").StaticOperationSchema | "unit" | import("@smithy/types").NormalizedSchema | import("@smithy/types").TraitsSchema | import("@smithy/types").MemberSchema | undefined;
66
66
  /**
67
67
  * Unloads the current TypeRegistry.
68
68
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.23.14",
3
+ "version": "3.23.16",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline core",
@@ -85,13 +85,13 @@
85
85
  "license": "Apache-2.0",
86
86
  "sideEffects": false,
87
87
  "dependencies": {
88
- "@smithy/protocol-http": "^5.3.13",
89
- "@smithy/types": "^4.14.0",
90
- "@smithy/url-parser": "^4.2.13",
88
+ "@smithy/protocol-http": "^5.3.14",
89
+ "@smithy/types": "^4.14.1",
90
+ "@smithy/url-parser": "^4.2.14",
91
91
  "@smithy/util-base64": "^4.3.2",
92
92
  "@smithy/util-body-length-browser": "^4.2.2",
93
- "@smithy/util-middleware": "^4.2.13",
94
- "@smithy/util-stream": "^4.5.22",
93
+ "@smithy/util-middleware": "^4.2.14",
94
+ "@smithy/util-stream": "^4.5.24",
95
95
  "@smithy/util-utf8": "^4.2.2",
96
96
  "@smithy/uuid": "^1.1.2",
97
97
  "tslib": "^2.6.2"
@@ -128,7 +128,7 @@
128
128
  "directory": "packages/core"
129
129
  },
130
130
  "devDependencies": {
131
- "@smithy/eventstream-serde-node": "^4.2.13",
131
+ "@smithy/eventstream-serde-node": "^4.2.14",
132
132
  "@types/node": "^18.11.9",
133
133
  "concurrently": "7.0.0",
134
134
  "downlevel-dts": "0.10.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/credential-provider-imds",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -27,10 +27,10 @@
27
27
  "license": "Apache-2.0",
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@smithy/node-config-provider": "^4.3.13",
31
- "@smithy/property-provider": "^4.2.13",
32
- "@smithy/types": "^4.14.0",
33
- "@smithy/url-parser": "^4.2.13",
30
+ "@smithy/node-config-provider": "^4.3.14",
31
+ "@smithy/property-provider": "^4.2.14",
32
+ "@smithy/types": "^4.14.1",
33
+ "@smithy/url-parser": "^4.2.14",
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.3.16",
3
+ "version": "5.3.17",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -27,14 +27,14 @@
27
27
  "module": "./dist-es/index.js",
28
28
  "types": "./dist-types/index.d.ts",
29
29
  "dependencies": {
30
- "@smithy/protocol-http": "^5.3.13",
31
- "@smithy/querystring-builder": "^4.2.13",
32
- "@smithy/types": "^4.14.0",
30
+ "@smithy/protocol-http": "^5.3.14",
31
+ "@smithy/querystring-builder": "^4.2.14",
32
+ "@smithy/types": "^4.14.1",
33
33
  "@smithy/util-base64": "^4.3.2",
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@smithy/abort-controller": "^4.2.13",
37
+ "@smithy/abort-controller": "^4.2.14",
38
38
  "concurrently": "7.0.0",
39
39
  "downlevel-dts": "0.10.1",
40
40
  "premove": "4.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/hash-node",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline hash-node",
@@ -31,7 +31,7 @@
31
31
  "typedoc": "0.23.23"
32
32
  },
33
33
  "dependencies": {
34
- "@smithy/types": "^4.14.0",
34
+ "@smithy/types": "^4.14.1",
35
35
  "@smithy/util-buffer-from": "^4.2.2",
36
36
  "@smithy/util-utf8": "^4.2.2",
37
37
  "tslib": "^2.6.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/invalid-dependency",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline invalid-dependency",
@@ -23,7 +23,7 @@
23
23
  "license": "Apache-2.0",
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
- "@smithy/types": "^4.14.0",
26
+ "@smithy/types": "^4.14.1",
27
27
  "tslib": "^2.6.2"
28
28
  },
29
29
  "typesVersions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-content-length",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-content-length",
@@ -24,8 +24,8 @@
24
24
  "license": "Apache-2.0",
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
- "@smithy/protocol-http": "^5.3.13",
28
- "@smithy/types": "^4.14.0",
27
+ "@smithy/protocol-http": "^5.3.14",
28
+ "@smithy/types": "^4.14.1",
29
29
  "tslib": "^2.6.2"
30
30
  },
31
31
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-endpoint",
3
- "version": "4.4.29",
3
+ "version": "4.4.31",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-endpoint",
@@ -24,13 +24,13 @@
24
24
  "license": "Apache-2.0",
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
- "@smithy/core": "^3.23.14",
28
- "@smithy/middleware-serde": "^4.2.17",
29
- "@smithy/node-config-provider": "^4.3.13",
30
- "@smithy/shared-ini-file-loader": "^4.4.8",
31
- "@smithy/types": "^4.14.0",
32
- "@smithy/url-parser": "^4.2.13",
33
- "@smithy/util-middleware": "^4.2.13",
27
+ "@smithy/core": "^3.23.16",
28
+ "@smithy/middleware-serde": "^4.2.19",
29
+ "@smithy/node-config-provider": "^4.3.14",
30
+ "@smithy/shared-ini-file-loader": "^4.4.9",
31
+ "@smithy/types": "^4.14.1",
32
+ "@smithy/url-parser": "^4.2.14",
33
+ "@smithy/util-middleware": "^4.2.14",
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "devDependencies": {