@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,12 +1,12 @@
1
1
  const { Uint8ArrayBlobAdapter, sdkStreamMixin, splitEvery, splitHeader, fromBase64, _parseEpochTimestamp, _parseRfc7231DateTime, _parseRfc3339DateTimeWithOffset, LazyJsonString, NumericValue, toUtf8, fromUtf8, generateIdempotencyToken, toBase64, dateToUtcString, quoteHeader } = require("@smithy/core/serde");
2
- const { TypeRegistry, NormalizedSchema, translateTraits } = require("@smithy/core/schema");
3
- const { HttpRequest, HttpResponse, isValidHostname } = require("@smithy/core/transport");
2
+ const { HttpRequest, HttpResponse, hasOwn, isValidHostname } = require("@smithy/core/transport");
4
3
  const { parseQueryString, parseUrl } = require("@smithy/core/transport");
5
4
  exports.HttpRequest = HttpRequest;
6
5
  exports.HttpResponse = HttpResponse;
7
6
  exports.isValidHostname = isValidHostname;
8
7
  exports.parseQueryString = parseQueryString;
9
8
  exports.parseUrl = parseUrl;
9
+ const { TypeRegistry, NormalizedSchema, translateTraits } = require("@smithy/core/schema");
10
10
  const { FieldPosition } = require("@smithy/types");
11
11
 
