@aws-sdk/core 3.974.7 → 3.974.9

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 (55) hide show
  1. package/dist-cjs/index.js +80 -57
  2. package/dist-cjs/submodules/account-id-endpoint/index.js +2 -2
  3. package/dist-cjs/submodules/client/index.js +17 -8
  4. package/dist-cjs/submodules/httpAuthSchemes/index.js +7 -7
  5. package/dist-cjs/submodules/protocols/index.js +56 -41
  6. package/dist-cjs/submodules/util/index.js +59 -0
  7. package/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.js +1 -1
  8. package/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js +15 -6
  9. package/dist-es/submodules/client/setFeature.js +1 -1
  10. package/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +1 -1
  11. package/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +1 -1
  12. package/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js +1 -1
  13. package/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -1
  14. package/dist-es/submodules/protocols/ProtocolLib.js +1 -1
  15. package/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +1 -1
  16. package/dist-es/submodules/protocols/common.js +2 -2
  17. package/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +7 -6
  18. package/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
  19. package/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +1 -1
  20. package/dist-es/submodules/protocols/json/JsonShapeSerializer.js +1 -2
  21. package/dist-es/submodules/protocols/json/awsExpectUnion.js +1 -1
  22. package/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +1 -2
  23. package/dist-es/submodules/protocols/json/parseJsonBody.js +28 -13
  24. package/dist-es/submodules/protocols/query/AwsQueryProtocol.js +1 -1
  25. package/dist-es/submodules/protocols/query/QueryShapeSerializer.js +2 -3
  26. package/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +1 -1
  27. package/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +2 -2
  28. package/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +2 -3
  29. package/dist-es/submodules/protocols/xml/parseXmlBody.js +1 -1
  30. package/dist-es/submodules/util/index.js +2 -0
  31. package/dist-es/submodules/util/util-arn-parser/arn.js +21 -0
  32. package/dist-es/submodules/util/util-format-url/format-url.js +29 -0
  33. package/dist-types/api-extractor-type-index.d.ts +1 -0
  34. package/dist-types/index.d.ts +1 -0
  35. package/dist-types/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +1 -1
  36. package/dist-types/submodules/client/emitWarningIfUnsupportedVersion.d.ts +1 -2
  37. package/dist-types/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +1 -1
  38. package/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
  39. package/dist-types/submodules/protocols/ProtocolLib.d.ts +1 -1
  40. package/dist-types/submodules/protocols/json/parseJsonBody.d.ts +4 -0
  41. package/dist-types/submodules/util/index.d.ts +2 -0
  42. package/dist-types/submodules/util/util-arn-parser/arn.d.ts +32 -0
  43. package/dist-types/submodules/util/util-format-url/format-url.d.ts +2 -0
  44. package/dist-types/ts3.4/api-extractor-type-index.d.ts +1 -0
  45. package/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +1 -1
  46. package/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +1 -1
  47. package/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
  48. package/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +1 -1
  49. package/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +6 -0
  50. package/dist-types/ts3.4/submodules/util/index.d.ts +2 -0
  51. package/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +14 -0
  52. package/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +4 -0
  53. package/package.json +16 -13
  54. package/util.d.ts +7 -0
  55. package/util.js +5 -0
package/dist-cjs/index.js CHANGED
@@ -1,33 +1,39 @@
1
1
  'use strict';
2
2
 
3
- var utilRetry = require('@smithy/util-retry');
4
- var protocolHttp = require('@smithy/protocol-http');
3
+ var retry = require('@smithy/core/retry');
4
+ var protocols = require('@smithy/core/protocols');
5
5
  var core = require('@smithy/core');
6
- var propertyProvider = require('@smithy/property-provider');
6
+ var config = require('@smithy/core/config');
7
7
  var client = require('@aws-sdk/core/client');
8
8
  var signatureV4 = require('@smithy/signature-v4');
9
9
  var cbor = require('@smithy/core/cbor');
10
10
  var schema = require('@smithy/core/schema');
11
- var smithyClient = require('@smithy/smithy-client');
12
- var protocols = require('@smithy/core/protocols');
11
+ var client$1 = require('@smithy/core/client');
13
12
  var serde = require('@smithy/core/serde');