12
12
  const collectBody = async (streamBody = new Uint8Array(), context) => {
@@ -75,6 +75,8 @@ class HttpProtocol extends SerdeContext {
75
75
  }
76
76
  if (endpoint.headers) {
77
77
  for (const name in endpoint.headers) {
78
+ if (!hasOwn(endpoint.headers, name))
79
+ continue;
78
80
  request.headers[name] = endpoint.headers[name].join(", ");
79
81
  }
80
82
  }
@@ -90,6 +92,8 @@ class HttpProtocol extends SerdeContext {
90
92
  };
91
93
  if (endpoint.headers) {
92
94
  for (const name in endpoint.headers) {
95
+ if (!hasOwn(endpoint.headers, name))
96
+ continue;
93
97
  request.headers[name] = endpoint.headers[name];
94
98
  }
95
99
  }
@@ -269,6 +273,8 @@ class HttpBindingProtocol extends HttpProtocol {
269
273
  }
270
274
  else if (typeof memberTraits.httpPrefixHeaders === "string") {
271
275
  for (const key in inputMemberValue) {
276
+ if (!hasOwn(inputMemberValue, key))
277
+ continue;
272
278
  const val = inputMemberValue[key];
273
279
  const amalgam = memberTraits.httpPrefixHeaders + key;
274
280
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
@@ -315,6 +321,8 @@ class HttpBindingProtocol extends HttpProtocol {
315
321
  const traits = ns.getMergedTraits();
316
322
  if (traits.httpQueryParams) {
317
323
  for (const key in data) {
324
+ if (!hasOwn(data, key))
325
+ continue;
318
326
  if (!(key in query)) {
319
327
  const val = data[key];
320
328
  const valueSchema = ns.getValueSchema();
@@ -358,6 +366,8 @@ class HttpBindingProtocol extends HttpProtocol {
358
366
  throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
359
367
  }
360
368
  for (const header in response.headers) {
369
+ if (!hasOwn(response.headers, header))
370
+ continue;
361
371
  const value = response.headers[header];
362
372
  delete response.headers[header];
363
373
  response.headers[header.toLowerCase()] = value;
@@ -445,6 +455,8 @@ class HttpBindingProtocol extends HttpProtocol {
445
455
  else if (memberTraits.httpPrefixHeaders !== undefined) {
446
456
  dataObject[memberName] = {};
447
457
  for (const header in response.headers) {
458
+ if (!hasOwn(response.headers, header))
459
+ continue;
448
460
  if (header.startsWith(memberTraits.httpPrefixHeaders)) {
449
461
  const value = response.headers[header];
450
462
  const valueSchema = memberSchema.getValueSchema();
@@ -530,6 +542,8 @@ class RpcProtocol extends HttpProtocol {
530
542
  throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
531
543
  }
532
544
  for (const header in response.headers) {
545
+ if (!hasOwn(response.headers, header))
546
+ continue;
533
547
  const value = response.headers[header];
534
548
  delete response.headers[header];
535
549
  response.headers[header.toLowerCase()] = value;
@@ -1,6 +1,7 @@
1
1
  const { NoOpLogger, normalizeProvider } = require("@smithy/core/client");
2
2
  const { HttpResponse, HttpRequest } = require("@smithy/core/protocols");
3
3
  const { parseRfc7231DateTime, v4 } = require("@smithy/core/serde");
4
+ const { hasOwn } = require("@smithy/core/transport");
4
5
 
5
6
  const isStreamingPayload = (request) => request?.body instanceof ReadableStream;
6
7
 
@@ -92,7 +93,9 @@ function parseRetryAfterHeader(response, logger) {
92
93
  if (!HttpResponse.isInstance(response)) {
93
94
  return;
94
95
  }
95
- for (const header of Object.keys(response.headers)) {
96
+ for (const header in response.headers) {
97
+ if (!hasOwn(response.headers, header))
98
+ continue;
96
99
  const h = header.toLowerCase();
97
100
  if (h === "retry-after") {
98
101
  const retryAfter = response.headers[header];
@@ -2,6 +2,7 @@ const { Readable } = require("node:stream");
2
2
  const { NoOpLogger, normalizeProvider } = require("@smithy/core/client");
3
3
  const { HttpResponse, HttpRequest } = require("@smithy/core/protocols");
4
4
  const { parseRfc7231DateTime, v4 } = require("@smithy/core/serde");
5
+ const { hasOwn } = require("@smithy/core/transport");
5
6
 
6
7
  const isStreamingPayload = (request) => request?.body instanceof Readable ||
7
8
  (typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream);
@@ -94,7 +95,9 @@ function parseRetryAfterHeader(response, logger) {
94
95
  if (!HttpResponse.isInstance(response)) {
95
96
  return;
96
97
  }
97
- for (const header of Object.keys(response.headers)) {
98
+ for (const header in response.headers) {
99
+ if (!hasOwn(response.headers, header))
100
+ continue;
98
101
  const h = header.toLowerCase();
99
102
  if (h === "retry-after") {
100
103
  const retryAfter = response.headers[header];
@@ -1,4 +1,5 @@
1
- const { HttpResponse } = require("@smithy/core/transport");
1
+ const { hasOwn, HttpResponse } = require("@smithy/core/transport");
2
+ exports.hasOwn = hasOwn;
2
3
  const { toEndpointV1 } = require("@smithy/core/endpoints");
3
4
 
4
5
  const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
@@ -291,6 +292,8 @@ const expectUnion = (value) => {
291
292
  const asObject = expectObject(value);
292
293
  const setKeys = [];
293
294
  for (const k in asObject) {
295
+ if (!hasOwn(asObject, k))
296
+ continue;
294
297
  if (asObject[k] != null) {
295
298
  setKeys.push(k);
296
299
  }
@@ -1,6 +1,7 @@
1
1
  const { createHmac, createHash, getRandomValues } = require("node:crypto");
2
+ const { hasOwn, HttpResponse } = require("@smithy/core/transport");
3
+ exports.hasOwn = hasOwn;
2
4
  const { ReadStream, lstatSync, fstatSync } = require("node:fs");
3
- const { HttpResponse } = require("@smithy/core/transport");
4
5
  const { toEndpointV1 } = require("@smithy/core/endpoints");
5
6
  const { Readable, Writable, PassThrough } = require("node:stream");
6
7
 
@@ -259,6 +260,8 @@ const expectUnion = (value) => {
259
260
  const asObject = expectObject(value);
260
261
  const setKeys = [];
261
262
  for (const k in asObject) {
263
+ if (!hasOwn(asObject, k))
264
+ continue;
262
265
  if (asObject[k] != null) {
263
266
  setKeys.push(k);
264
267
  }
@@ -1,4 +1,5 @@
1
- const { HttpResponse } = require("@smithy/core/transport");
1
+ const { hasOwn, HttpResponse } = require("@smithy/core/transport");
2
+ exports.hasOwn = hasOwn;
2
3
  const { toEndpointV1 } = require("@smithy/core/endpoints");
3
4
 
4
5
  const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
@@ -291,6 +292,8 @@ const expectUnion = (value) => {
291
292
  const asObject = expectObject(value);
292
293
  const setKeys = [];
293
294
  for (const k in asObject) {
295
+ if (!hasOwn(asObject, k))
296
+ continue;
294
297
  if (asObject[k] != null) {
295
298
  setKeys.push(k);
296
299
  }
@@ -2,6 +2,10 @@ const { SMITHY_CONTEXT_KEY } = require("@smithy/types");
2
2
 
3
3
  const getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});
4
4
 
5
+ function hasOwn(o, k) {
6
+ return Object.prototype.hasOwnProperty.call(o, k);
7
+ }
8
+
5
9
  class HttpRequest {
6
10
  method;
7
11
  protocol;
@@ -161,6 +165,8 @@ const toEndpointV1 = (endpoint) => {
161
165
  if (endpoint.headers) {
162
166
  v1Endpoint.headers = {};
163
167
  for (const name in endpoint.headers) {
168
+ if (!hasOwn(endpoint.headers, name))
169
+ continue;
164
170
  v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
165
171
  }
166
172
  }
@@ -174,6 +180,7 @@ const toEndpointV1 = (endpoint) => {
174
180
  exports.HttpRequest = HttpRequest;
175
181
  exports.HttpResponse = HttpResponse;
176
182
  exports.getSmithyContext = getSmithyContext;
183
+ exports.hasOwn = hasOwn;
177
184
  exports.isValidHostLabel = isValidHostLabel;
178
185
  exports.isValidHostname = isValidHostname;
179
186
  exports.normalizeProvider = normalizeProvider;
@@ -1,7 +1,10 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  export class DefaultIdentityProviderConfig {
2
3
  authSchemes = new Map();
3
4
  constructor(config) {
4
5
  for (const key in config) {
6
+ if (!hasOwn(config, key))
7
+ continue;
5
8
  const value = config[key];
6
9
  if (value !== undefined) {
7
10
  this.authSchemes.set(key, value);
@@ -271,23 +271,39 @@ function decodeTagValue(at, to, minor, unsignedInt, offset) {
271
271
  }
272
272
  else if (minor === 4) {
273
273
  const decimalFraction = decode(at + offset, to);
274
- const [exponent, mantissa] = decimalFraction;
274
+ const [rawExponent, mantissa] = decimalFraction;
275
275
  const normalizer = mantissa < 0 ? -1 : 1;
276
- const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
277
- let numericString;
276
+ const absMantissa = BigInt(normalizer) * BigInt(mantissa);
277
+ const mantissaDigits = String(absMantissa);
278
278
  const sign = mantissa < 0 ? "-" : "";
279
- numericString =
280
- exponent === 0
281
- ? mantissaStr
282
- : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
283
- numericString = numericString.replace(/^0+/g, "");
284
- if (numericString === "") {
285
- numericString = "0";
279
+ let numericString;
280
+ const isSmallExponent = typeof rawExponent === "number" && Math.abs(rawExponent) <= 2 ** 28;
281
+ if (isSmallExponent) {
282
+ const exponent = rawExponent;
283
+ const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + mantissaDigits;
284
+ numericString =
285
+ exponent === 0
286
+ ? mantissaStr
287
+ : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
288
+ numericString = numericString.replace(/^0+/g, "");
289
+ if (numericString === "") {
290
+ numericString = "0";
291
+ }
292
+ if (numericString[0] === ".") {
293
+ numericString = "0" + numericString;
294
+ }
295
+ numericString = sign + numericString;
286
296
  }
287
- if (numericString[0] === ".") {
288
- numericString = "0" + numericString;
297
+ else {
298
+ const bigExponent = BigInt(rawExponent);
299
+ if (mantissaDigits.length === 1) {
300
+ numericString = sign + mantissaDigits + "e" + String(bigExponent);
301
+ }
302
+ else {
303
+ const adjustedExp = bigExponent + BigInt(mantissaDigits.length - 1);
304
+ numericString = sign + mantissaDigits[0] + "." + mantissaDigits.slice(1) + "e" + String(adjustedExp);
305
+ }
289
306
  }
290
- numericString = sign + numericString;
291
307
  _offset = offset + _offset;
292
308
  return nv(numericString);
293
309
  }
@@ -155,13 +155,21 @@ export function encode(_input) {
155
155
  }
156
156
  else if (typeof input === "object") {
157
157
  if (input instanceof NumericValue) {
158
- const decimalIndex = input.string.indexOf(".");
159
- const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;
160
- const mantissa = BigInt(input.string.replace(".", ""));
158
+ let str = input.string;
159
+ let expOffset = BigInt(0);
160
+ const eIndex = str.search(/[eE]/);
161
+ if (eIndex !== -1) {
162
+ expOffset = BigInt(str.slice(eIndex + 1));
163
+ str = str.slice(0, eIndex);
164
+ }
165
+ const decimalIndex = str.indexOf(".");
166
+ const fractionDigits = decimalIndex === -1 ? 0 : str.length - decimalIndex - 1;
167
+ const exponent = expOffset - BigInt(fractionDigits);
168
+ const mantissa = BigInt(str.replace(".", ""));
161
169
  data[cursor++] = 0b110_00100;
162
170
  encodeInteger(majorList, 2);
163
171
  encodeStack.push(mantissa);
164
- encodeStack.push(exponent);
172
+ encodeStack.push(exponent >= -0x20000000000000n && exponent <= 0x1fffffffffffffn ? Number(exponent) : exponent);
165
173
  continue;
166
174
  }
167
175
  if (input[tagSymbol]) {
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { SerdeContext } from "@smithy/core/protocols";
2
3
  import { NormalizedSchema } from "@smithy/core/schema";
3
4
  import { NumericValue, _parseEpochTimestamp, fromBase64 } from "@smithy/core/serde";
@@ -59,6 +60,8 @@ export class CborShapeDeserializer extends SerdeContext {
59
60
  if (ns.isMapSchema()) {
60
61
  const targetSchema = ns.getValueSchema();
61
62
  for (const key in value) {
63
+ if (!hasOwn(value, key))
64
+ continue;
62
65
  const itemValue = this.readValue(targetSchema, value[key]);
63
66
  newObject[key] = itemValue;
64
67
  }
@@ -69,6 +72,8 @@ export class CborShapeDeserializer extends SerdeContext {
69
72
  if (isUnion) {
70
73
  keys = new Set();
71
74
  for (const k in value) {
75
+ if (!hasOwn(value, k))
76
+ continue;
72
77
  if (k !== "__type") {
73
78
  keys.add(k);
74
79
  }
@@ -85,6 +90,8 @@ export class CborShapeDeserializer extends SerdeContext {
85
90
  if (isUnion && keys?.size === 1) {
86
91
  let newObjectEmpty = true;
87
92
  for (const _ in newObject) {
93
+ if (!hasOwn(newObject, _))
94
+ continue;
88
95
  newObjectEmpty = false;
89
96
  break;
90
97
  }
@@ -95,6 +102,8 @@ export class CborShapeDeserializer extends SerdeContext {
95
102
  }
96
103
  else if (typeof value.__type === "string") {
97
104
  for (const k in value) {
105
+ if (!hasOwn(value, k))
106
+ continue;
98
107
  if (!(k in newObject)) {
99
108
  newObject[k] = value[k];
100
109
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { SerdeContext } from "@smithy/core/protocols";
2
3
  import { NormalizedSchema } from "@smithy/core/schema";
3
4
  import { fromBase64, generateIdempotencyToken } from "@smithy/core/serde";
@@ -49,6 +50,8 @@ export class CborShapeSerializer extends SerdeContext {
49
50
  if (ns.isMapSchema()) {
50
51
  const sparse = !!ns.getMergedTraits().sparse;
51
52
  for (const key in sourceObject) {
53
+ if (!hasOwn(sourceObject, key))
54
+ continue;
52
55
  const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
53
56
  if (value != null || sparse) {
54
57
  newObject[key] = value;
@@ -69,6 +72,8 @@ export class CborShapeSerializer extends SerdeContext {
69
72
  }
70
73
  else if (typeof sourceObject.__type === "string") {
71
74
  for (const k in sourceObject) {
75
+ if (!hasOwn(sourceObject, k))
76
+ continue;
72
77
  if (!(k in newObject)) {
73
78
  newObject[k] = this.serialize(15, sourceObject[k]);
74
79
  }
@@ -85,6 +90,8 @@ export class CborShapeSerializer extends SerdeContext {
85
90
  return newArray;
86
91
  }
87
92
  for (const key in sourceObject) {
93
+ if (!hasOwn(sourceObject, key))
94
+ continue;
88
95
  newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
89
96
  }
90
97
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { SerdeContext } from "@smithy/core/protocols";
2
3
  import { NormalizedSchema } from "@smithy/core/schema";
3
4
  import { NumericValue, _parseEpochTimestamp, nv } from "@smithy/core/serde";
@@ -120,6 +121,8 @@ function readStruct(ns, count, startPos) {
120
121
  if (isUnion) {
121
122
  let resultEmpty = true;
122
123
  for (const _ in result) {
124
+ if (!hasOwn(result, _))
125
+ continue;
123
126
  resultEmpty = false;
124
127
  break;
125
128
  }
@@ -159,23 +162,39 @@ function readTag(ns) {
159
162
  if (tagNumber === 4) {
160
163
  const docSchema = NormalizedSchema.of(15);
161
164
  const pair = readValue(docSchema);
162
- const [exponent, mantissa] = pair;
165
+ const [rawExponent, mantissa] = pair;
163
166
  const normalizer = mantissa < 0 ? -1 : 1;
164
- const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
165
- let numericString;
167
+ const absMantissa = BigInt(normalizer) * BigInt(mantissa);
168
+ const mantissaDigits = String(absMantissa);
166
169
  const sign = mantissa < 0 ? "-" : "";
167
- numericString =
168
- exponent === 0
169
- ? mantissaStr
170
- : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
171
- numericString = numericString.replace(/^0+/g, "");
172
- if (numericString === "") {
173
- numericString = "0";
174
- }
175
- if (numericString[0] === ".") {
176
- numericString = "0" + numericString;
177
- }
178
- numericString = sign + numericString;
170
+ let numericString;
171
+ const isSmallExponent = typeof rawExponent === "number" && Math.abs(rawExponent) <= 2 ** 28;
172
+ if (isSmallExponent) {
173
+ const exponent = rawExponent;
174
+ const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + mantissaDigits;
175
+ numericString =
176
+ exponent === 0
177
+ ? mantissaStr
178
+ : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
179
+ numericString = numericString.replace(/^0+/g, "");
180
+ if (numericString === "") {
181
+ numericString = "0";
182
+ }
183
+ if (numericString[0] === ".") {
184
+ numericString = "0" + numericString;
185
+ }
186
+ numericString = sign + numericString;
187
+ }
188
+ else {
189
+ const bigExponent = BigInt(rawExponent);
190
+ if (mantissaDigits.length === 1) {
191
+ numericString = sign + mantissaDigits + "e" + String(bigExponent);
192
+ }
193
+ else {
194
+ const adjustedExp = bigExponent + BigInt(mantissaDigits.length - 1);
195
+ numericString = sign + mantissaDigits[0] + "." + mantissaDigits.slice(1) + "e" + String(adjustedExp);
196
+ }
197
+ }
179
198
  return nv(numericString);
180
199
  }
181
200
  const docSchema = NormalizedSchema.of(15);
@@ -272,6 +291,8 @@ function readMapIndefinite(ns) {
272
291
  if (isUnion) {
273
292
  let resultEmpty = true;
274
293
  for (const _ in result) {
294
+ if (!hasOwn(result, _))
295
+ continue;
275
296
  resultEmpty = false;
276
297
  break;
277
298
  }
@@ -576,6 +597,8 @@ function transformObject(ns, value) {
576
597
  if (ns.isMapSchema()) {
577
598
  const targetSchema = ns.getValueSchema();
578
599
  for (const key in value) {
600
+ if (!hasOwn(value, key))
601
+ continue;
579
602
  newObject[key] = transformObject(targetSchema, value[key]);
580
603
  }
581
604
  }
@@ -585,6 +608,8 @@ function transformObject(ns, value) {
585
608
  if (isUnion) {
586
609
  keys = new Set();
587
610
  for (const k in value) {
611
+ if (!hasOwn(value, k))
612
+ continue;
588
613
  if (k !== "__type") {
589
614
  keys.add(k);
590
615
  }
@@ -601,6 +626,8 @@ function transformObject(ns, value) {
601
626
  if (isUnion && keys?.size === 1) {
602
627
  let newObjectEmpty = true;
603
628
  for (const _ in newObject) {
629
+ if (!hasOwn(newObject, _))
630
+ continue;
604
631
  newObjectEmpty = false;
605
632
  break;
606
633
  }
@@ -611,6 +638,8 @@ function transformObject(ns, value) {
611
638
  }
612
639
  else if (typeof value.__type === "string") {
613
640
  for (const k in value) {
641
+ if (!hasOwn(value, k))
642
+ continue;
614
643
  if (!(k in newObject)) {
615
644
  newObject[k] = value[k];
616
645
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { SerdeContext } from "@smithy/core/protocols";
2
3
  import { NormalizedSchema } from "@smithy/core/schema";
3
4
  import { NumericValue, fromBase64, generateIdempotencyToken } from "@smithy/core/serde";
@@ -253,6 +254,8 @@ function writeStruct(ns, value, serdeContext) {
253
254
  }
254
255
  if (typeof value.__type === "string") {
255
256
  for (const k in value) {
257
+ if (!hasOwn(value, k))
258
+ continue;
256
259
  if (!memberNames.includes(k)) {
257
260
  writeString(k);
258
261
  writeUntypedValue(value[k]);
@@ -318,6 +321,8 @@ function writeMap(ns, value, isDocument, serdeContext) {
318
321
  const valueSchema = ns.getValueSchema();
319
322
  const keys = [];
320
323
  for (const k in value) {
324
+ if (!hasOwn(value, k))
325
+ continue;
321
326
  const v = value[k];
322
327
  if (isDocument ? v !== undefined : v != null || sparse) {
323
328
  keys.push(k);
@@ -579,14 +584,27 @@ function writeTag(tagValue, innerValue) {
579
584
  writeUntypedValue(innerValue);
580
585
  }
581
586
  function writeNumericValue(nv) {
582
- const decimalIndex = nv.string.indexOf(".");
583
- const exponent = decimalIndex === -1 ? 0 : decimalIndex - nv.string.length + 1;
584
- const mantissa = BigInt(nv.string.replace(".", ""));
587
+ let str = nv.string;
588
+ let expOffset = BigInt(0);
589
+ const eIndex = str.search(/[eE]/);
590
+ if (eIndex !== -1) {
591
+ expOffset = BigInt(str.slice(eIndex + 1));
592
+ str = str.slice(0, eIndex);
593
+ }
594
+ const decimalIndex = str.indexOf(".");
595
+ const fractionDigits = decimalIndex === -1 ? 0 : str.length - decimalIndex - 1;
596
+ const exponent = expOffset - BigInt(fractionDigits);
597
+ const mantissa = BigInt(str.replace(".", ""));
585
598
  ensure(9);
586
599
  buf[cursor++] = 0b110_00100;
587
600
  encodeHeader(majorList, 2);
588
601
  ensure(9);
589
- writeInteger(exponent);
602
+ if (exponent >= -0x20000000000000n && exponent <= 0x1fffffffffffffn) {
603
+ writeInteger(Number(exponent));
604
+ }
605
+ else {
606
+ writeBigInt(exponent);
607
+ }
590
608
  writeBigInt(mantissa);
591
609
  }
592
610
  function writeTimestamp(date) {
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { HttpRequest as __HttpRequest, collectBody } from "@smithy/core/protocols";
2
3
  import { calculateBodyLength } from "@smithy/core/serde";
3
4
  import { cbor } from "./cbor";
@@ -51,6 +52,8 @@ export const loadSmithyRpcV2CborErrorCode = (output, data) => {
51
52
  }
52
53
  let codeKey;
53
54
  for (const key in data) {
55
+ if (!hasOwn(data, key))
56
+ continue;
54
57
  if (key.toLowerCase() === "code") {
55
58
  codeKey = key;
56
59
  break;
@@ -83,6 +86,8 @@ export const buildHttpRpcRequest = async (context, headers, path, resolvedHostna
83
86
  }
84
87
  if (endpoint.headers) {
85
88
  for (const name in endpoint.headers) {
89
+ if (!hasOwn(endpoint.headers, name))
90
+ continue;
86
91
  contents.headers[name] = endpoint.headers[name];
87
92
  }
88
93
  }
@@ -1,9 +1,12 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { AlgorithmId, } from "@smithy/types";
2
3
  export { AlgorithmId };
3
4
  const knownAlgorithms = Object.values(AlgorithmId);
4
5
  export const getChecksumConfiguration = (runtimeConfig) => {
5
6
  const checksumAlgorithms = [];
6
7
  for (const id in AlgorithmId) {
8
+ if (!hasOwn(AlgorithmId, id))
9
+ continue;
7
10
  const algorithmId = AlgorithmId[id];
8
11
  if (runtimeConfig[algorithmId] === undefined) {
9
12
  continue;
@@ -1,7 +1,10 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  export const getValueFromTextNode = (obj) => {
2
3
  const textNodeName = "#text";
3
4
  for (const key in obj) {
4
- if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key][textNodeName] !== undefined) {
5
+ if (!hasOwn(obj, key))
6
+ continue;
7
+ if (obj[key][textNodeName] !== undefined) {
5
8
  obj[key] = obj[key][textNodeName];
6
9
  }
7
10
  else if (typeof obj[key] === "object" && obj[key] !== null) {
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  export function map(arg0, arg1, arg2) {
2
3
  let target;
3
4
  let filter;
@@ -17,7 +18,9 @@ export function map(arg0, arg1, arg2) {
17
18
  instructions = arg1;
18
19
  }
19
20
  }
20
- for (const key of Object.keys(instructions)) {
21
+ for (const key in instructions) {
22
+ if (!hasOwn(instructions, key))
23
+ continue;
21
24
  if (!Array.isArray(instructions[key])) {
22
25
  target[key] = instructions[key];
23
26
  continue;
@@ -36,6 +39,8 @@ export const convertMap = (target) => {
36
39
  export const take = (source, instructions) => {
37
40
  const out = {};
38
41
  for (const key in instructions) {
42
+ if (!hasOwn(instructions, key))
43
+ continue;
39
44
  applyInstruction(out, source, instructions, key);
40
45
  }
41
46
  return out;
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  export const _json = (obj) => {
2
3
  if (obj == null) {
3
4
  return {};
@@ -7,7 +8,9 @@ export const _json = (obj) => {
7
8
  }
8
9
  if (typeof obj === "object") {
9
10
  const target = {};
10
- for (const key of Object.keys(obj)) {
11
+ for (const key in obj) {
12
+ if (!hasOwn(obj, key))
13
+ continue;
11
14
  if (obj[key] == null) {
12
15
  continue;
13
16
  }
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  import { debugId, toDebugString } from "./debug";
2
3
  import { EndpointError } from "./types";
3
4
  import { evaluateRules } from "./utils";
@@ -6,6 +7,8 @@ export const resolveEndpoint = (ruleSetObject, options) => {
6
7
  const { parameters, rules } = ruleSetObject;
7
8
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
8
9
  for (const paramKey in parameters) {
10
+ if (!hasOwn(parameters, paramKey))
11
+ continue;
9
12
  const parameter = parameters[paramKey];
10
13
  const endpointParam = endpointParams[paramKey];
11
14
  if (endpointParam == null && parameter.default != null) {