14
- var utilBase64 = require('@smithy/util-base64');
15
- var utilUtf8 = require('@smithy/util-utf8');
16
13
  var xmlBuilder = require('@aws-sdk/xml-builder');
17
14
 
18
15
  const state = {
19
16
  warningEmitted: false,
20
17
  };
21
18
  const emitWarningIfUnsupportedVersion = (version) => {
22
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
23
- state.warningEmitted = true;
24
- process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
25
- no longer support Node.js ${version} in January 2026.
19
+ if (version && !state.warningEmitted) {
20
+ if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") {
21
+ state.warningEmitted = true;
22
+ return;
23
+ }
24
+ const userMajorVersion = parseInt(version.substring(1, version.indexOf(".")));
25
+ const vv = 22;
26
+ if (userMajorVersion < vv) {
27
+ state.warningEmitted = true;
28
+ process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
29
+ versions published after the first week of January 2027
30
+ will require node >=${vv}. You are running node ${version}.
26
31
 
27
- To continue receiving updates to AWS services, bug fixes, and security
28
- updates please upgrade to a supported Node.js LTS version.
32
+ To continue receiving updates to AWS services, bug fixes,
33
+ and security updates please upgrade to node >=${vv}.
29
34
 
30
35
  More information can be found at: https://a.co/c895JFp`);
36
+ }
31
37
  }
32
38
  };
33
39
 
@@ -55,7 +61,7 @@ function setCredentialFeature(credentials, feature, value) {
55
61
  return credentials;
56
62
  }
57
63
 
58
- utilRetry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
64
+ retry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
59
65
  function setFeature(context, feature, value) {
60
66
  if (!context.__aws_sdk_context) {
61
67
  context.__aws_sdk_context = {
@@ -76,7 +82,7 @@ function setTokenFeature(token, feature, value) {
76
82
  return token;
77
83
  }
78
84
 
79
- const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
85
+ const getDateHeader = (response) => protocols.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
80
86
 
81
87
  const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
82
88
 
@@ -115,7 +121,7 @@ const validateSigningProperties = async (signingProperties) => {
115
121
  };
116
122
  class AwsSdkSigV4Signer {
117
123
  async sign(httpRequest, identity, signingProperties) {
118
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
124
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
119
125
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
120
126
  }
121
127
  const validatedProps = await validateSigningProperties(signingProperties);
@@ -163,7 +169,7 @@ const AWSSDKSigV4Signer = AwsSdkSigV4Signer;
163
169
 
164
170
  class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
165
171
  async sign(httpRequest, identity, signingProperties) {
166
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
172
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
167
173
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
168
174
  }
169
175
  const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
@@ -213,7 +219,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
213
219
  if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
214
220
  return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
215
221
  }
216
- throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
222
+ throw new config.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
217
223
  tryNextLink: true,
218
224
  });
219
225
  },
@@ -221,7 +227,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
221
227
  if (profile.sigv4a_signing_region_set) {
222
228
  return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
223
229
  }
224
- throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", {
230
+ throw new config.ProviderError("sigv4a_signing_region_set not set in profile.", {
225
231
  tryNextLink: true,
226
232
  });
227
233
  },
@@ -448,7 +454,7 @@ class ProtocolLib {
448
454
  decorateServiceException(exception, additions = {}) {
449
455
  if (this.queryCompat) {
450
456
  const msg = exception.Message ?? additions.Message;
451
- const error = smithyClient.decorateServiceException(exception, additions);
457
+ const error = client$1.decorateServiceException(exception, additions);
452
458
  if (msg) {
453
459
  error.message = msg;
454
460
  }
@@ -463,7 +469,7 @@ class ProtocolLib {
463
469
  }
464
470
  return error;
465
471
  }
466
- return smithyClient.decorateServiceException(exception, additions);
472
+ return client$1.decorateServiceException(exception, additions);
467
473
  }
468
474
  setQueryCompatError(output, response) {
469
475
  const queryErrorHeader = response.headers?.["x-amzn-query-error"];
@@ -536,7 +542,7 @@ class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol {
536
542
  const ns = schema.NormalizedSchema.of(errorSchema);
537
543
  const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
538
544
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
539
- const exception = new ErrorCtor(message);
545
+ const exception = new ErrorCtor({});
540
546
  const output = {};
541
547
  for (const [name, member] of ns.structIterator()) {
542
548
  if (dataObject[name] != null) {
@@ -655,7 +661,7 @@ function jsonReviver(key, value, context) {
655
661
  return value;
656
662
  }
657
663
 
658
- const collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body));
664
+ const collectBodyString = (streamBody, context) => protocols.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? serde.toUtf8)(body));
659
665
 
660
666
  const parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
661
667
  if (encoded.length) {
@@ -679,7 +685,7 @@ const parseJsonErrorBody = async (errorBody, context) => {
679
685
  return value;
680
686
  };
681
687
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
682
- const sanitizeErrorCode = (rawValue) => {
688
+ const sanitizeErrorCode = (rawValue, removeNamespace = true) => {
683
689
  let cleanValue = rawValue;
684
690
  if (typeof cleanValue === "number") {
685
691
  cleanValue = cleanValue.toString();
@@ -690,23 +696,38 @@ const sanitizeErrorCode = (rawValue) => {
690
696
  if (cleanValue.indexOf(":") >= 0) {
691
697
  cleanValue = cleanValue.split(":")[0];
692
698
  }
693
- if (cleanValue.indexOf("#") >= 0) {
699
+ if (removeNamespace && cleanValue.indexOf("#") >= 0) {
694
700
  cleanValue = cleanValue.split("#")[1];
695
701
  }
696
702
  return cleanValue;
697
703
  };
698
704
  const loadRestJsonErrorCode = (output, data) => {
699
- const headerKey = findKey(output.headers, "x-amzn-errortype");
700
- if (headerKey !== undefined) {
701
- return sanitizeErrorCode(output.headers[headerKey]);
702
- }
703
- if (data && typeof data === "object") {
704
- const codeKey = findKey(data, "code");
705
- if (codeKey && data[codeKey] !== undefined) {
706
- return sanitizeErrorCode(data[codeKey]);
707
- }
708
- if (data["__type"] !== undefined) {
709
- return sanitizeErrorCode(data["__type"]);
705
+ return loadErrorCode(output, data, true, ["header", "code", "type"]);
706
+ };
707
+ const loadJsonRpcErrorCode = (output, data, removeNamespace, queryCompat = false) => {
708
+ return loadErrorCode(output, data, removeNamespace, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
709
+ };
710
+ const loadErrorCode = ({ headers }, data, removeNamespace, order) => {
711
+ while (order.length > 0) {
712
+ const location = order.shift();
713
+ switch (location) {
714
+ case "header":
715
+ const headerKey = findKey(headers ?? {}, "x-amzn-errortype");
716
+ if (headerKey !== undefined) {
717
+ return sanitizeErrorCode(headers[headerKey], removeNamespace);
718
+ }
719
+ break;
720
+ case "code":
721
+ const codeKey = findKey(data ?? {}, "code");
722
+ if (codeKey && data[codeKey] !== undefined) {
723
+ return sanitizeErrorCode(data[codeKey], removeNamespace);
724
+ }
725
+ break;
726
+ case "type":
727
+ if (data?.__type !== undefined) {
728
+ return sanitizeErrorCode(data.__type, removeNamespace);
729
+ }
730
+ break;
710
731
  }
711
732
  }
712
733
  };
@@ -785,7 +806,7 @@ class JsonShapeDeserializer extends SerdeContextConfig {
785
806
  }
786
807
  }
787
808
  if (ns.isBlobSchema() && typeof value === "string") {
788
- return utilBase64.fromBase64(value);
809
+ return serde.fromBase64(value);
789
810
  }
790
811
  const mediaType = ns.getMergedTraits().mediaType;
791
812
  if (ns.isStringSchema() && typeof value === "string" && mediaType) {
@@ -1003,7 +1024,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
1003
1024
  if (ns === this.rootSchema) {
1004
1025
  return value;
1005
1026
  }
1006
- return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
1027
+ return (this.serdeContext?.base64Encoder ?? serde.toBase64)(value);
1007
1028
  }
1008
1029
  if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
1009
1030
  const format = protocols.determineTimestampFormat(ns, this.settings);
@@ -1049,7 +1070,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
1049
1070
  if (ns === this.rootSchema) {
1050
1071
  return value;
1051
1072
  }
1052
- return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
1073
+ return (this.serdeContext?.base64Encoder ?? serde.toBase64)(value);
1053
1074
  }
1054
1075
  if (typeof value === "bigint") {
1055
1076
  this.useReplacer = true;
@@ -1141,16 +1162,17 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
1141
1162
  return this.codec;
1142
1163
  }
1143
1164
  async handleError(operationSchema, context, response, dataObject, metadata) {
1144
- if (this.awsQueryCompatible) {
1165
+ const { awsQueryCompatible } = this;
1166
+ if (awsQueryCompatible) {
1145
1167
  this.mixin.setQueryCompatError(dataObject, response);
1146
1168
  }
1147
- const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
1169
+ const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, this.getJsonRpcVersion() === "1.1", awsQueryCompatible) ?? "Unknown";
1148
1170
  this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1149
- const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
1171
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
1150
1172
  const ns = schema.NormalizedSchema.of(errorSchema);
1151
1173
  const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1152
1174
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1153
- const exception = new ErrorCtor(message);
1175
+ const exception = new ErrorCtor({});
1154
1176
  const output = {};
1155
1177
  const errorDeserializer = this.codec.createDeserializer();
1156
1178
  for (const [name, member] of ns.structIterator()) {
@@ -1158,7 +1180,7 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
1158
1180
  output[name] = errorDeserializer.readObject(member, dataObject[name]);
1159
1181
  }
1160
1182
  }
1161
- if (this.awsQueryCompatible) {
1183
+ if (awsQueryCompatible) {
1162
1184
  this.mixin.queryCompatOutput(dataObject, output);
1163
1185
  }
1164
1186
  throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
@@ -1273,7 +1295,7 @@ class AwsRestJsonProtocol extends protocols.HttpBindingProtocol {
1273
1295
  const ns = schema.NormalizedSchema.of(errorSchema);
1274
1296
  const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1275
1297
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1276
- const exception = new ErrorCtor(message);
1298
+ const exception = new ErrorCtor({});
1277
1299
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
1278
1300
  const output = {};
1279
1301
  const errorDeserializer = this.codec.createDeserializer();
@@ -1298,7 +1320,7 @@ const awsExpectUnion = (value) => {
1298
1320
  if (typeof value === "object" && "__type" in value) {
1299
1321
  delete value.__type;
1300
1322
  }
1301
- return smithyClient.expectUnion(value);
1323
+ return serde.expectUnion(value);
1302
1324
  };
1303
1325
 
1304
1326
  class XmlShapeDeserializer extends SerdeContextConfig {
@@ -1333,7 +1355,7 @@ class XmlShapeDeserializer extends SerdeContextConfig {
1333
1355
  }
1334
1356
  return output;
1335
1357
  }
1336
- const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes);
1358
+ const xmlString = (this.serdeContext?.utf8Encoder ?? serde.toUtf8)(bytes);
1337
1359
  const parsedObject = this.parseXml(xmlString);
1338
1360
  return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject);
1339
1361
  }
@@ -1442,7 +1464,7 @@ class XmlShapeDeserializer extends SerdeContextConfig {
1442
1464
  parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
1443
1465
  delete parsedObjToReturn[textNodeName];
1444
1466
  }
1445
- return smithyClient.getValueFromTextNode(parsedObjToReturn);
1467
+ return client$1.getValueFromTextNode(parsedObjToReturn);
1446
1468
  }
1447
1469
  return {};
1448
1470
  }
@@ -1466,7 +1488,7 @@ class QueryShapeSerializer extends SerdeContextConfig {
1466
1488
  if (ns.isBlobSchema()) {
1467
1489
  if (typeof value === "string" || value instanceof Uint8Array) {
1468
1490
  this.writeKey(prefix);
1469
- this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value));
1491
+ this.writeValue((this.serdeContext?.base64Encoder ?? serde.toBase64)(value));
1470
1492
  }
1471
1493
  }
1472
1494
  else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) {
@@ -1500,7 +1522,7 @@ class QueryShapeSerializer extends SerdeContextConfig {
1500
1522
  this.writeValue(value.toISOString().replace(".000Z", "Z"));
1501
1523
  break;
1502
1524
  case 6:
1503
- this.writeValue(smithyClient.dateToUtcString(value));
1525
+ this.writeValue(serde.dateToUtcString(value));
1504
1526
  break;
1505
1527
  case 7:
1506
1528
  this.writeValue(String(value.getTime() / 1000));
@@ -1724,7 +1746,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1724
1746
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
1725
1747
  const ns = schema.NormalizedSchema.of(errorSchema);
1726
1748
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1727
- const exception = new ErrorCtor(message);
1749
+ const exception = new ErrorCtor({});
1728
1750
  const output = {
1729
1751
  Type: errorData.Error.Type,
1730
1752
  Code: errorData.Error.Code,
@@ -1803,7 +1825,7 @@ const parseXmlBody = (streamBody, context) => collectBodyString(streamBody, cont
1803
1825
  parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
1804
1826
  delete parsedObjToReturn[textNodeName];
1805
1827
  }
1806
- return smithyClient.getValueFromTextNode(parsedObjToReturn);
1828
+ return client$1.getValueFromTextNode(parsedObjToReturn);
1807
1829
  }
1808
1830
  return {};
1809
1831
  });
@@ -1844,7 +1866,7 @@ class XmlShapeSerializer extends SerdeContextConfig {
1844
1866
  this.byteBuffer =
1845
1867
  "byteLength" in value
1846
1868
  ? value
1847
- : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);
1869
+ : (this.serdeContext?.base64Decoder ?? serde.fromBase64)(value);
1848
1870
  }
1849
1871
  else {
1850
1872
  this.buffer = this.writeStruct(ns, value, undefined);
@@ -2048,7 +2070,7 @@ class XmlShapeSerializer extends SerdeContextConfig {
2048
2070
  let nodeContents = null;
2049
2071
  if (value && typeof value === "object") {
2050
2072
  if (ns.isBlobSchema()) {
2051
- nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
2073
+ nodeContents = (this.serdeContext?.base64Encoder ?? serde.toBase64)(value);
2052
2074
  }
2053
2075
  else if (ns.isTimestampSchema() && value instanceof Date) {
2054
2076
  const format = protocols.determineTimestampFormat(ns, this.settings);
@@ -2057,14 +2079,14 @@ class XmlShapeSerializer extends SerdeContextConfig {
2057
2079
  nodeContents = value.toISOString().replace(".000Z", "Z");
2058
2080
  break;
2059
2081
  case 6:
2060
- nodeContents = smithyClient.dateToUtcString(value);
2082
+ nodeContents = serde.dateToUtcString(value);
2061
2083
  break;
2062
2084
  case 7:
2063
2085
  nodeContents = String(value.getTime() / 1000);
2064
2086
  break;
2065
2087
  default:
2066
2088
  console.warn("Missing timestamp format, using http date", value);
2067
- nodeContents = smithyClient.dateToUtcString(value);
2089
+ nodeContents = serde.dateToUtcString(value);
2068
2090
  break;
2069
2091
  }
2070
2092
  }
@@ -2203,7 +2225,7 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
2203
2225
  dataObject.Message ??
2204
2226
  "UnknownError";
2205
2227
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
2206
- const exception = new ErrorCtor(message);
2228
+ const exception = new ErrorCtor({});
2207
2229
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
2208
2230
  const output = {};
2209
2231
  const errorDeserializer = this.codec.createDeserializer();
@@ -2257,6 +2279,7 @@ exports.awsExpectUnion = awsExpectUnion;
2257
2279
  exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;
2258
2280
  exports.getBearerTokenEnvKey = getBearerTokenEnvKey;
2259
2281
  exports.getLongPollPlugin = getLongPollPlugin;
2282
+ exports.loadJsonRpcErrorCode = loadJsonRpcErrorCode;
2260
2283
  exports.loadRestJsonErrorCode = loadRestJsonErrorCode;
2261
2284
  exports.loadRestXmlErrorCode = loadRestXmlErrorCode;
2262
2285
  exports.parseJsonBody = parseJsonBody;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var utilMiddleware = require('@smithy/util-middleware');
3
+ var client = require('@smithy/core/client');
4
4
 
5
5
  const DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
6
6
  const ACCOUNT_ID_ENDPOINT_MODE_VALUES = ["disabled", "preferred", "required"];
@@ -10,7 +10,7 @@ function validateAccountIdEndpointMode(value) {
10
10
 
11
11
  const resolveAccountIdEndpointModeConfig = (input) => {
12
12
  const { accountIdEndpointMode } = input;
13
- const accountIdEndpointModeProvider = utilMiddleware.normalizeProvider(accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE);
13
+ const accountIdEndpointModeProvider = client.normalizeProvider(accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE);
14
14
  return Object.assign(input, {
15
15
  accountIdEndpointMode: async () => {
16
16
  const accIdMode = await accountIdEndpointModeProvider();
@@ -1,20 +1,29 @@
1
1
  'use strict';
2
2
 
3
- var utilRetry = require('@smithy/util-retry');
3
+ var retry = require('@smithy/core/retry');
4
4
 
5
5
  const state = {
6
6
  warningEmitted: false,
7
7
  };
8
8
  const emitWarningIfUnsupportedVersion = (version) => {
9
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
10
- state.warningEmitted = true;
11
- process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
12
- no longer support Node.js ${version} in January 2026.
9
+ if (version && !state.warningEmitted) {
10
+ if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") {
11
+ state.warningEmitted = true;
12
+ return;
13
+ }
14
+ const userMajorVersion = parseInt(version.substring(1, version.indexOf(".")));
15
+ const vv = 22;
16
+ if (userMajorVersion < vv) {
17
+ state.warningEmitted = true;
18
+ process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
19
+ versions published after the first week of January 2027
20
+ will require node >=${vv}. You are running node ${version}.
13
21
 
14
- To continue receiving updates to AWS services, bug fixes, and security
15
- updates please upgrade to a supported Node.js LTS version.
22
+ To continue receiving updates to AWS services, bug fixes,
23
+ and security updates please upgrade to node >=${vv}.
16
24
 
17
25
  More information can be found at: https://a.co/c895JFp`);
26
+ }
18
27
  }
19
28
  };
20
29
 
@@ -42,7 +51,7 @@ function setCredentialFeature(credentials, feature, value) {
42
51
  return credentials;
43
52
  }
44
53
 
45
- utilRetry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
54
+ retry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
46
55
  function setFeature(context, feature, value) {
47
56
  if (!context.__aws_sdk_context) {
48
57
  context.__aws_sdk_context = {
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var protocolHttp = require('@smithy/protocol-http');
3
+ var protocols = require('@smithy/core/protocols');
4
4
  var core = require('@smithy/core');
5
- var propertyProvider = require('@smithy/property-provider');
5
+ var config = require('@smithy/core/config');
6
6
  var client = require('@aws-sdk/core/client');
7
7
  var signatureV4 = require('@smithy/signature-v4');
8
8
 
9
- const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
9
+ const getDateHeader = (response) => protocols.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
10
10
 
11
11
  const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
12
12
 
@@ -45,7 +45,7 @@ const validateSigningProperties = async (signingProperties) => {
45
45
  };
46
46
  class AwsSdkSigV4Signer {
47
47
  async sign(httpRequest, identity, signingProperties) {
48
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
48
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
49
49
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
50
50
  }
51
51
  const validatedProps = await validateSigningProperties(signingProperties);
@@ -93,7 +93,7 @@ const AWSSDKSigV4Signer = AwsSdkSigV4Signer;
93
93
 
94
94
  class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
95
95
  async sign(httpRequest, identity, signingProperties) {
96
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
96
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
97
97
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
98
98
  }
99
99
  const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
@@ -143,7 +143,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
143
143
  if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
144
144
  return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
145
145
  }
146
- throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
146
+ throw new config.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
147
147
  tryNextLink: true,
148
148
  });
149
149
  },
@@ -151,7 +151,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
151
151
  if (profile.sigv4a_signing_region_set) {
152
152
  return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
153
153
  }
154
- throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", {
154
+ throw new config.ProviderError("sigv4a_signing_region_set not set in profile.", {
155
155
  tryNextLink: true,
156
156
  });
157
157
  },